Skip to content

v1 of AutoGen Studio on AgentChat #4097

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Nov 9, 2024
Merged

v1 of AutoGen Studio on AgentChat #4097

merged 29 commits into from
Nov 9, 2024

Conversation

victordibia
Copy link
Collaborator

@victordibia victordibia commented Nov 8, 2024

Why are these changes needed?

First step in platforming AutoGen Studio on the AgentChat api. Primary goal is to create a too that enables rapid prototyping and experiments.

This PR introduces a teammanager class that can take a declarative agent spect and return AgentChat runtime instances, streaming agent updates over a websocker and an updated backend api.

image

Declarative Specification and Team Manager

{
  "name": "weather_team",
  "component_type": "team",
  "participants": [
    {
      "name": "writing_agent",
      "component_type": "agent",
      "model_client": {
        "model": "gpt-4o-2024-08-06",
        "model_type": "OpenAIChatCompletionClient",
        "component_type": "model"
      },
      "tools": [
        {
          "name": "get_weather",
          "description": "Get the weather for a city",
          "content": "async def get_weather(city: str) -> str:\n    return f\"The weather in {city} is 73 degrees and Sunny.\"",
          "tool_type": "PythonFunction",
          "component_type": "tool"
        }
      ],
      "agent_type": "AssistantAgent"
    }
  ],
  "termination_condition": {
    "termination_type": "MaxMessageTermination",
    "max_messages": 5,
    "component_type": "termination"
  },
  "team_type": "RoundRobinGroupChat",
  "model_client": null
}

The team specification can be loaded as follows:

from autogenstudio.teammanager import TeamManager
import json 
 
wm = TeamManager()  
result = await wm.run(task="What is the weather in New York?", team_config= json.load(open("team.json")) ) 
print(result)

UI

Current updates to the UI include the ability to create a session, attach a team spec (as json) and run tasks.
Intermediate agent steps are streamed to the UI and can be stopped as the task proceeds.

image

Related issue number

Checks

@victordibia victordibia marked this pull request as ready for review November 9, 2024 20:22
@ekzhu
Copy link
Collaborator

ekzhu commented Nov 9, 2024

Looks like uv lock needs to be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment