When you register a reply to a ConversableAgent, you have the option of providing a config parameter which could be used for LLM generation or other extra variables.
This is then assigned to the "private" _reply_func_list in this way:
My focus is specifically on config and init_config. This works well when the config is modified over time by the reply function, and reset() resets the config as expected. However, this approach leaves no way to modify the config from outside the reply function, which is a useful functionality.
If the user really wants to modify the config, they will need to access _reply_func_list. What if we invert the cloning behavior so that config is the original object and init_config is the clone? That way, the user can keep a reference to the config object and update it if needed accordingly,
Let me know if I've missed something important or there is a better way to give reply functions additional mutable data. My current workaround is to use functools.partial() to pass in a mutable dict.
I think it makes sense to allow config to be modified externally from the agent. You might want to take a look at experimental branch as we are working toward more extensible API. cc @jackgerrits
Describe the issue
When you register a reply to a
ConversableAgent
, you have the option of providing aconfig
parameter which could be used for LLM generation or other extra variables.This is then assigned to the "private"
_reply_func_list
in this way:My focus is specifically on
config
andinit_config
. This works well when the config is modified over time by the reply function, andreset()
resets the config as expected. However, this approach leaves no way to modify theconfig
from outside the reply function, which is a useful functionality.If the user really wants to modify the
config
, they will need to access_reply_func_list
. What if we invert the cloning behavior so thatconfig
is the original object andinit_config
is the clone? That way, the user can keep a reference to theconfig
object and update it if needed accordingly,Let me know if I've missed something important or there is a better way to give reply functions additional mutable data. My current workaround is to use
functools.partial()
to pass in a mutable dict.Steps to reproduce
No response
Screenshots and logs
No response
Additional Information
No response