Replies: 1 comment 3 replies
|
Running into the 400 error too for endpoint |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Problem
When using Gemini models via Google's OpenAI-compatible endpoint (
generativelanguage.googleapis.com), three issues prevent normal operation inopenai-completions.ts:1. 400 errors from unsupported params
Google's endpoint rejects
storeandstream_optionsparameters. These are sent because Google is not in theisNonStandardlist indetectCompat().Fix: Add
isGoogledetection and include it inisNonStandard.2. Multi-turn tool calling broken with Gemini 2.5
Gemini 2.5 Flash/Pro use
extra_content.google.thought_signatureon tool calls for multi-turn continuity. Currently not captured from streaming response nor echoed back inconvertMessages(), breaking the second tool call turn.Fix: Capture from
choice.delta.tool_calls[].extra_content.google.thought_signatureduring streaming, echo back asextra_content.googlein assistant messages.3. Crash on unknown finish_reason
Gemini returns
MALFORMED_FUNCTION_CALLasfinish_reason, which throws in the exhaustive switch inmapStopReason().Fix: Return
"error"from thedefaultcase instead of throwing.Happy to submit a PR once approved.
All reactions