Skip to content
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

Support declarative configs for BaseGroupChat (and derivatives) - RoundRobinGroupChat, SelectorGroupChat, MagenticOne etc #5064

Open
Tracked by #4439
victordibia opened this issue Jan 15, 2025 · 0 comments · May be fixed by #5071
Milestone

Comments

@victordibia
Copy link
Collaborator

victordibia commented Jan 15, 2025

Support a workflow where an AgentChat team configuration can be made declarative

# dump
assistant_agent = AssistantAgent(
    name="assistant_agent",
    model_client=OpenAIChatCompletionClient(
        model="gpt-4o-2024-08-06", 
    ),
    handoffs=["john_glover"]
)

term = MaxMessageTermination(2)
agent_team = RoundRobinGroupChat([assistant_agent], termination_condition=term)
agent_config = agent_team.dump_component()
{
  "provider": "autogen_agentchat.teams.RoundRobinGroupChat",
  "component_type": "team",
  "version": 1,
  "component_version": 1,
  "description": null,
  "config": {
    "participants": [
      {
        "provider": "autogen_agentchat.agents.AssistantAgent",
        "component_type": "agent",
        "version": 1,
        "component_version": 1,
        "config": {
          "name": "assistant_agent",
          "model_client": {
            "provider": "autogen_ext.models.openai.OpenAIChatCompletionClient",
            "component_type": "model",
            "version": 1,
            "component_version": 1,
            "config": { "model": "gpt-4o-2024-08-06" }
          },
          "handoffs": [
            {
              "target": "john_glover",
              "description": "Handoff to john_glover.",
              "name": "transfer_to_john_glover",
              "message": "Transferred to john_glover, adopting the role of john_glover immediately."
            }
          ],
          "model_context": {
            "provider": "autogen_core.model_context.UnboundedChatCompletionContext",
            "component_type": "chat_completion_context",
            "version": 1,
            "component_version": 1,
            "config": {}
          },
          "description": "An agent that provides assistance with ability to use tools.",
          "system_message": "You are a helpful AI assistant. Solve tasks using your tools. Reply with TERMINATE when the task has been completed.",
          "reflect_on_tool_use": false,
          "tool_call_summary_format": "{result}"
        }
      }
    ],
    "termination_condition": {
      "provider": "autogen_agentchat.conditions.MaxMessageTermination",
      "component_type": "termination",
      "version": 1,
      "component_version": 1,
      "config": { "max_messages": 2 }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant