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 TerminationCondition #4983

Open
Tracked by #4439
victordibia opened this issue Jan 10, 2025 · 0 comments · May be fixed by #4984
Open
Tracked by #4439

Support declarative configs for TerminationCondition #4983

victordibia opened this issue Jan 10, 2025 · 0 comments · May be fixed by #4984
Assignees
Labels
proj-agentchat proj-studio Related to AutoGen Studio.
Milestone

Comments

@victordibia
Copy link
Collaborator

victordibia commented Jan 10, 2025

Step 1 in making components in agentchat natively declarative.

from autogen_agentchat.conditions import StopMessageTermination, MaxMessageTermination 

max_term = MaxMessageTermination(5)
stop_term = StopMessageTermination() 

or_term = max_term | stop_term
print(or_term.dump_component() )
 
print(max_term.dump_component())

Results

ComponentModel(provider='autogen_agentchat.base._termination._OrTerminationCondition', 
component_type='termination', version=1, component_version=1, description=None, 
config={'conditions': [{'provider': 'autogen_agentchat.conditions.MaxMessageTermination', '
component_type': 'termination', 'version': 1, 'component_version': 1, 
'config': {'max_messages': 5}}, {'provider': 'autogen_agentchat.conditions.StopMessageTermination', 
'component_type': 'termination', 'version': 1, 'component_version': 1, 'config': {}}]})
ComponentModel(provider='autogen_agentchat.conditions.MaxMessageTermination', 
component_type='termination', version=1, component_version=1, 
description=None, config={'max_messages': 5})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proj-agentchat proj-studio Related to AutoGen Studio.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant