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 @@ -279,6 +279,16 @@ func (r *ChatCompletionResponseFormatJSONSchema) UnmarshalJSON(data []byte) erro
279
279
return nil
280
280
}
281
281
282
+ // ChatCompletionRequestExtensions contains third-party OpenAI API extensions (e.g., vendor-specific implementations like vLLM).
283
+ type ChatCompletionRequestExtensions struct {
284
+ // GuidedChoice is a vLLM-specific extension that restricts the model's output
285
+ // to one of the predefined string choices provided in this field. This feature
286
+ // is used to constrain the model's responses to a controlled set of options,
287
+ // ensuring predictable and consistent outputs in scenarios where specific
288
+ // choices are required.
289
+ GuidedChoice []string `json:"guided_choice,omitempty"`
290
+ }
291
+
282
292
// ChatCompletionRequest represents a request structure for chat completion API.
283
293
type ChatCompletionRequest struct {
284
294
Model string `json:"model"`
@@ -340,6 +350,8 @@ type ChatCompletionRequest struct {
340
350
ChatTemplateKwargs map [string ]any `json:"chat_template_kwargs,omitempty"`
341
351
// Specifies the latency tier to use for processing the request.
342
352
ServiceTier ServiceTier `json:"service_tier,omitempty"`
353
+ // Embedded struct for non-OpenAI extensions
354
+ ChatCompletionRequestExtensions
343
355
}
344
356
345
357
type StreamOptions struct {
You can’t perform that action at this time.
0 commit comments