Skip to content

Commit 96bc3ef

Browse files
committed
feat: implement ExtraBody support for ChatCompletionRequest
1 parent c125ae2 commit 96bc3ef

File tree

3 files changed

+468
-0
lines changed

3 files changed

+468
-0
lines changed

chat.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ type ChatCompletionRequest struct {
280280
// Such as think mode for qwen3. "chat_template_kwargs": {"enable_thinking": false}
281281
// https://qwen.readthedocs.io/en/latest/deployment/vllm.html#thinking-non-thinking-modes
282282
ChatTemplateKwargs map[string]any `json:"chat_template_kwargs,omitempty"`
283+
// Add additional JSON properties to the request
284+
ExtraBody map[string]any `json:"extra_body,omitempty"`
283285
}
284286

285287
type StreamOptions struct {
@@ -425,6 +427,7 @@ func (c *Client) CreateChatCompletion(
425427
http.MethodPost,
426428
c.fullURL(urlSuffix, withModel(request.Model)),
427429
withBody(request),
430+
withExtraBody(request.ExtraBody),
428431
)
429432
if err != nil {
430433
return

0 commit comments

Comments
 (0)