Skip to content

Teams with agents that contain duplicated produced_message_types result in an ValueError exception #6353

@jorge-wonolo

Description

@jorge-wonolo

What happened?

Describe the bug
On 0.53.0 output_content_type for agents is automatically registered into the team Code Reference. When a team is comprised of agents that share the same output_content_type then a ValueError is raised.

To Reproduce
Add into a team 2 agents with the same Pydantic model as output_content_type.

ValueError: Message type <class 'autogen_agentchat.messages.StructuredMessage[<TestModel>]'> is already registered.

Expected behavior
Only register structured messages that have not been registered previously.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
I have added #6354 for your consideration

Which packages was the bug in?

Python AgentChat (autogen-agentchat>=0.4.0)

AutoGen library version.

Python 0.5.3

Other library version.

No response

Model used

gpt-4o

Model provider

OpenAI

Other model provider

No response

Python version

3.11

.NET version

None

Operating system

MacOS

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions