Build presence-aware execution targets from effective configuration
This commit is contained in:
19
types.go
19
types.go
@@ -573,18 +573,17 @@ type OpenAICompatibleProfileConfig struct {
|
||||
ExtraParams map[string]any
|
||||
}
|
||||
|
||||
// ExecutionTargetPresence tracks which numeric runtime settings were explicit
|
||||
// request overrides, including explicit zero values. It has a stable JSON
|
||||
// representation and is supplied to injected LLM clients so they can preserve
|
||||
// omission semantics.
|
||||
// ExecutionTargetPresence reports which effective numeric settings should be
|
||||
// sent even when zero. It has a stable JSON representation and lets injected
|
||||
// clients preserve omission semantics.
|
||||
type ExecutionTargetPresence struct {
|
||||
// Temperature reports a non-nil ExecutionTargetOverride.Temperature.
|
||||
// Temperature keeps a zero temperature explicit.
|
||||
Temperature bool `json:"temperature"`
|
||||
// MaxTokens reports a non-nil ExecutionTargetOverride.MaxTokens.
|
||||
// MaxTokens keeps a zero token maximum explicit.
|
||||
MaxTokens bool `json:"max_tokens"`
|
||||
// TopP reports a non-nil ExecutionTargetOverride.TopP.
|
||||
// TopP keeps a zero nucleus value explicit.
|
||||
TopP bool `json:"top_p"`
|
||||
// TimeoutSeconds reports a non-nil ExecutionTargetOverride.TimeoutSeconds.
|
||||
// TimeoutSeconds keeps a zero timeout explicit.
|
||||
TimeoutSeconds bool `json:"timeout_seconds"`
|
||||
}
|
||||
|
||||
@@ -739,8 +738,8 @@ type GenerateRequest struct {
|
||||
Prompt RenderedPrompt `json:"prompt"`
|
||||
// Target contains effective model settings without the direct API key.
|
||||
Target ExecutionTarget `json:"target"`
|
||||
// TargetPresence distinguishes inherited numeric zeros from explicit
|
||||
// request overrides.
|
||||
// TargetPresence distinguishes omitted or suppressed controls from explicit
|
||||
// numeric values, including zero.
|
||||
TargetPresence ExecutionTargetPresence `json:"target_presence"`
|
||||
// StructuredOutput contains provider response constraints when requested.
|
||||
StructuredOutput *StructuredOutputSpec `json:"structured_output,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user