[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77VKQV1JD0FXTHSNJ32C91Q":3,"skill-same:01M77VKQV1JD0FXTHSNJ32C91Q":72},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M77VKQV1JD0FXTHSNJ32C91Q","python-sdk",null,"Python SDK for inference.sh - run AI apps, build agents, and integrate with all 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","Reihantt6\u002Fsns-myagent","Reihantt6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F219822095?v=4","01M77KK94PV8B7C2D9XWXNS8DJ","Mohamad Reihan tegar prasetya","01M77KK958QFMTHYXGXFV7KZ79",2,"MIT","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fpython-sdk\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\ndescription: \"Python SDK for inference.sh - run AI apps, build agents, and integrate with all 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\"\n---\n> **Install the belt CLI skill:** `npx skills add belt-sh\u002Fcli`\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 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","> **Install the belt CLI skill:** `npx skills add belt-sh\u002Fcli`\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 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",{"description":7},"main","58843b159d7a4050d6b785a98b908cce505c0b92","agent\u002Fskills\u002Fpython-sdk",0,"https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent","https:\u002F\u002Fgithub.com\u002FReihantt6","reihsns.web.id","2026-08-19 20:08:18",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add Reihantt6\u002Fsns-myagent --skill python-sdk",{"tool":38,"command":39},"bunx","bunx skills add Reihantt6\u002Fsns-myagent --skill python-sdk",{"tool":41,"command":42},"pnpm","pnpm dlx skills add Reihantt6\u002Fsns-myagent --skill python-sdk","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fpython-sdk\u002FSKILL.md",true,[46,52,56,60,64,68],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Fagent-patterns.md","REFERENCE","参考文档",7047,"https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fpython-sdk\u002Freferences\u002Fagent-patterns.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Fasync-patterns.md",8747,"https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fpython-sdk\u002Freferences\u002Fasync-patterns.md",{"path":57,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Ffiles.md",6232,"https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fpython-sdk\u002Freferences\u002Ffiles.md",{"path":61,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fsessions.md",7035,"https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fpython-sdk\u002Freferences\u002Fsessions.md",{"path":65,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002Fstreaming.md",5926,"https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fpython-sdk\u002Freferences\u002Fstreaming.md",{"path":69,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Ftool-builder.md",8766,"https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fpython-sdk\u002Freferences\u002Ftool-builder.md",[73,80,87,94,101,108],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M77XDCYZ407XYMF2T4P6F7VT","youtube-transcript","Extract transcripts from YouTube videos. Use when the user asks for a transcript, subtitles, or captions of a YouTube video and provides a YouTube URL (youtube.com\u002Fwatch?v=, youtu.be\u002F, or similar). Supports output with or without timestamps.","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fyoutube-transcript\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M77XD7PBC98J6MXGJJ2TJ8DX","youtube-thumbnail-design","YouTube thumbnail design with specific dimensions, contrast rules, and mobile preview optimization. Covers safe zones, text placement, face expression psychology, and A\u002FB testing. Use for: YouTube thumbnails, video cover images, click-through optimization. Triggers: youtube thumbnail, thumbnail design, video thumbnail, click through rate, ctr optimization, youtube cover, video cover image, thumbnail maker, thumbnail tips, youtube design, video preview image","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fyoutube-thumbnail-design\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M77XD2541C8HXJ6RHYZP4NGJ","youtube-short-maker","Make YouTube Shorts that hold attention with Pexo — vertical 9:16, fast-paced, hook in the first 3 seconds. Describe your topic and Pexo writes the script, generates the shots, picks the models, and assembles a finished Short with music and captions. Use for YouTube Shorts: \"youtube short\", \"make a youtube short\", \"shorts video\", \"short-form video\". NOT for long-form or landscape video.","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fyoutube-short-maker\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M77XCXKVSYK7KTZ3PQBVVGFD","xcode-project-setup","Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fxcode-project-setup\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":19},"01M77XCR1DV8ZQK2NHWKVY4EWX","x402","Set up Browser Use Cloud payments with x402 — pay per request from a crypto wallet (USDC on Base mainnet), no signup or API key. Two setups it works out up front — \"just use it\" (set up a wallet so you or Claude Code can run cloud browser tasks paid from the wallet — Claude writes and runs throwaway scripts, nothing touches your codebase) or \"build it in\" (install the SDK and write the key + code into your project). Walks through wallet setup, funding, .env, and a ~$1 test run. Use when the user asks about x402, pay-per-use, USDC payments, or wants Browser Use Cloud without an API key. For the free-tier signup (reverse-CAPTCHA → API key), use `browser-use cloud signup` or the `cloud` skill instead.","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fx402\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":19},"01M77XCMD3R3ZBZQQSW6E0793B","x-twitter-scraper","Build GitHub Copilot workflows with Xquik X API SDKs, REST endpoints, hosted Apify Actor runs, MCP tools, TweetClaw OpenClaw plugin installs, signed webhooks, tweet search, user lookup, follower exports, media actions, and agent automation.","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fx-twitter-scraper\u002FSKILL.md",[],[]]