Fix LiteAgent tool calling in LLMCallStartedEvent

- Fix hardcoded tools=None in LLMCallStartedEvent emission
- Convert self._parsed_tools to proper dict format for event
- Add comprehensive tests for tool calling functionality
- Add reproduction test for GitHub issue #3302

Fixes #3302

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2025-08-10 04:45:13 +00:00
parent 251ae00b8b
commit f7e8949e92
2 changed files with 166 additions and 33 deletions

View File

@@ -525,7 +525,16 @@ class LiteAgent(FlowTrackable, BaseModel):
self,
event=LLMCallStartedEvent(
messages=self._messages,
tools=None,
tools=[
{
"name": tool.name,
"description": tool.description,
"args": tool.args,
}
for tool in self._parsed_tools
]
if self._parsed_tools
else None,
callbacks=self._callbacks,
from_agent=self,
model=model,