PPIO Agent Runtime SDK - 轻量级 AI 智能体运行时框架
Project description
PPIO Agent Runtime SDK
PPIO Agent Runtime SDK 是一个轻量级的 AI 智能体运行时框架,旨在为开发者提供简单易用的智能体部署解决方案。
核心特性
- 极简改造:最小化代码修改,只需添加装饰器即可
- 零配置启动:默认配置即可运行,无需复杂配置
- 容器化就绪:专为 Docker 容器化部署设计
- 流式响应:支持同步和异步流式输出
- 健康监控:内置健康检查机制
快速开始
安装
pip install ppio-agent-runtime
基础使用
from ppio_agent_runtime import PPIOAgentRuntimeApp
app = PPIOAgentRuntimeApp()
@app.entrypoint
def my_agent(request: dict) -> str:
"""简单的智能体函数"""
query = request.get("query", "")
return f"处理查询: {query}"
if __name__ == "__main__":
app.run()
流式响应
from ppio_agent_runtime import PPIOAgentRuntimeApp
app = PPIOAgentRuntimeApp()
@app.entrypoint
def streaming_agent(request: dict):
"""流式响应智能体"""
query = request.get("query", "")
for i in range(5):
yield f"步骤 {i+1}: 处理 {query}"
if __name__ == "__main__":
app.run()
异步智能体
import asyncio
from ppio_agent_runtime import PPIOAgentRuntimeApp
app = PPIOAgentRuntimeApp()
@app.entrypoint
async def async_agent(request: dict) -> str:
"""异步智能体函数"""
query = request.get("query", "")
# 模拟异步处理
await asyncio.sleep(1)
return f"异步处理完成: {query}"
if __name__ == "__main__":
app.run()
部署
使用 PPIO CLI 工具部署你的智能体:
# 配置项目
ppio-agent configure
# 部署智能体
ppio-agent deploy
文档
许可证
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ppio_agent_runtime-0.1.0.tar.gz
(15.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ppio_agent_runtime-0.1.0.tar.gz.
File metadata
- Download URL: ppio_agent_runtime-0.1.0.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e042448b6e5a24aebb7ae31d0d1f694b1f7fa7d09ecd2b750c9fb5cc1bf2de84
|
|
| MD5 |
b5ef487b72be38b12f836862b4656f41
|
|
| BLAKE2b-256 |
5193fba7b0145ab592b8387609af06a2d2bc3775072117818e6084c68690d7ee
|
File details
Details for the file ppio_agent_runtime-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ppio_agent_runtime-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10cd3eeedae6a0c0b65e1fc93bb50bb818f18ed35367f9d56acc942d999c7ec3
|
|
| MD5 |
e9b29621623204e5ca588edb21982293
|
|
| BLAKE2b-256 |
17dbb7949df04d50b6a2226be66608f836cd35b8fb40b5b9ba25df1d7433aab3
|