Skip to content

Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.

fix(llm): use validated messages variable in non-streaming handlers

Greyson LaLonde2a40316521fd
diff --git a/lib/crewai/src/crewai/llm.py b/lib/crewai/src/crewai/llm.py
index fb8461c04..57b00b408 100644
--- a/lib/crewai/src/crewai/llm.py
+++ b/lib/crewai/src/crewai/llm.py
@@ -1160,7 +1160,7 @@ class LLM(BaseLLM):
call_type=LLMCallType.LLM_CALL,
from_task=from_task,
from_agent=from_agent,
- messages=params["messages"],
+ messages=messages,
usage=None,
)
return structured_response
@@ -1316,7 +1316,7 @@ class LLM(BaseLLM):
call_type=LLMCallType.LLM_CALL,
from_task=from_task,
from_agent=from_agent,
- messages=params["messages"],
+ messages=messages,
usage=None,
)
return structured_response