-
Hi! I am implementing a group chat consisting a team of agents and a manager agent using autogen_core(0.4+). I want to implement the save and load state methods that is available in the agentchat, however not sure how to do.. I understand that the state is basically the model_context but looking at the Agentchat.AssistantAgent source code I see that they have implemented more complex logic than simply dumping the model_context, also not sure what the model_contex.dump_model() also does? Thank You! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There are two different serializations:
In Core API, this means your factory method is responsible for creating the instance, and the save_state and load_state methods are responsible for managing your instance's state. For model context, built-in ones all have save_state and load_state methods: https://microsoft.github.io/autogen/stable/reference/python/autogen_core.model_context.html#autogen_core.model_context.ChatCompletionContext.save_state. I think you can just use that. |
Beta Was this translation helpful? Give feedback.
Hi Eric!
Thank you for your response.
I went through the source code, context docs and also the doc you had referenced. For the benefit of others I am writing my understanding of states, context and how to implement them, pls correct me if wrong.
Concept