Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 1 addition & 5 deletions llm/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,7 @@ type GenerationOptions struct {
ThinkingMode string
ThinkingDisplay string
ThinkingEnabled *bool
// GLMThinkingEnabled toggles GLM/Z.ai extended reasoning via the provider's
// non-OpenAI thinking={"type":"enabled"|"disabled"} request parameter. Only
// applied for OpenAI-compatible providers whose compat config sets
// ThinkingFormat to "zai". When nil the parameter is omitted and the model
// uses its default (GLM defaults to enabled).
// GLMThinkingEnabled is a deprecated alias of ThinkingEnabled (Z.AI-era).
GLMThinkingEnabled *bool
VirtualKeyID string
KimiContextCacheID string
Expand Down
41 changes: 36 additions & 5 deletions llm/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,10 @@ type ChatOptions struct {
ThinkingMode string `json:"thinking_mode,omitempty"`
ThinkingDisplay string `json:"thinking_display,omitempty"`
ThinkingEnabled *bool `json:"thinking_enabled,omitempty"`
// GLMThinkingEnabled toggles GLM/Z.ai extended reasoning via the provider's
// non-OpenAI thinking={"type":"enabled"|"disabled"} request parameter. Only
// applied for OpenAI-compatible providers whose compat config sets
// ThinkingFormat to "zai". When nil the parameter is omitted and the model
// uses its default (GLM defaults to enabled).
// GLMThinkingEnabled is a deprecated alias of ThinkingEnabled kept for
// older Z.AI call sites. New code should set ThinkingEnabled. Adapters
// accept either field; wire encoding is selected per provider via
// OpenAICompatConfig.ThinkingFormat ("zai", "longcat", "agnes", …).
GLMThinkingEnabled *bool `json:"glm_thinking_enabled,omitempty"`
VirtualKeyID string `json:"virtual_key_id,omitempty"`
KimiContextCacheID string `json:"kimi_context_cache_id,omitempty"`
Expand All @@ -128,6 +127,38 @@ type ChatOptions struct {
AudioConfig string `json:"audio_config,omitempty"`
Prediction string `json:"prediction,omitempty"`
WebSearchOptions string `json:"web_search_options,omitempty"`
PromptCacheOptions *PromptCacheOpts `json:"prompt_cache_options,omitempty"`
CacheControl *CacheControl `json:"cache_control,omitempty"`
// Responses API extensions (Concentrate)
PreviousResponseID string `json:"previous_response_id,omitempty"`
Include []string `json:"include,omitempty"`
Routing *RoutingConfig `json:"routing,omitempty"`
MaxToolCalls *int `json:"max_tool_calls,omitempty"`
ContextManagement []ContextManagement `json:"context_management,omitempty"`
SafetyIdentifier *string `json:"safety_identifier,omitempty"`
Background *bool `json:"background,omitempty"`
Truncation *string `json:"truncation,omitempty"`
Conversation interface{} `json:"conversation,omitempty"`
}

type PromptCacheOpts struct {
Mode string `json:"mode,omitempty"`
TTL string `json:"ttl,omitempty"`
}

type CacheControl struct {
Type string `json:"type"`
TTL string `json:"ttl,omitempty"`
}

type RoutingConfig struct {
Model interface{} `json:"model,omitempty"`
Strategy string `json:"strategy,omitempty"` // "min" or "max"
Metric string `json:"metric,omitempty"` // "cost", "latency", "quality"
}

type ContextManagement struct {
Type string `json:"type"` // "compact_20260112", "clear_thinking_20251015", etc.
}

// ContinuationConfig controls output continuation behavior.
Expand Down
Loading