diff --git a/src/crewai/agent.py b/src/crewai/agent.py index 8b55513d2..b7f0b2896 100644 --- a/src/crewai/agent.py +++ b/src/crewai/agent.py @@ -142,7 +142,8 @@ class Agent(BaseAgent): self.agent_ops_agent_name = self.role self.llm = create_llm(self.llm) - self.function_calling_llm = create_llm(self.function_calling_llm) + if self.function_calling_llm and not isinstance(self.function_calling_llm, LLM): + self.function_calling_llm = create_llm(self.function_calling_llm) if not self.agent_executor: self._setup_agent_executor() diff --git a/src/crewai/crew.py b/src/crewai/crew.py index 5df5f59d7..b2857d827 100644 --- a/src/crewai/crew.py +++ b/src/crewai/crew.py @@ -246,7 +246,7 @@ class Crew(BaseModel): if self.output_log_file: self._file_handler = FileHandler(self.output_log_file) self._rpm_controller = RPMController(max_rpm=self.max_rpm, logger=self._logger) - if self.function_calling_llm: + if self.function_calling_llm and not isinstance(self.function_calling_llm, LLM): self.function_calling_llm = create_llm(self.function_calling_llm) self._telemetry = Telemetry()