From 9ed74749c1d98331b4887f10f33d4c6750911058 Mon Sep 17 00:00:00 2001 From: Justa Date: Wed, 30 Apr 2025 18:08:58 +0800 Subject: [PATCH] add ChatTemplateKwargs to ChatCompletionRequest --- chat.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chat.go b/chat.go index 0f91d481c..c8a3e81b3 100644 --- a/chat.go +++ b/chat.go @@ -275,6 +275,11 @@ type ChatCompletionRequest struct { Metadata map[string]string `json:"metadata,omitempty"` // Configuration for a predicted output. Prediction *Prediction `json:"prediction,omitempty"` + // ChatTemplateKwargs provides a way to add non-standard parameters to the request body. + // Additional kwargs to pass to the template renderer. Will be accessible by the chat template. + // Such as think mode for qwen3. "chat_template_kwargs": {"enable_thinking": false} + // https://qwen.readthedocs.io/en/latest/deployment/vllm.html#thinking-non-thinking-modes + ChatTemplateKwargs map[string]any `json:"chat_template_kwargs,omitempty"` } type StreamOptions struct {