返回 DeepSeek-Reasonix
temperature.go
根目录 / internal / provider / temperature.go
1 package provider
2
3 // TemperaturePtr wraps v in a pointer so callers that explicitly want a
4 // specific temperature, including 0 for deterministic output, can distinguish
5 // that intent from "not set, use the provider default".
6 func TemperaturePtr(v float64) *float64 { return &v }
7
8 // OptionalTemperature returns nil when v is zero, matching the historical
9 // config behavior where 0 meant "not configured", and a pointer otherwise.
10 func OptionalTemperature(v float64) *float64 {
11 if v == 0 {
12 return nil
13 }
14 return &v
15 }
16
16 lines GO