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 BaseChatAgents (and derivatives) - UserProxy, AssistantAgent, WebSurferAgent #5032

Open
Tracked by #4439
victordibia opened this issue Jan 13, 2025 · 0 comments
Assignees

Comments

@victordibia
Copy link
Collaborator

victordibia commented Jan 13, 2025

Support a workflow where an Agent's configuration can be made declarative

# dump
agent = AssistantAgent(
    name="assistant",
    model_client=model_client,
    handoffs=["flights_refunder", "user"],
    tools=[web_search],
    system_message="Use tools to solve tasks.",
)
agent_config = agent.dump_component() 
{'name': 'assistant',
 'model_client': {'provider': 'autogen_ext.models.openai.OpenAIChatCompletionClient',
  'component_type': 'model',
  'version': 1,
  'component_version': 1,
  'config': {'model': 'gpt-4o'}},
 'tools': [],
 'handoffs': [{'target': 'flights_refunder',
   'description': 'Handoff to flights_refunder.',
   'name': 'transfer_to_flights_refunder',
   'message': 'Transferred to flights_refunder, adopting the role of flights_refunder immediately.'},
  {'target': 'user',
   'description': 'Handoff to user.',
   'name': 'transfer_to_user',
   'message': 'Transferred to user, adopting the role of user 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': 'Use tools to solve tasks.',
 'reflect_on_tool_use': False,
 'tool_call_summary_format': '{result}'}
# load 
reloaded_agent = AssistantAgent.load_component(agent_config)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant