Skip to content

Commit

Permalink
Removed deep copy, updated comment
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Sze <mark@sze.family>
  • Loading branch information
marklysze committed Dec 4, 2024
1 parent aca0346 commit fba4d08
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions autogen/agentchat/conversable_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ def __init__(
silent (bool or None): (Experimental) whether to print the message sent. If None, will use the value of
silent in each function.
context_variables (dict or None): Context variables that provide a persistent context for the agent.
The passed in context variables will be deep-copied, not referenced.
Only used in Swarms at this stage.
Note: Will maintain a reference to the passed in context variables (enabling a shared context)
Only used in Swarms at this stage:
https://ag2ai.github.io/ag2/docs/reference/agentchat/contrib/swarm_agent
response_format (BaseModel): Used to specify structured response format for the agent. Currently only available for the OpenAI client.
"""
# we change code_execution_config below and we have to make sure we don't change the input
Expand Down Expand Up @@ -200,7 +201,7 @@ def __init__(
self.register_reply([Agent, None], ConversableAgent.generate_oai_reply)
self.register_reply([Agent, None], ConversableAgent.a_generate_oai_reply, ignore_async_in_sync_chat=True)

self._context_variables = copy.deepcopy(context_variables) if context_variables is not None else {}
self._context_variables = context_variables if context_variables is not None else {}

# Setting up code execution.
# Do not register code execution reply if code execution is disabled.
Expand Down

0 comments on commit fba4d08

Please sign in to comment.