部署 AutoGenStudio 创建的 Agent Apps
1. Agent Apps 部署文件导出
You can reuse the declarative specifications of agent teams created in AutoGen studio in your python application by using the TeamManager class. In TeamBuilder, select a team configuration and click download.
我们将本地大模型的 Team 配置导出为 JSON 文件:

导出后的文件 team-config.json 部分内容如下:

Build Your Team in Python, Export as JSON:

2. Windows 环境测试
2.1 PyCharm 配置使用虚拟环境
新建项目或打开旧的项目进行配置。
2.2 Deploy 代码运行
AutoGen Studio 提供了 Deploy 的示例代码。在 PyCharm 中创建 Python 文件并复制以下代码:
import asyncio
from autogenstudio.teammanager import TeamManager
async def test():
try:
# Initialize the TeamManager
manager = TeamManager()
# Run a task with a specific team configuration
result = await manager.run(
task="你是谁开发出来的模型?",
team_config="team-config.json"
)
print(result)
for i, message in (result.task_result.messages):
content = message.content.strip()
(content)
Exception e:
(e)
__name__ == :
asyncio.run(test())



