fix: Fix anthropic step parallel tool calling and add tests [LET-5438] (#5379)

* Fix anthropic step parallel tool calling and add tests

* Remove print statements
This commit is contained in:
Matthew Zhou
2025-10-13 11:58:58 -07:00
committed by Caren Thomas
parent 248c7c0b44
commit 25f140bd13
3 changed files with 9 additions and 10 deletions

View File

@@ -71,10 +71,9 @@ class SimpleLLMRequestAdapter(LettaLLMRequestAdapter):
self.content = self.reasoning_content + (self.content or [])
# Extract tool call
if self.chat_completions_response.choices[0].message.tool_calls:
self.tool_call = self.chat_completions_response.choices[0].message.tool_calls[0]
else:
self.tool_call = None
tool_calls = self.chat_completions_response.choices[0].message.tool_calls or []
self.tool_calls = list(tool_calls)
self.tool_call = self.tool_calls[0] if self.tool_calls else None
# Extract usage statistics
self.usage.step_count = 1