Agents、Workflows 和 Teams。
示例用法
创建一个 Agent,并使用Playground 来托管它:
- 确保你的 PostgreSQL 服务器正在运行并通过
db_url即可访问。 - 设置
OPENAI_API_KEY环境变量。 - Playground UI 将在
http://localhost:7777可用。API 文档(如果在设置中启用)通常在http://localhost:7777/docs。 - 通过 Agent Playground 使用 playground。
核心组件
Playground: 将 Agno agent、team 或 workflow 封装在 API 中。Playground.serve: 使用 Uvicorn 来托管 Playground FastAPI 应用。
Playground 类是创建 Agno Playground 应用的主要入口点。它允许你通过 Web 界面,借助 Agent Playground 或 Agent UI 轻松地暴露你的 agent、team 和 workflow。
Playground 类
初始化参数
至少提供
agents、teams 或 workflows 中的一个。
主要方法
端点
端点位于指定的prefix(默认为 /v1)和 playground 路由器的前缀(/playground)组合处。例如,状态端点通常是 /v1/playground/status。