[Suggestion]: Change behavior of config cloning in register_reply
#2487
Labels
0.2
Issues which are related to the pre 0.4 codebase
help wanted
Extra attention is needed
needs-triage
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
The text was updated successfully, but these errors were encountered: