Uh oh!
There was an error while loading. Please reload this page.
feat: Add 'extra_body' parameter support for provider and model options - #6761
feat: Add 'extra_body' parameter support for provider and model options#6761yuguorui wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds support for an extraBody parameter to both provider-level and model-level options, allowing users to add custom JSON properties to request payloads. This feature mirrors the OpenAI Python SDK's extra_body parameter and enables capabilities like thinking, search, topP, and temperature across different LLM providers.
Key changes:
- Adds
extraBodyconfiguration option to provider and model options - Implements logic to merge provider-level and model-level
extraBodyproperties into the request - Updates documentation with examples showing how to configure
extraBody
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/web/src/content/docs/providers.mdx | Adds documentation and examples for the new extraBody configuration option at both provider and model levels |
| packages/opencode/src/provider/transform.ts | Implements the merging logic for extraBody properties from provider and model options into the request parameters |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
In the OpenAI Python SDK, the `Completions.create` method includes an `extra_body` parameter that lets users add custom JSON properties to the request payload. This feature is particularly useful in various scenarios—such as enabling capabilities like thinking [1][2], search, topP, temperature, and more, across different LLM providers. Here[3] is the implementation in the Python SDK for reference. Signed-off-by: yuguorui <yuguorui@pku.edu.cn> [1] https://bailian.console.alibabacloud.com/?tab=api#/api/?type=model&url=2712576 [2] https://docs.z.ai/api-reference/llm/chat-completion [3] https://github.com/openai/openai-python/blob/af8f606b3eef1af99f98929847f1b5baf19171ae/src/openai/resources/chat/completions.py#L76
43ec371 to
554ee32Compareyuguorui
commented
Jan 3, 2026
Some typical LLM service providers (such as Alibaba BaiLian, one of Asia's largest cloud service providers) enable the |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
In the OpenAI Python SDK, the
Completions.createmethod includes anextra_bodyparameter that lets users add custom JSON properties to the request payload. This feature is particularly useful in various scenarios—such as enabling capabilities like thinking [1][2], search, topP, temperature, and more, across different LLM providers.Here[3] is the implementation in the Python SDK for reference.
[1] https://bailian.console.alibabacloud.com/?tab=api#/api/?type=model&url=2712576
[2] https://docs.z.ai/api-reference/llm/chat-completion
[3] https://github.com/openai/openai-python/blob/af8f606b3eef1af99f98929847f1b5baf19171ae/src/openai/resources/chat/completions.py#L76