feat(models): support forwarding extra_body in OpenAILlm

Aperta
#8,365 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
api

Direzione di ricerca

Start in src/google/adk/integrations/openai/_openai_llm.py, at _build_request_kwargs and the generate_content* methods where the chat.completions.create kwargs are assembled. Compare how src/google/adk/models/lite_llm.py reads http_options.extra_body and how _openai_responses_llm.py merges extra_request_args, then settle on one configuration surface with the maintainers. Done means extra_body reaches chat.completions.create and a unit test asserts it is passed through.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Filed as a separate issue from #8191 per https://github.com/google/adk-python/issues/8191#issuecomment-7154691925.

Problem

OpenAILlm builds the chat.completions.create(**kwargs) request in src/google/adk/integrations/openai/_openai_llm.py (_build_request_kwargs / _generate_content_*) without any way to pass extra_body.

OpenAI-compatible inference servers (such as vLLM and SGLang) rely on extra_body for server-specific request controls — for example:

  • chat_template_kwargs={"enable_thinking": False} to toggle reasoning on Qwen3 / DeepSeek models;
  • top_k, repetition_penalty, min_p, or guided-decoding options.

Other ADK adapters already support this:

  • LiteLlm forwards http_options.extra_body (src/google/adk/models/lite_llm.py);
  • OpenAIResponsesLlm merges extra_body from extra_request_args (src/google/adk/integrations/openai/_openai_responses_llm.py).
Proposal

Allow callers of OpenAILlm to pass extra_body (e.g., via extra_request_args / GenerateContentConfig.http_options.extra_body, matching OpenAIResponsesLlm / LiteLlm conventions) and forward it to chat.completions.create(..., extra_body=...).

Happy to submit a focused PR with unit tests once the preferred configuration surface is confirmed.

Lingua principale
Python
Stelle
22.3k
Fork
4.4k
Merge medio
1g 2h
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di google/adk-python

Tutte le issue di google/adk-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.