You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ApigeeLlm Chat Completions crashes on typed tool result values #8131
ApigeeLlm's Chat Completions adapter calls json.dumps directly on tool responses. A normal Python tool returning a date, datetime, Decimal, UUID, or Pydantic model therefore crashes before sending the next HTTP request. This affects both streaming and non-streaming requests.
Reproduction
Use an ApigeeLlm configured for an OpenAI-compatible Chat Completions endpoint with this tool:
When the model calls get_invoice, the result becomes a FunctionResponse successfully, but conversion to the next Chat Completions request raises TypeError: Object of type date is not JSON serializable in CompletionsHTTPClient._contents_to_messages.
Expected: send valid JSON with the date encoded as an ISO string and Decimal encoded without losing precision, consistent with ADK's typed model values. Ordinary JSON results should remain unchanged.
Environment and validation
Reproduced on main at 12aab4aaa, Python 3.12.10, Windows. A real InMemoryRunner and FunctionTool were exercised against a local HTTP server emitting OpenAI-compatible responses, for both NONE and SSE streaming. No live Apigee deployment or provider credentials were used.
This is separate from #8123, which affects the LiteLlm adapter. Apigee has its own serializer and raises rather than falling back to a Python repr. The proposed fix uses the already-installed Pydantic serializer only for values unsupported by the standard JSON encoder.
Prepared with AI assistance; reproduction and validation were executed locally.
Activity