Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,16 @@
return nil
}

// ChatCompletionRequestExtensions contains third-party OpenAI API extensions (e.g., vendor-specific implementations like vLLM).

Check failure on line 251 in chat.go

View workflow job for this annotation

GitHub Actions / Sanity check

The line is 128 characters long, which exceeds the maximum of 120 characters. (lll)
type ChatCompletionRequestExtensions struct {
// GuidedChoice is a vLLM-specific extension that restricts the model's output
// to one of the predefined string choices provided in this field. This feature
// is used to constrain the model's responses to a controlled set of options,
// ensuring predictable and consistent outputs in scenarios where specific
// choices are required.
GuidedChoice []string `json:"guided_choice,omitempty"`
}

// ChatCompletionRequest represents a request structure for chat completion API.
type ChatCompletionRequest struct {
Model string `json:"model"`
Expand Down Expand Up @@ -309,6 +319,8 @@
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"`
// Embedded struct for non-OpenAI extensions
ChatCompletionRequestExtensions
}

type StreamOptions struct {
Expand Down
Loading