Skip to content

Commit a840a3c

Browse files
made separate NonOpenAIExtensions
1 parent e893d0d commit a840a3c

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

chat.go

Lines changed: 8 additions & 14 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"`
@@ -307,10 +313,8 @@ type ChatCompletionRequest struct {
307313
// Such as think mode for qwen3. "chat_template_kwargs": {"enable_thinking": false}
308314
// https://qwen.readthedocs.io/en/latest/deployment/vllm.html#thinking-non-thinking-modes
309315
ChatTemplateKwargs map[string]any `json:"chat_template_kwargs,omitempty"`
310-
// Specifies the latency tier to use for processing the request.
311-
ServiceTier ServiceTier `json:"service_tier,omitempty"`
312-
// GuidedChoice restricts output to a set of predefined choices.
313-
GuidedChoice []string `json:"guided_choice,omitempty"`
316+
// Embedded struct for non-OpenAI extensions
317+
NonOpenAIExtensions `json:",inline"`
314318
}
315319

316320
type StreamOptions struct {
@@ -394,15 +398,6 @@ const (
394398
FinishReasonNull FinishReason = "null"
395399
)
396400

397-
type ServiceTier string
398-
399-
const (
400-
ServiceTierAuto ServiceTier = "auto"
401-
ServiceTierDefault ServiceTier = "default"
402-
ServiceTierFlex ServiceTier = "flex"
403-
ServiceTierPriority ServiceTier = "priority"
404-
)
405-
406401
func (r FinishReason) MarshalJSON() ([]byte, error) {
407402
if r == FinishReasonNull || r == "" {
408403
return []byte("null"), nil
@@ -435,7 +430,6 @@ type ChatCompletionResponse struct {
435430
Usage Usage `json:"usage"`
436431
SystemFingerprint string `json:"system_fingerprint"`
437432
PromptFilterResults []PromptFilterResult `json:"prompt_filter_results,omitempty"`
438-
ServiceTier ServiceTier `json:"service_tier,omitempty"`
439433

440434
httpHeader
441435
}

0 commit comments

Comments
 (0)