将您的 Agno 团队公开为兼容 AG-UI 的应用
from agno.agent.agent import Agent
from agno.app.agui.app import AGUIApp
from agno.models.openai import OpenAIChat
from agno.team.team import Team
researcher = Agent(
name="researcher",
role="研究助理",
model=OpenAIChat(id="gpt-4o"),
instructions="你是一名研究助理。查找信息并提供详细分析。",
markdown=True,
)
writer = Agent(
name="writer",
role="内容撰写员",
model=OpenAIChat(id="gpt-4o"),
instructions="你是一名内容撰写员。根据研究创建结构良好的内容。",
markdown=True,
)
research_team = Team(
members=[researcher, writer],
name="research_team",
instructions="""
你是一个研究团队,可以帮助用户进行研究和内容创作。
首先,使用研究员收集信息,然后使用撰写员创建内容。
""",
show_tool_calls=True,
show_members_responses=True,
get_member_information_tool=True,
add_member_tools_to_system_message=True,
)
agui_app = AGUIApp(
team=research_team,
name="研究团队 AG-UI",
app_id="research_team_agui",
description="一个展示 AG-UI 协议集成的研究团队。",
)
app = agui_app.get_app()
if __name__ == "__main__":
agui_app.serve(app="research_team:app", port=8000, reload=True)
您可以在 AG-UI 应用 页面找到有关如何设置兼容 AG-UI 的前端以使用此功能的说明。