feat(models): support forwarding extra_body in OpenAILlm

未關閉
#8,365 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 3 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
45/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
python
領域
api

研究方向

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.

由索引模型根據 Issue 內容生成。

描述

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.

主要語言
Python
星號
22.3k
分支
4.4k
平均合併
1 天 2 小時
30 天內合併 PR
6

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

google/adk-python 的其他 Issue

查看 google/adk-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。