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

Make FileSurfer support component config serialization #5607

Closed
balakreshnan opened this issue Feb 18, 2025 · 0 comments · Fixed by #5765
Closed

Make FileSurfer support component config serialization #5607

balakreshnan opened this issue Feb 18, 2025 · 0 comments · Fixed by #5765

Comments

@balakreshnan
Copy link
Collaborator

What happened?

MagenticOneGroupChat with

file_surfer = FileSurfer(
    name="file_surfer",
    model_client=model_client,
    description="Please scan the current folder ./data and preview the file contents.",
    #handoffs=["success_agent"],  # Handoff to the assistant agent after file selection
)

team = MagenticOneGroupChat([file_surfer], 
                            termination_condition=termination, 
                            max_turns=1,
                            model_client=model_client)

c:\Code\autogenstudio\autogenstudiocode.venv\Lib\site-packages\autogen_agentchat\teams_group_chat_magentic_one_magentic_one_group_chat.py:139: UserWarning: Internal module name used in provider string. This is not recommended and may cause issues in the future. Silence this warning by setting component_provider_override to this value.
participants = [participant.dump_component() for participant in self._participants]
Traceback (most recent call last):
File "C:\Code\autogenstudio\autogenstudiocode\magenticfile.py", line 313, in
serialized = team.dump_component().model_dump(mode='python')
~~~~~~~~~~~~~~~~~~~^^
File "c:\Code\autogenstudio\autogenstudiocode.venv\Lib\site-packages\autogen_core_component_config.py", line 150, in dump_component
obj_config = self._to_config().model_dump(exclude_none=True)
~~~~~~~~~~~~~~~^^
File "c:\Code\autogenstudio\autogenstudiocode.venv\Lib\site-packages\autogen_agentchat\teams_group_chat_magentic_one_magentic_one_group_chat.py", line 139, in _to_config
participants = [participant.dump_component() for participant in self._participants]
~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "c:\Code\autogenstudio\autogenstudiocode.venv\Lib\site-packages\autogen_core_component_config.py", line 150, in dump_component
obj_config = self._to_config().model_dump(exclude_none=True)
~~~~~~~~~~~~~~~^^
File "c:\Code\autogenstudio\autogenstudiocode.venv\Lib\site-packages\autogen_core_component_config.py", line 114, in _to_config
raise NotImplementedError("This component does not support dumping to config")
NotImplementedError: This component does not support dumping to config
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.13_3.13.752.0_x64__qbz5n2kfra8p0\Lib\asyncio\proactor_events.py:116: ResourceWarning: unclosed transport <_ProactorSocketTransport fd=868 read=<_OverlappedFuture cancelled>>

What did you expect to happen?

https://github.com/balakreshnan/Samples2025/blob/main/autogen/autogenmagenticfilesurfer.md

How can we reproduce it (as minimally and precisely as possible)?

https://github.com/balakreshnan/Samples2025/blob/main/autogen/autogenmagenticfilesurfer.md

AutoGen version

0.4.7

Which package was this bug in

Core

Model used

No response

Python version

3.13

Operating system

No response

Any additional info you think would be helpful for fixing this bug

No response

@victordibia victordibia changed the title Unable to dump MagenticOneGroupChat with FileSurfer into json. Make MagenticOne and its agents (FileSurfer, CoderAgent etc) Serializable/ Declarative Feb 18, 2025
@victordibia victordibia self-assigned this Feb 18, 2025
@jackgerrits jackgerrits changed the title Make MagenticOne and its agents (FileSurfer, CoderAgent etc) Serializable/ Declarative Make FileSurfer support component config serialization Feb 20, 2025
@jackgerrits jackgerrits added this to the 0.4.x-python milestone Feb 25, 2025
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.

3 participants