Skip to content

Commit

Permalink
Copy llm config to avoid external changes (#2290)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackgerrits authored Apr 5, 2024
1 parent ebd0210 commit 16b1db3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions autogen/agentchat/conversable_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ def __init__(
if is_termination_msg is not None
else (lambda x: content_str(x.get("content")) == "TERMINATE")
)
# Take a copy to avoid modifying the given dict
if isinstance(llm_config, dict):
llm_config = copy.deepcopy(llm_config)

self._validate_llm_config(llm_config)

Expand Down

0 comments on commit 16b1db3

Please sign in to comment.