Skip to main content
Playground App 用于通过具有多个端点的 FastAPI 服务器来提供 Agent、Team 和 Workflow,以管理和交互 Agno Playground 上的 AgentsWorkflowsTeams

示例用法

创建一个 Agent,并使用 Playground 来托管它:
运行方法:
  1. 确保你的 PostgreSQL 服务器正在运行并通过 db_url 即可访问。
  2. 设置 OPENAI_API_KEY 环境变量。
  3. Playground UI 将在 http://localhost:7777 可用。API 文档(如果在设置中启用)通常在 http://localhost:7777/docs
  4. 通过 Agent Playground 使用 playground。

核心组件

  • Playground: 将 Agno agent、team 或 workflow 封装在 API 中。
  • Playground.serve: 使用 Uvicorn 来托管 Playground FastAPI 应用。
Playground 类是创建 Agno Playground 应用的主要入口点。它允许你通过 Web 界面,借助 Agent PlaygroundAgent UI 轻松地暴露你的 agent、team 和 workflow。

Playground

初始化参数

至少提供 agentsteamsworkflows 中的一个。

主要方法

端点

端点位于指定的 prefix(默认为 /v1)和 playground 路由器的前缀(/playground)组合处。例如,状态端点通常是 /v1/playground/status

参数