[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EV9QYGZ7DYR37XY0QQA5R4":3,"skill-same:01M6EV9QYGZ7DYR37XY0QQA5R4":98},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":50,"ownerHtmlUrl":51,"ownerBlogUrl":6,"ownerDescription":52,"updatedAt":53,"install":54,"resources":67},"01M6EV9QYGZ7DYR37XY0QQA5R4","python-sdk",null,"Python SDK for inference.sh - run AI apps, build agents, and integrate with 150+ models. Package: inferencesh (pip install inferencesh). Supports sync\u002Fasync, streaming, file uploads. Build agents with template or ad-hoc patterns, tool builder API, skills, and human approval. Use for: Python integration, AI apps, agent development, RAG pipelines, automation. Triggers: python sdk, inferencesh, pip install, python api, python client, async inference, python agent, tool builder python, programmatic ai, python integration, sdk python","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Finferen-sh\u002Fpython-sdk\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"sdk","python","python sdk","apps","human","patterns","async","builder","integrate","install","template","Bash","api","file uploads","agent development","streaming","run","development","rag","sync","2026-11-10 10:12:30",false,"---\nname: python-sdk\ndescription: \"Python SDK for inference.sh - run AI apps, build agents, and integrate with 150+ models. Package: inferencesh (pip install inferencesh). Supports sync\u002Fasync, streaming, file uploads. Build agents with template or ad-hoc patterns, tool builder API, skills, and human approval. Use for: Python integration, AI apps, agent development, RAG pipelines, automation. Triggers: python sdk, inferencesh, pip install, python api, python client, async inference, python agent, tool builder python, programmatic ai, python integration, sdk python\"\nallowed-tools: Bash(pip install inferencesh), Bash(python *)\n---\n\n# Python SDK\n\nBuild AI applications with the [inference.sh](https:\u002F\u002Finference.sh) Python SDK.\n\n![Python SDK](https:\u002F\u002Fcloud.inference.sh\u002Fapp\u002Ffiles\u002Fu\u002F4mg21r6ta37mpaz6ktzwtt8krr\u002F01kgvftjwhby36trvaj66bwzcf.jpeg)\n\n## Quick Start\n\n```bash\npip install inferencesh\n```\n\n```python\nfrom inferencesh import inference\n\nclient = inference(api_key=\"inf_your_key\")\n\n# Run an AI app\nresult = client.run({\n    \"app\": \"infsh\u002Fflux-1-dev\",\n    \"input\": {\"prompt\": \"A sunset over mountains\"}\n})\nprint(result[\"output\"])\n```\n\n## Installation\n\n```bash\n# Standard installation\npip install inferencesh\n\n# With async support\npip install inferencesh[async]\n```\n\n**Requirements:** Python 3.8+\n\n## Authentication\n\n```python\nimport os\nfrom inferencesh import inference\n\n# Direct API key\nclient = inference(api_key=\"inf_your_key\")\n\n# From environment variable (recommended)\nclient = inference(api_key=os.environ[\"INFERENCE_API_KEY\"])\n```\n\nGet your API key: Settings → API Keys → Create API Key\n\n## Running Apps\n\n### Basic Execution\n\n```python\nresult = client.run({\n    \"app\": \"infsh\u002Fflux-1-dev\",\n    \"input\": {\"prompt\": \"A cat astronaut\"}\n})\n\nprint(result[\"status\"])  # \"completed\"\nprint(result[\"output\"])  # Output data\n```\n\n### Fire and Forget\n\n```python\ntask = client.run({\n    \"app\": \"google\u002Fveo-3-1-fast\",\n    \"input\": {\"prompt\": \"Drone flying over mountains\"}\n}, wait=False)\n\nprint(f\"Task ID: {task['id']}\")\n# Check later with client.get_task(task['id'])\n```\n\n### Streaming Progress\n\n```python\nfor update in client.run({\n    \"app\": \"google\u002Fveo-3-1-fast\",\n    \"input\": {\"prompt\": \"Ocean waves at sunset\"}\n}, stream=True):\n    print(f\"Status: {update['status']}\")\n    if update.get(\"logs\"):\n        print(update[\"logs\"][-1])\n```\n\n### Run Parameters\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `app` | string | App ID (namespace\u002Fname@version) |\n| `input` | dict | Input matching app schema |\n| `setup` | dict | Hidden setup configuration |\n| `infra` | string | 'cloud' or 'private' |\n| `session` | string | Session ID for stateful execution |\n| `session_timeout` | int | Idle timeout (1-3600 seconds) |\n\n## File Handling\n\n### Automatic Upload\n\n```python\nresult = client.run({\n    \"app\": \"image-processor\",\n    \"input\": {\n        \"image\": \"\u002Fpath\u002Fto\u002Fimage.png\"  # Auto-uploaded\n    }\n})\n```\n\n### Manual Upload\n\n```python\nfrom inferencesh import UploadFileOptions\n\n# Basic upload\nfile = client.upload_file(\"\u002Fpath\u002Fto\u002Fimage.png\")\n\n# With options\nfile = client.upload_file(\n    \"\u002Fpath\u002Fto\u002Fimage.png\",\n    UploadFileOptions(\n        filename=\"custom_name.png\",\n        content_type=\"image\u002Fpng\",\n        public=True\n    )\n)\n\nresult = client.run({\n    \"app\": \"image-processor\",\n    \"input\": {\"image\": file[\"uri\"]}\n})\n```\n\n## Sessions (Stateful Execution)\n\nKeep workers warm across multiple calls:\n\n```python\n# Start new session\nresult = client.run({\n    \"app\": \"my-app\",\n    \"input\": {\"action\": \"init\"},\n    \"session\": \"new\",\n    \"session_timeout\": 300  # 5 minutes\n})\nsession_id = result[\"session_id\"]\n\n# Continue in same session\nresult = client.run({\n    \"app\": \"my-app\",\n    \"input\": {\"action\": \"process\"},\n    \"session\": session_id\n})\n```\n\n## Agent SDK\n\n### Template Agents\n\nUse pre-built agents from your workspace:\n\n```python\nagent = client.agent(\"my-team\u002Fsupport-agent@latest\")\n\n# Send message\nresponse = agent.send_message(\"Hello!\")\nprint(response.text)\n\n# Multi-turn conversation\nresponse = agent.send_message(\"Tell me more\")\n\n# Reset conversation\nagent.reset()\n\n# Get chat history\nchat = agent.get_chat()\n```\n\n### Ad-hoc Agents\n\nCreate custom agents programmatically:\n\n```python\nfrom inferencesh import tool, string, number, app_tool\n\n# Define tools\ncalculator = (\n    tool(\"calculate\")\n    .describe(\"Perform a calculation\")\n    .param(\"expression\", string(\"Math expression\"))\n    .build()\n)\n\nimage_gen = (\n    app_tool(\"generate_image\", \"infsh\u002Fflux-1-dev@latest\")\n    .describe(\"Generate an image\")\n    .param(\"prompt\", string(\"Image description\"))\n    .build()\n)\n\n# Create agent\nagent = client.agent({\n    \"core_app\": {\"ref\": \"infsh\u002Fclaude-sonnet-4@latest\"},\n    \"system_prompt\": \"You are a helpful assistant.\",\n    \"tools\": [calculator, image_gen],\n    \"temperature\": 0.7,\n    \"max_tokens\": 4096\n})\n\nresponse = agent.send_message(\"What is 25 * 4?\")\n```\n\n### Available Core Apps\n\n| Model | App Reference |\n|-------|---------------|\n| Claude Sonnet 4 | `infsh\u002Fclaude-sonnet-4@latest` |\n| Claude 3.5 Haiku | `infsh\u002Fclaude-haiku-35@latest` |\n| GPT-4o | `infsh\u002Fgpt-4o@latest` |\n| GPT-4o Mini | `infsh\u002Fgpt-4o-mini@latest` |\n\n## Tool Builder API\n\n### Parameter Types\n\n```python\nfrom inferencesh import (\n    string, number, integer, boolean,\n    enum_of, array, obj, optional\n)\n\nname = string(\"User's name\")\nage = integer(\"Age in years\")\nscore = number(\"Score 0-1\")\nactive = boolean(\"Is active\")\npriority = enum_of([\"low\", \"medium\", \"high\"], \"Priority\")\ntags = array(string(\"Tag\"), \"List of tags\")\naddress = obj({\n    \"street\": string(\"Street\"),\n    \"city\": string(\"City\"),\n    \"zip\": optional(string(\"ZIP\"))\n}, \"Address\")\n```\n\n### Client Tools (Run in Your Code)\n\n```python\ngreet = (\n    tool(\"greet\")\n    .display(\"Greet User\")\n    .describe(\"Greets a user by name\")\n    .param(\"name\", string(\"Name to greet\"))\n    .require_approval()\n    .build()\n)\n```\n\n### App Tools (Call AI Apps)\n\n```python\ngenerate = (\n    app_tool(\"generate_image\", \"infsh\u002Fflux-1-dev@latest\")\n    .describe(\"Generate an image from text\")\n    .param(\"prompt\", string(\"Image description\"))\n    .setup({\"model\": \"schnell\"})\n    .input({\"steps\": 20})\n    .require_approval()\n    .build()\n)\n```\n\n### Agent Tools (Delegate to Sub-agents)\n\n```python\nfrom inferencesh import agent_tool\n\nresearcher = (\n    agent_tool(\"research\", \"my-org\u002Fresearcher@v1\")\n    .describe(\"Research a topic\")\n    .param(\"topic\", string(\"Topic to research\"))\n    .build()\n)\n```\n\n### Webhook Tools (Call External APIs)\n\n```python\nfrom inferencesh import webhook_tool\n\nnotify = (\n    webhook_tool(\"slack\", \"https:\u002F\u002Fhooks.slack.com\u002F...\")\n    .describe(\"Send Slack notification\")\n    .secret(\"SLACK_SECRET\")\n    .param(\"channel\", string(\"Channel\"))\n    .param(\"message\", string(\"Message\"))\n    .build()\n)\n```\n\n### Internal Tools (Built-in Capabilities)\n\n```python\nfrom inferencesh import internal_tools\n\nconfig = (\n    internal_tools()\n    .plan()\n    .memory()\n    .web_search(True)\n    .code_execution(True)\n    .image_generation({\n        \"enabled\": True,\n        \"app_ref\": \"infsh\u002Fflux@latest\"\n    })\n    .build()\n)\n\nagent = client.agent({\n    \"core_app\": {\"ref\": \"infsh\u002Fclaude-sonnet-4@latest\"},\n    \"internal_tools\": config\n})\n```\n\n## Streaming Agent Responses\n\n```python\ndef handle_message(msg):\n    if msg.get(\"content\"):\n        print(msg[\"content\"], end=\"\", flush=True)\n\ndef handle_tool(call):\n    print(f\"\\n[Tool: {call.name}]\")\n    result = execute_tool(call.name, call.args)\n    agent.submit_tool_result(call.id, result)\n\nresponse = agent.send_message(\n    \"Explain quantum computing\",\n    on_message=handle_message,\n    on_tool_call=handle_tool\n)\n```\n\n## File Attachments\n\n```python\n# From file path\nwith open(\"image.png\", \"rb\") as f:\n    response = agent.send_message(\n        \"What's in this image?\",\n        files=[f.read()]\n    )\n\n# From base64\nresponse = agent.send_message(\n    \"Analyze this\",\n    files=[\"data:image\u002Fpng;base64,iVBORw0KGgo...\"]\n)\n```\n\n## Skills (Reusable Context)\n\n```python\nagent = client.agent({\n    \"core_app\": {\"ref\": \"infsh\u002Fclaude-sonnet-4@latest\"},\n    \"skills\": [\n        {\n            \"name\": \"code-review\",\n            \"description\": \"Code review guidelines\",\n            \"content\": \"# Code Review\\n\\n1. Check security\\n2. Check performance...\"\n        },\n        {\n            \"name\": \"api-docs\",\n            \"description\": \"API documentation\",\n            \"url\": \"https:\u002F\u002Fexample.com\u002Fskills\u002Fapi-docs.md\"\n        }\n    ]\n})\n```\n\n## Async Support\n\n```python\nfrom inferencesh import async_inference\nimport asyncio\n\nasync def main():\n    client = async_inference(api_key=\"inf_...\")\n\n    # Async app execution\n    result = await client.run({\n        \"app\": \"infsh\u002Fflux-1-dev\",\n        \"input\": {\"prompt\": \"A galaxy\"}\n    })\n\n    # Async agent\n    agent = client.agent(\"my-org\u002Fassistant@latest\")\n    response = await agent.send_message(\"Hello!\")\n\n    # Async streaming\n    async for msg in agent.stream_messages():\n        print(msg)\n\nasyncio.run(main())\n```\n\n## Error Handling\n\n```python\nfrom inferencesh import RequirementsNotMetException\n\ntry:\n    result = client.run({\"app\": \"my-app\", \"input\": {...}})\nexcept RequirementsNotMetException as e:\n    print(f\"Missing requirements:\")\n    for err in e.errors:\n        print(f\"  - {err['type']}: {err['key']}\")\nexcept RuntimeError as e:\n    print(f\"Error: {e}\")\n```\n\n## Human Approval Workflows\n\n```python\ndef handle_tool(call):\n    if call.requires_approval:\n        # Show to user, get confirmation\n        approved = prompt_user(f\"Allow {call.name}?\")\n        if approved:\n            result = execute_tool(call.name, call.args)\n            agent.submit_tool_result(call.id, result)\n        else:\n            agent.submit_tool_result(call.id, {\"error\": \"Denied by user\"})\n\nresponse = agent.send_message(\n    \"Delete all temp files\",\n    on_tool_call=handle_tool\n)\n```\n\n## Reference Files\n\n- [Agent Patterns](references\u002Fagent-patterns.md) - Multi-agent, RAG, human-in-the-loop patterns\n- [Tool Builder](references\u002Ftool-builder.md) - Complete tool builder API reference\n- [Streaming](references\u002Fstreaming.md) - Real-time progress updates and SSE handling\n- [File Handling](references\u002Ffiles.md) - Upload, download, and manage files\n- [Sessions](references\u002Fsessions.md) - Stateful execution with warm workers\n- [Async Patterns](references\u002Fasync-patterns.md) - Parallel processing and async\u002Fawait\n\n## Related Skills\n\n```bash\n# JavaScript SDK\nnpx skills add inference-sh\u002Fskills@javascript-sdk\n\n# Full platform skill (all 150+ apps via CLI)\nnpx skills add inference-sh\u002Fskills@infsh-cli\n\n# LLM models\nnpx skills add inference-sh\u002Fskills@llm-models\n\n# Image generation\nnpx skills add inference-sh\u002Fskills@ai-image-generation\n```\n\n## Documentation\n\n- [Python SDK Reference](https:\u002F\u002Finference.sh\u002Fdocs\u002Fapi\u002Fsdk-python) - Full API documentation\n- [Agent SDK Overview](https:\u002F\u002Finference.sh\u002Fdocs\u002Fapi\u002Fagent-sdk) - Building agents\n- [Tool Builder Reference](https:\u002F\u002Finference.sh\u002Fdocs\u002Fapi\u002Finfsh-cli) - Creating tools\n- [Authentication](https:\u002F\u002Finference.sh\u002Fdocs\u002Fapi\u002Fauthentication) - API key setup\n- [Streaming](https:\u002F\u002Finference.sh\u002Fdocs\u002Fapi\u002Fsdk\u002Fstreaming) - Real-time updates\n- [File Uploads](https:\u002F\u002Finference.sh\u002Fdocs\u002Fapi\u002Fsdk\u002Ffiles) - File handling\n\n","# Python SDK\n\nBuild AI applications with the [inference.sh](https:\u002F\u002Finference.sh) Python SDK.\n\n![Python SDK](https:\u002F\u002Fcloud.inference.sh\u002Fapp\u002Ffiles\u002Fu\u002F4mg21r6ta37mpaz6ktzwtt8krr\u002F01kgvftjwhby36trvaj66bwzcf.jpeg)\n\n## Quick Start\n\n```bash\npip install inferencesh\n```\n\n```python\nfrom inferencesh import inference\n\nclient = inference(api_key=\"inf_your_key\")\n\n# Run an AI app\nresult = client.run({\n    \"app\": \"infsh\u002Fflux-1-dev\",\n    \"input\": {\"prompt\": \"A sunset over mountains\"}\n})\nprint(result[\"output\"])\n```\n\n## Installation\n\n```bash\n# Standard installation\npip install inferencesh\n\n# With async support\npip install inferencesh[async]\n```\n\n**Requirements:** Python 3.8+\n\n## Authentication\n\n```python\nimport os\nfrom inferencesh import inference\n\n# Direct API key\nclient = inference(api_key=\"inf_your_key\")\n\n# From environment variable (recommended)\nclient = inference(api_key=os.environ[\"INFERENCE_API_KEY\"])\n```\n\nGet your API key: Settings → API Keys → Create API Key\n\n## Running Apps\n\n### Basic Execution\n\n```python\nresult = client.run({\n    \"app\": \"infsh\u002Fflux-1-dev\",\n    \"input\": {\"prompt\": \"A cat astronaut\"}\n})\n\nprint(result[\"status\"])  # \"completed\"\nprint(result[\"output\"])  # Output data\n```\n\n### Fire and Forget\n\n```python\ntask = client.run({\n    \"app\": \"google\u002Fveo-3-1-fast\",\n    \"input\": {\"prompt\": \"Drone flying over mountains\"}\n}, wait=False)\n\nprint(f\"Task ID: {task['id']}\")\n# Check later with client.get_task(task['id'])\n```\n\n### Streaming Progress\n\n```python\nfor update in client.run({\n    \"app\": \"google\u002Fveo-3-1-fast\",\n    \"input\": {\"prompt\": \"Ocean waves at sunset\"}\n}, stream=True):\n    print(f\"Status: {update['status']}\")\n    if update.get(\"logs\"):\n        print(update[\"logs\"][-1])\n```\n\n### Run Parameters\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `app` | string | App ID (namespace\u002Fname@version) |\n| `input` | dict | Input matching app schema |\n| `setup` | dict | Hidden setup configuration |\n| `infra` | string | 'cloud' or 'private' |\n| `session` | string | Session ID for stateful execution |\n| `session_timeout` | int | Idle timeout (1-3600 seconds) |\n\n## File Handling\n\n### Automatic Upload\n\n```python\nresult = client.run({\n    \"app\": \"image-processor\",\n    \"input\": {\n        \"image\": \"\u002Fpath\u002Fto\u002Fimage.png\"  # Auto-uploaded\n    }\n})\n```\n\n### Manual Upload\n\n```python\nfrom inferencesh import UploadFileOptions\n\n# Basic upload\nfile = client.upload_file(\"\u002Fpath\u002Fto\u002Fimage.png\")\n\n# With options\nfile = client.upload_file(\n    \"\u002Fpath\u002Fto\u002Fimage.png\",\n    UploadFileOptions(\n        filename=\"custom_name.png\",\n        content_type=\"image\u002Fpng\",\n        public=True\n    )\n)\n\nresult = client.run({\n    \"app\": \"image-processor\",\n    \"input\": {\"image\": file[\"uri\"]}\n})\n```\n\n## Sessions (Stateful Execution)\n\nKeep workers warm across multiple calls:\n\n```python\n# Start new session\nresult = client.run({\n    \"app\": \"my-app\",\n    \"input\": {\"action\": \"init\"},\n    \"session\": \"new\",\n    \"session_timeout\": 300  # 5 minutes\n})\nsession_id = result[\"session_id\"]\n\n# Continue in same session\nresult = client.run({\n    \"app\": \"my-app\",\n    \"input\": {\"action\": \"process\"},\n    \"session\": session_id\n})\n```\n\n## Agent SDK\n\n### Template Agents\n\nUse pre-built agents from your workspace:\n\n```python\nagent = client.agent(\"my-team\u002Fsupport-agent@latest\")\n\n# Send message\nresponse = agent.send_message(\"Hello!\")\nprint(response.text)\n\n# Multi-turn conversation\nresponse = agent.send_message(\"Tell me more\")\n\n# Reset conversation\nagent.reset()\n\n# Get chat history\nchat = agent.get_chat()\n```\n\n### Ad-hoc Agents\n\nCreate custom agents programmatically:\n\n```python\nfrom inferencesh import tool, string, number, app_tool\n\n# Define tools\ncalculator = (\n    tool(\"calculate\")\n    .describe(\"Perform a calculation\")\n    .param(\"expression\", string(\"Math expression\"))\n    .build()\n)\n\nimage_gen = (\n    app_tool(\"generate_image\", \"infsh\u002Fflux-1-dev@latest\")\n    .describe(\"Generate an image\")\n    .param(\"prompt\", string(\"Image description\"))\n    .build()\n)\n\n# Create agent\nagent = client.agent({\n    \"core_app\": {\"ref\": \"infsh\u002Fclaude-sonnet-4@latest\"},\n    \"system_prompt\": \"You are a helpful assistant.\",\n    \"tools\": [calculator, image_gen],\n    \"temperature\": 0.7,\n    \"max_tokens\": 4096\n})\n\nresponse = agent.send_message(\"What is 25 * 4?\")\n```\n\n### Available Core Apps\n\n| Model | App Reference |\n|-------|---------------|\n| Claude Sonnet 4 | `infsh\u002Fclaude-sonnet-4@latest` |\n| Claude 3.5 Haiku | `infsh\u002Fclaude-haiku-35@latest` |\n| GPT-4o | `infsh\u002Fgpt-4o@latest` |\n| GPT-4o Mini | `infsh\u002Fgpt-4o-mini@latest` |\n\n## Tool Builder API\n\n### Parameter Types\n\n```python\nfrom inferencesh import (\n    string, number, integer, boolean,\n    enum_of, array, obj, optional\n)\n\nname = string(\"User's name\")\nage = integer(\"Age in years\")\nscore = number(\"Score 0-1\")\nactive = boolean(\"Is active\")\npriority = enum_of([\"low\", \"medium\", \"high\"], \"Priority\")\ntags = array(string(\"Tag\"), \"List of tags\")\naddress = obj({\n    \"street\": string(\"Street\"),\n    \"city\": string(\"City\"),\n    \"zip\": optional(string(\"ZIP\"))\n}, \"Address\")\n```\n\n### Client Tools (Run in Your Code)\n\n```python\ngreet = (\n    tool(\"greet\")\n    .display(\"Greet User\")\n    .describe(\"Greets a user by name\")\n    .param(\"name\", string(\"Name to greet\"))\n    .require_approval()\n    .build()\n)\n```\n\n### App Tools (Call AI Apps)\n\n```python\ngenerate = (\n    app_tool(\"generate_image\", \"infsh\u002Fflux-1-dev@latest\")\n    .describe(\"Generate an image from text\")\n    .param(\"prompt\", string(\"Image description\"))\n    .setup({\"model\": \"schnell\"})\n    .input({\"steps\": 20})\n    .require_approval()\n    .build()\n)\n```\n\n### Agent Tools (Delegate to Sub-agents)\n\n```python\nfrom inferencesh import agent_tool\n\nresearcher = (\n    agent_tool(\"research\", \"my-org\u002Fresearcher@v1\")\n    .describe(\"Research a topic\")\n    .param(\"topic\", string(\"Topic to research\"))\n    .build()\n)\n```\n\n### Webhook Tools (Call External APIs)\n\n```python\nfrom inferencesh import webhook_tool\n\nnotify = (\n    webhook_tool(\"slack\", \"https:\u002F\u002Fhooks.slack.com\u002F...\")\n    .describe(\"Send Slack notification\")\n    .secret(\"SLACK_SECRET\")\n    .param(\"channel\", string(\"Channel\"))\n    .param(\"message\", string(\"Message\"))\n    .build()\n)\n```\n\n### Internal Tools (Built-in Capabilities)\n\n```python\nfrom inferencesh import internal_tools\n\nconfig = (\n    internal_tools()\n    .plan()\n    .memory()\n    .web_search(True)\n    .code_execution(True)\n    .image_generation({\n        \"enabled\": True,\n        \"app_ref\": \"infsh\u002Fflux@latest\"\n    })\n    .build()\n)\n\nagent = client.agent({\n    \"core_app\": {\"ref\": \"infsh\u002Fclaude-sonnet-4@latest\"},\n    \"internal_tools\": config\n})\n```\n\n## Streaming Agent Responses\n\n```python\ndef handle_message(msg):\n    if msg.get(\"content\"):\n        print(msg[\"content\"], end=\"\", flush=True)\n\ndef handle_tool(call):\n    print(f\"\\n[Tool: {call.name}]\")\n    result = execute_tool(call.name, call.args)\n    agent.submit_tool_result(call.id, result)\n\nresponse = agent.send_message(\n    \"Explain quantum computing\",\n    on_message=handle_message,\n    on_tool_call=handle_tool\n)\n```\n\n## File Attachments\n\n```python\n# From file path\nwith open(\"image.png\", \"rb\") as f:\n    response = agent.send_message(\n        \"What's in this image?\",\n        files=[f.read()]\n    )\n\n# From base64\nresponse = agent.send_message(\n    \"Analyze this\",\n    files=[\"data:image\u002Fpng;base64,iVBORw0KGgo...\"]\n)\n```\n\n## Skills (Reusable Context)\n\n```python\nagent = client.agent({\n    \"core_app\": {\"ref\": \"infsh\u002Fclaude-sonnet-4@latest\"},\n    \"skills\": [\n        {\n            \"name\": \"code-review\",\n            \"description\": \"Code review guidelines\",\n            \"content\": \"# Code Review\\n\\n1. Check security\\n2. Check performance...\"\n        },\n        {\n            \"name\": \"api-docs\",\n            \"description\": \"API documentation\",\n            \"url\": \"https:\u002F\u002Fexample.com\u002Fskills\u002Fapi-docs.md\"\n        }\n    ]\n})\n```\n\n## Async Support\n\n```python\nfrom inferencesh import async_inference\nimport asyncio\n\nasync def main():\n    client = async_inference(api_key=\"inf_...\")\n\n    # Async app execution\n    result = await client.run({\n        \"app\": \"infsh\u002Fflux-1-dev\",\n        \"input\": {\"prompt\": \"A galaxy\"}\n    })\n\n    # Async agent\n    agent = client.agent(\"my-org\u002Fassistant@latest\")\n    response = await agent.send_message(\"Hello!\")\n\n    # Async streaming\n    async for msg in agent.stream_messages():\n        print(msg)\n\nasyncio.run(main())\n```\n\n## Error Handling\n\n```python\nfrom inferencesh import RequirementsNotMetException\n\ntry:\n    result = client.run({\"app\": \"my-app\", \"input\": {...}})\nexcept RequirementsNotMetException as e:\n    print(f\"Missing requirements:\")\n    for err in e.errors:\n        print(f\"  - {err['type']}: {err['key']}\")\nexcept RuntimeError as e:\n    print(f\"Error: {e}\")\n```\n\n## Human Approval Workflows\n\n```python\ndef handle_tool(call):\n    if call.requires_approval:\n        # Show to user, get confirmation\n        approved = prompt_user(f\"Allow {call.name}?\")\n        if approved:\n            result = execute_tool(call.name, call.args)\n            agent.submit_tool_result(call.id, result)\n        else:\n            agent.submit_tool_result(call.id, {\"error\": \"Denied by user\"})\n\nresponse = agent.send_message(\n    \"Delete all temp files\",\n    on_tool_call=handle_tool\n)\n```\n\n## Reference Files\n\n- [Agent Patterns](references\u002Fagent-patterns.md) - Multi-agent, RAG, human-in-the-loop patterns\n- [Tool Builder](references\u002Ftool-builder.md) - Complete tool builder API reference\n- [Streaming](references\u002Fstreaming.md) - Real-time progress updates and SSE handling\n- [File Handling](references\u002Ffiles.md) - Upload, download, and manage files\n- [Sessions](references\u002Fsessions.md) - Stateful execution with warm workers\n- [Async Patterns](references\u002Fasync-patterns.md) - Parallel processing and async\u002Fawait\n\n## Related Skills\n\n```bash\n# JavaScript SDK\nnpx skills add inference-sh\u002Fskills@javascript-sdk\n\n# Full platform skill (all 150+ apps via CLI)\nnpx skills add inference-sh\u002Fskills@infsh-cli\n\n# LLM models\nnpx skills add inference-sh\u002Fskills@llm-models\n\n# Image generation\nnpx skills add inference-sh\u002Fskills@ai-image-generation\n```\n\n## Documentation\n\n- [Python SDK Reference](https:\u002F\u002Finference.sh\u002Fdocs\u002Fapi\u002Fsdk-python) - Full API documentation\n- [Agent SDK Overview](https:\u002F\u002Finference.sh\u002Fdocs\u002Fapi\u002Fagent-sdk) - Building agents\n- [Tool Builder Reference](https:\u002F\u002Finference.sh\u002Fdocs\u002Fapi\u002Finfsh-cli) - Creating tools\n- [Authentication](https:\u002F\u002Finference.sh\u002Fdocs\u002Fapi\u002Fauthentication) - API key setup\n- [Streaming](https:\u002F\u002Finference.sh\u002Fdocs\u002Fapi\u002Fsdk\u002Fstreaming) - Real-time updates\n- [File Uploads](https:\u002F\u002Finference.sh\u002Fdocs\u002Fapi\u002Fsdk\u002Ffiles) - File handling\n\n",{"name":5,"description":7,"allowed-tools":44},"Bash(pip install inferencesh), Bash(python *)","main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Faiskillstore\u002Fmarketplace\u002Finferen-sh\u002Fpython-sdk",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill python-sdk",{"tool":60,"command":61},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill python-sdk",{"tool":63,"command":64},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill python-sdk","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Finferen-sh\u002Fpython-sdk\u002FSKILL.md",true,[68,74,78,82,86,90,94],{"path":69,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Fagent-patterns.md","REFERENCE","参考文档",7047,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Finferen-sh\u002Fpython-sdk\u002Freferences\u002Fagent-patterns.md",{"path":75,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fasync-patterns.md",8747,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Finferen-sh\u002Fpython-sdk\u002Freferences\u002Fasync-patterns.md",{"path":79,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":80,"sourceHtmlUrl":81},"references\u002Ffiles.md",6232,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Finferen-sh\u002Fpython-sdk\u002Freferences\u002Ffiles.md",{"path":83,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":84,"sourceHtmlUrl":85},"references\u002Fsessions.md",7035,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Finferen-sh\u002Fpython-sdk\u002Freferences\u002Fsessions.md",{"path":87,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":88,"sourceHtmlUrl":89},"references\u002Fstreaming.md",5926,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Finferen-sh\u002Fpython-sdk\u002Freferences\u002Fstreaming.md",{"path":91,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Ftool-builder.md",8766,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Finferen-sh\u002Fpython-sdk\u002Freferences\u002Ftool-builder.md",{"path":95,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":96,"sourceHtmlUrl":97},"skill-report.json",12295,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Finferen-sh\u002Fpython-sdk\u002Fskill-report.json",[99,108,117,124,130,136],{"skillNo":100,"name":101,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":39},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[105,106,107],"model","model hierarchy","model hierarchy skill",{"skillNo":109,"name":110,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":39},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[114,115,116],"MCP","zoom","zoom mcp",{"skillNo":118,"name":119,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":39},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[19,123,22,115],"zoom apps sdk",{"skillNo":125,"name":126,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":39},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[126],{"skillNo":131,"name":132,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":135,"publishedAt":39},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[132],{"skillNo":137,"name":138,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":39},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[138]]