Skip to content

Commit dc6d487

Browse files
committed
Fix pydantic serialization error
1 parent fa7e2d1 commit dc6d487

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

agent_tool/src/functions/llm_chat.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,15 @@ async def llm_chat(function_input: LlmChatInput) -> ChatCompletion:
5252
Message(role="system", content=function_input.system_content or "")
5353
)
5454

55-
return client.chat.completions.create(
55+
result = client.chat.completions.create(
5656
model=function_input.model or "gpt-4o-mini",
5757
messages=function_input.messages,
5858
tools=function_input.tools,
5959
)
60+
61+
log.info("llm_chat function completed", result=result)
62+
63+
return result.model_dump()
6064
except Exception as e:
6165
error_message = f"LLM chat failed: {e}"
6266
raise NonRetryableError(error_message) from e

0 commit comments

Comments
 (0)