From 8d7ea9bddbd19cd874db463484e2a2e5e8cfae6a Mon Sep 17 00:00:00 2001 From: Amadi Azdaev Date: Mon, 11 Aug 2025 12:35:41 +0300 Subject: [PATCH 1/2] add verbosity param to ChatCompletionRequest --- chat.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chat.go b/chat.go index 0bb2e98ee..6c725bc32 100644 --- a/chat.go +++ b/chat.go @@ -320,6 +320,10 @@ type ChatCompletionRequest struct { ChatTemplateKwargs map[string]any `json:"chat_template_kwargs,omitempty"` // Specifies the latency tier to use for processing the request. ServiceTier ServiceTier `json:"service_tier,omitempty"` + // Verbosity determines how many output tokens are generated. + // Lowering the number of tokens reduces overall latency. + // It can be set to "low", "medium", or "high". + Verbosity string `json:"verbosity,omitempty"` // Embedded struct for non-OpenAI extensions ChatCompletionRequestExtensions } From bd1cc521489a0802cd1e4d4dc4218eda1b715ff2 Mon Sep 17 00:00:00 2001 From: Amadi Azdaev Date: Wed, 20 Aug 2025 00:42:16 +0300 Subject: [PATCH 2/2] edit comment about verbosity --- chat.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/chat.go b/chat.go index 06916114e..0aa018715 100644 --- a/chat.go +++ b/chat.go @@ -320,9 +320,11 @@ type ChatCompletionRequest struct { ChatTemplateKwargs map[string]any `json:"chat_template_kwargs,omitempty"` // Specifies the latency tier to use for processing the request. ServiceTier ServiceTier `json:"service_tier,omitempty"` - // Verbosity determines how many output tokens are generated. - // Lowering the number of tokens reduces overall latency. - // It can be set to "low", "medium", or "high". + // Verbosity determines how many output tokens are generated. Lowering the number of + // tokens reduces overall latency. It can be set to "low", "medium", or "high". + // Note: This field is only confirmed to work with gpt-5, gpt-5-mini and gpt-5-nano. + // Also, it is not in the API reference of chat completion at the time of writing, + // though it is supported by the API. Verbosity string `json:"verbosity,omitempty"` // A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. // The IDs should be a string that uniquely identifies each user.