Skip to content

Commit 9b80b55

Browse files
committed
docs: note Gemini OpenAI-compat wire requirements for tool calls
Adds a compat note to tutorial/09-ai-endpoint covering the tool_calls + name fields that Gemini's v1beta/openai layer requires and atmosphere-ai 4.0.39 serializes.
1 parent 5f23200 commit 9b80b55

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

docs/src/content/docs/tutorial/09-ai-endpoint.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,17 @@ Auto-detection resolves the base URL from the model name:
340340
- All other remote models route to `https://generativelanguage.googleapis.com/v1beta/openai`
341341
- Local mode routes to `http://localhost:11434/v1` (Ollama)
342342

343+
:::note[Gemini OpenAI-compat wire contract]
344+
Gemini's `v1beta/openai` layer is stricter than OpenAI itself in two places:
345+
assistant messages carrying a tool call must emit the full `tool_calls` array
346+
(not null content), and tool messages must emit the `name` field so Gemini
347+
can populate its native `function_response.name`. `OpenAiCompatibleClient`
348+
serializes both unconditionally — OpenAI treats them as additive. If you
349+
ever see `GenerateContentRequest…function_response.name: Name cannot be
350+
empty`, you are running an older build; upgrade `atmosphere-ai` to `4.0.39`
351+
or later.
352+
:::
353+
343354
### Atmosphere Init-Params
344355

345356
```java

0 commit comments

Comments
 (0)