agentscope-java icon indicating copy to clipboard operation
agentscope-java copied to clipboard

Support dynamic model switching during active ReActAgent conversation

Open HsiaoBob opened this issue 4 months ago • 1 comments

Currently, the ReActAgent is built using the Builder pattern, and the underlying ChatModel appears to be immutable after initialization. In my use case, I need to dynamically switch the underlying LLM model during an active multi-turn conversation. I have searched through the framework's source code but couldn't find a direct API (like a switchModel() method) to achieve this safely without breaking the agent's internal state. Any guidance or official recommendation on how to implement this correctly within the current architecture would be highly appreciated. Thank you for your great work on this framework!

HsiaoBob avatar Jul 06 '26 07:07 HsiaoBob

It feels quite challenging, currently ReActAgent is designed to be stateless. To safely implement dynamic switching, it may involve refactoring ReActAgent. If you have a good design proposal, please feel free to continue discussing.

jujn avatar Jul 06 '26 08:07 jujn