{
  "schemaVersion": "1.0",
  "item": {
    "slug": "chat-bot",
    "name": "Pywayne Llm Chat Bot",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/wangyendt/chat-bot",
    "canonicalUrl": "https://clawhub.ai/wangyendt/chat-bot",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/chat-bot",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=chat-bot",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "slug": "chat-bot",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T15:50:28.732Z",
      "expiresAt": "2026-05-14T15:50:28.732Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=chat-bot",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=chat-bot",
        "contentDisposition": "attachment; filename=\"chat-bot-0.1.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "chat-bot"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/chat-bot"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/chat-bot",
    "agentPageUrl": "https://openagent3.xyz/skills/chat-bot/agent",
    "manifestUrl": "https://openagent3.xyz/skills/chat-bot/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/chat-bot/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Pywayne LLM Chat Bot",
        "body": "This module provides a synchronous LLM chat interface compatible with OpenAI APIs (including local servers like Ollama)."
      },
      {
        "title": "Quick Start",
        "body": "from pywayne.llm.chat_bot import LLMChat\n\n# Create chat instance\nchat = LLMChat(\n    base_url=\"https://api.example.com/v1\",\n    api_key=\"your_api_key\",\n    model=\"deepseek-chat\"\n)\n\n# Single-turn conversation (non-streaming)\nresponse = chat.ask(\"Hello, LLM!\", stream=False)\nprint(response)\n\n# Streaming response\nfor token in chat.ask(\"Explain recursion\", stream=True):\n    print(token, end='', flush=True)"
      },
      {
        "title": "Multi-turn Conversation",
        "body": "# Use chat() for history tracking\nfor token in chat.chat(\"What is a class in Python?\"):\n    print(token, end='', flush=True)\n\n# Continuation - remembers previous context\nfor token in chat.chat(\"How do I define a constructor?\"):\n    print(token, end='', flush=True)\n\n# View history\nfor msg in chat.history:\n    print(f\"{msg['role']}: {msg['content']}\")\n\n# Clear history\nchat.clear_history()"
      },
      {
        "title": "LLMConfig Class",
        "body": "from pywayne.llm.chat_bot import LLMConfig\n\nconfig = LLMConfig(\n    base_url=\"https://api.example.com/v1\",\n    api_key=\"your_api_key\",\n    model=\"deepseek-chat\",\n    temperature=0.7,\n    max_tokens=8192,\n    top_p=1.0,\n    frequency_penalty=0.0,\n    presence_penalty=0.0,\n    system_prompt=\"You are a helpful assistant\"\n)\n\nchat = LLMChat(**config.to_dict())"
      },
      {
        "title": "Dynamic System Prompt Update",
        "body": "chat.update_system_prompt(\"You are now a Python expert, provide code examples\")"
      },
      {
        "title": "Managing Multiple Sessions",
        "body": "from pywayne.llm.chat_bot import ChatManager\n\nmanager = ChatManager(\n    base_url=\"https://api.example.com/v1\",\n    api_key=\"your_api_key\",\n    model=\"deepseek-chat\",\n    timeout=300  # Session timeout in seconds\n)\n\n# Get or create chat instance (maintains per-session history)\nchat1 = manager.get_chat(\"user1\")\nchat2 = manager.get_chat(\"user2\")\n\n# Sessions are independent\nchat1.chat(\"Hello from user1\")\nchat2.chat(\"Hello from user2\")\n\n# Remove a session\nmanager.remove_chat(\"user1\")"
      },
      {
        "title": "Custom Configuration per Session",
        "body": "custom_config = LLMConfig(\n    base_url=base_url,\n    api_key=api_key,\n    model=\"deepseek-chat\",\n    temperature=0.9,\n    system_prompt=\"You are a creative writer\"\n)\n\nchat3 = manager.get_chat(\"user3\", config=custom_config)"
      },
      {
        "title": "LLMChat",
        "body": "MethodDescriptionask(prompt, stream=False)Single-turn conversation without historychat(prompt, stream=True)Multi-turn conversation with history trackingupdate_system_prompt(prompt)Update system prompt in-placeclear_history()Clear conversation history (keeps system prompt)history (property)Get copy of current conversation history"
      },
      {
        "title": "ChatManager",
        "body": "MethodDescriptionget_chat(chat_id, stream=True, config=None)Get or create chat instance by IDremove_chat(chat_id)Remove chat session"
      },
      {
        "title": "Parameters",
        "body": "ParameterDefaultDescriptionbase_urlrequiredAPI base URL (e.g., https://api.deepseek.com/v1)api_keyrequiredAPI authentication keymodel\"deepseek-chat\"Model nametemperature0.7Controls randomness (0-2)max_tokens2048/8192Maximum output tokenstop_p1.0Nucleus sampling (0-1)frequency_penalty0.0Reduces repetition (-2 to 2)presence_penalty0.0Encourages new topics (-2 to 2)system_prompt\"你是一个严谨的助手\"System messagetimeoutinfSession timeout in seconds (ChatManager only)"
      }
    ],
    "body": "Pywayne LLM Chat Bot\n\nThis module provides a synchronous LLM chat interface compatible with OpenAI APIs (including local servers like Ollama).\n\nQuick Start\nfrom pywayne.llm.chat_bot import LLMChat\n\n# Create chat instance\nchat = LLMChat(\n    base_url=\"https://api.example.com/v1\",\n    api_key=\"your_api_key\",\n    model=\"deepseek-chat\"\n)\n\n# Single-turn conversation (non-streaming)\nresponse = chat.ask(\"Hello, LLM!\", stream=False)\nprint(response)\n\n# Streaming response\nfor token in chat.ask(\"Explain recursion\", stream=True):\n    print(token, end='', flush=True)\n\nMulti-turn Conversation\n# Use chat() for history tracking\nfor token in chat.chat(\"What is a class in Python?\"):\n    print(token, end='', flush=True)\n\n# Continuation - remembers previous context\nfor token in chat.chat(\"How do I define a constructor?\"):\n    print(token, end='', flush=True)\n\n# View history\nfor msg in chat.history:\n    print(f\"{msg['role']}: {msg['content']}\")\n\n# Clear history\nchat.clear_history()\n\nConfiguration\nLLMConfig Class\nfrom pywayne.llm.chat_bot import LLMConfig\n\nconfig = LLMConfig(\n    base_url=\"https://api.example.com/v1\",\n    api_key=\"your_api_key\",\n    model=\"deepseek-chat\",\n    temperature=0.7,\n    max_tokens=8192,\n    top_p=1.0,\n    frequency_penalty=0.0,\n    presence_penalty=0.0,\n    system_prompt=\"You are a helpful assistant\"\n)\n\nchat = LLMChat(**config.to_dict())\n\nDynamic System Prompt Update\nchat.update_system_prompt(\"You are now a Python expert, provide code examples\")\n\nManaging Multiple Sessions\nfrom pywayne.llm.chat_bot import ChatManager\n\nmanager = ChatManager(\n    base_url=\"https://api.example.com/v1\",\n    api_key=\"your_api_key\",\n    model=\"deepseek-chat\",\n    timeout=300  # Session timeout in seconds\n)\n\n# Get or create chat instance (maintains per-session history)\nchat1 = manager.get_chat(\"user1\")\nchat2 = manager.get_chat(\"user2\")\n\n# Sessions are independent\nchat1.chat(\"Hello from user1\")\nchat2.chat(\"Hello from user2\")\n\n# Remove a session\nmanager.remove_chat(\"user1\")\n\nCustom Configuration per Session\ncustom_config = LLMConfig(\n    base_url=base_url,\n    api_key=api_key,\n    model=\"deepseek-chat\",\n    temperature=0.9,\n    system_prompt=\"You are a creative writer\"\n)\n\nchat3 = manager.get_chat(\"user3\", config=custom_config)\n\nAPI Reference\nLLMChat\nMethod\tDescription\nask(prompt, stream=False)\tSingle-turn conversation without history\nchat(prompt, stream=True)\tMulti-turn conversation with history tracking\nupdate_system_prompt(prompt)\tUpdate system prompt in-place\nclear_history()\tClear conversation history (keeps system prompt)\nhistory (property)\tGet copy of current conversation history\nChatManager\nMethod\tDescription\nget_chat(chat_id, stream=True, config=None)\tGet or create chat instance by ID\nremove_chat(chat_id)\tRemove chat session\nParameters\nParameter\tDefault\tDescription\nbase_url\trequired\tAPI base URL (e.g., https://api.deepseek.com/v1)\napi_key\trequired\tAPI authentication key\nmodel\t\"deepseek-chat\"\tModel name\ntemperature\t0.7\tControls randomness (0-2)\nmax_tokens\t2048/8192\tMaximum output tokens\ntop_p\t1.0\tNucleus sampling (0-1)\nfrequency_penalty\t0.0\tReduces repetition (-2 to 2)\npresence_penalty\t0.0\tEncourages new topics (-2 to 2)\nsystem_prompt\t\"你是一个严谨的助手\"\tSystem message\ntimeout\tinf\tSession timeout in seconds (ChatManager only)"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/wangyendt/chat-bot",
    "publisherUrl": "https://clawhub.ai/wangyendt/chat-bot",
    "owner": "wangyendt",
    "version": "0.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/chat-bot",
    "downloadUrl": "https://openagent3.xyz/downloads/chat-bot",
    "agentUrl": "https://openagent3.xyz/skills/chat-bot/agent",
    "manifestUrl": "https://openagent3.xyz/skills/chat-bot/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/chat-bot/agent.md"
  }
}