SuperAPI AI 工具集

python-sdk

编程与开发

查看项目

更新于 10-15 22:37

技能介绍

用途:inference.sh 官方 Python SDK(包名 inferencesh),用于在 Python 中运行 AI 应用、构建智能体并接入 250+ 模型。安装:pip install inferencesh(标准安装);异步支持 pip install inferencesh[async];要求 Python 3.8+。认证:创建 client 时传入 api_key,或用环境变量 INFERENCE_API_KEY;API Key 在平台 Settings → API Keys 创建。主要能力:client.run 运行应用,参数含 app、input、setup、infra(cloud/private)、session、session_timeout,可 wait=False 异步提交、stream=True 流式接收进度。文件处理支持自动上传路径和手动 upload_file(可用 UploadFileOptions 设置文件名、类型、是否公开)。Sessions 通过 session="new" 与 session_id 复用热 worker。Agent SDK 支持模板智能体(client.agent("my-team/support-agent@latest"))和 ad-hoc 智能体,可定义 system_prompt、tools、temperature、max_tokens,核心应用如 infsh/claude-sonnet-4、gpt-4o 等。Tool Builder 提供 string、number、integer、boolean、enum_of、array、obj、optional 参数类型,以及 client tool、app tool、agent tool、webhook tool、internal tools(plan、memory、web_search、code_execution、image_generation)。还支持流式回调、文件附件、skills 复用上下文、async_inference 异步接口、RequirementsNotMetException 错误处理与人工审批工作流。限制与细节:文档未给出各应用的定价或平台可用范围,相关费用、配额与具体模型支持情况暂未提供;使用前需自行确认 API Key 权限与应用输入 schema。