docs: add documentation for OpenAI model support in ADK agents - #2000
docs: add documentation for OpenAI model support in ADK agents#2000hanorik wants to merge 4 commits into
Conversation
✅ Deploy Preview for adk-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
A few suggestions to round this out: 1. Link the runnable example. For a complete, runnable sample, see [examples/openai/](https://github.com/google/adk-go/tree/main/examples/openai) in the ADK Go repository.2. Add a short "Supported features" and "Limitations" section. For an experimental, text-focused integration, it helps to set expectations up front: ## Supported features
- Text generation (streaming and non-streaming)
- Function (tool) calling
- Structured output via `OutputSchema` (JSON schema)
- Reasoning models (e.g. o-series), including reasoning-token accounting
- Token logprobs
## Limitations
- **Text only** — multimodal input (images, audio, files) is not supported.
- **Function tools only** — built-in tools (Google Search, code execution, etc.) are not supported.
- **Structured output uses OpenAI strict mode** — every field declared in an `OutputSchema` is treated as required.
- Some `GenerateContentConfig` options return an error rather than being silently ignored: `TopK`, stop sequences, multiple candidates, frequency/presence penalties, request labels, and safety settings.3. Admonition type. !!! warning "Experimental"4. Minor polish.
With the example link and the capabilities/limitations added, this will be a really solid page. Thanks again! |
|
One more suggestion, on how this page relates to LiteLLM. Since it sits right next to the LiteLLM page — and ADK Python reaches OpenAI through LiteLLM — a reader landing here could read "OpenAI = experimental, Go-only" and miss that OpenAI is fully usable from Python today via LiteLLM. The Claude page already handles this nicely by making the intro language-aware. Suggest doing the same here — replace the single-line intro with: You can use OpenAI models (such as GPT-4o and GPT-4o Mini) with ADK. How you connect depends on the language:
- **Go — native support (this page):** ADK Go provides a direct `openaimodel` package that implements the `model.LLM` interface, targeting the OpenAI Responses API. It is currently experimental.
- **Python — via LiteLLM:** ADK Python accesses OpenAI models (and many other providers) through the LiteLLM connector. See [LiteLLM](/agents/models/litellm/).
The rest of this page covers the Go-native integration.This keeps the page focused on the Go-native model while making it clear, up front, that Python users have a stable path via LiteLLM — so no one mistakes "experimental, Go" for "OpenAI isn't well supported." (Optional, separate follow-up: a one-liner on the LiteLLM page's OpenAI mention pointing Go users back to this native page, for symmetry.) |
|
@karolpiotrowicz thanks for the comments! I've added suggested sections and text adjustments except the |
| The `openaimodel` package is experimental and its behavior may change or be removed in the future. We welcome your | ||
| [feedback](https://github.com/google/adk-go/issues/new?template=feature_request.md)! | ||
|
|
||
| You can use OpenAI models (such as GPT-4o and GPT-4o Mini) with ADK. How you connect depends on the language: |
There was a problem hiding this comment.
remove "(such as GPT-4o and GPT-4o Mini)"
since the version numbers will date this document
|
|
||
| You can use OpenAI models (such as GPT-4o and GPT-4o Mini) with ADK. How you connect depends on the language: | ||
|
|
||
| - **Go — native support (this page):** ADK Go provides a direct `openaimodel` package that implements the `model.LLM` interface, targeting the OpenAI Responses API. It is currently experimental. |
There was a problem hiding this comment.
- remove: "(this page)"
generally avoid self-referential language in docs.
- remove: "It is currently experimental."
state this once at the beginning and don't mention it again, so that taking it out of experimental status is a trivial update
- Add:
[Get started](#get_started).as last sentence
| - **Go — native support (this page):** ADK Go provides a direct `openaimodel` package that implements the `model.LLM` interface, targeting the OpenAI Responses API. It is currently experimental. | ||
| - **Python — via LiteLLM:** ADK Python accesses OpenAI models (and many other providers) through the LiteLLM connector. See [LiteLLM](/agents/models/litellm/). | ||
|
|
||
| The rest of this page covers the Go-native integration. |
There was a problem hiding this comment.
remove. This is obvious from the language tags, and just creates something we have to update later when language coverage increases.
Added documentation for the experimental OpenAI model support in ADK Go.