File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -248,6 +248,16 @@ func (r *ChatCompletionResponseFormatJSONSchema) UnmarshalJSON(data []byte) erro
248
248
return nil
249
249
}
250
250
251
+ // ChatCompletionRequestExtensions contains third-party OpenAI API extensions (e.g., vendor-specific implementations like vLLM).
252
+ type ChatCompletionRequestExtensions struct {
253
+ // GuidedChoice is a vLLM-specific extension that restricts the model's output
254
+ // to one of the predefined string choices provided in this field. This feature
255
+ // is used to constrain the model's responses to a controlled set of options,
256
+ // ensuring predictable and consistent outputs in scenarios where specific
257
+ // choices are required.
258
+ GuidedChoice []string `json:"guided_choice,omitempty"`
259
+ }
260
+
251
261
// ChatCompletionRequest represents a request structure for chat completion API.
252
262
type ChatCompletionRequest struct {
253
263
Model string `json:"model"`
@@ -309,6 +319,8 @@ type ChatCompletionRequest struct {
309
319
ChatTemplateKwargs map [string ]any `json:"chat_template_kwargs,omitempty"`
310
320
// Specifies the latency tier to use for processing the request.
311
321
ServiceTier ServiceTier `json:"service_tier,omitempty"`
322
+ // Embedded struct for non-OpenAI extensions
323
+ ChatCompletionRequestExtensions
312
324
}
313
325
314
326
type StreamOptions struct {
You can’t perform that action at this time.
0 commit comments