feat(models): support forwarding extra_body in OpenAILlm

Đang mở
#8,365 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
api

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
22.3k
Fork
4.4k
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
6

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của google/adk-python

Tất cả issue của google/adk-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.