feat(models): support forwarding extra_body in OpenAILlm

Offen
#8,365 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 3 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
api

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Python
Sterne
22.3k
Forks
4.4k
Ø Merge
1 T. 2 Std.
Gemergte PRs (30 T.)
6

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus google/adk-python

Alle Issues in google/adk-python

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.