mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-27 17:18:13 +00:00
try this
This commit is contained in:
@@ -266,12 +266,13 @@ class BaseAgent(ABC, BaseModel):
|
|||||||
"cache_handler",
|
"cache_handler",
|
||||||
"llm",
|
"llm",
|
||||||
"knowledge_sources",
|
"knowledge_sources",
|
||||||
|
"_knowledge",
|
||||||
"formatting_errors",
|
"formatting_errors",
|
||||||
}
|
}
|
||||||
|
|
||||||
# Copy llm
|
# Copy llm
|
||||||
existing_llm = shallow_copy(self.llm)
|
existing_llm = shallow_copy(self.llm)
|
||||||
|
print("existing_llm", existing_llm)
|
||||||
# Properly copy knowledge sources if they exist
|
# Properly copy knowledge sources if they exist
|
||||||
existing_knowledge_sources = None
|
existing_knowledge_sources = None
|
||||||
if self.knowledge_sources:
|
if self.knowledge_sources:
|
||||||
@@ -292,8 +293,9 @@ class BaseAgent(ABC, BaseModel):
|
|||||||
existing_knowledge_sources.append(copied_source)
|
existing_knowledge_sources.append(copied_source)
|
||||||
|
|
||||||
copied_data = self.model_dump(exclude=exclude)
|
copied_data = self.model_dump(exclude=exclude)
|
||||||
|
print("copied_data", copied_data)
|
||||||
copied_data = {k: v for k, v in copied_data.items() if v is not None}
|
copied_data = {k: v for k, v in copied_data.items() if v is not None}
|
||||||
|
print("copied_data", copied_data)
|
||||||
copied_agent = type(self)(
|
copied_agent = type(self)(
|
||||||
**copied_data,
|
**copied_data,
|
||||||
llm=existing_llm,
|
llm=existing_llm,
|
||||||
|
|||||||
Reference in New Issue
Block a user