Skip to content

Commit 5c3ab18

Browse files
made separate NonOpenAIExtensions
1 parent e893d0d commit 5c3ab18

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

chat.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,12 @@ func (r *ChatCompletionResponseFormatJSONSchema) UnmarshalJSON(data []byte) erro
248248
return nil
249249
}
250250

251+
// NonOpenAIExtensions contains non-standard OpenAI API extensions
252+
type NonOpenAIExtensions struct {
253+
// GuidedChoice restricts output to a set of predefined choices.
254+
GuidedChoice []string `json:"guided_choice,omitempty"`
255+
}
256+
251257
// ChatCompletionRequest represents a request structure for chat completion API.
252258
type ChatCompletionRequest struct {
253259
Model string `json:"model"`
@@ -309,8 +315,8 @@ type ChatCompletionRequest struct {
309315
ChatTemplateKwargs map[string]any `json:"chat_template_kwargs,omitempty"`
310316
// Specifies the latency tier to use for processing the request.
311317
ServiceTier ServiceTier `json:"service_tier,omitempty"`
312-
// GuidedChoice restricts output to a set of predefined choices.
313-
GuidedChoice []string `json:"guided_choice,omitempty"`
318+
// Embedded struct for non-OpenAI extensions
319+
NonOpenAIExtensions `json:",inline"`
314320
}
315321

316322
type StreamOptions struct {

0 commit comments

Comments
 (0)