Documentation
¶
Index ¶
- func EncodeToolArguments(arguments map[string]any) (string, error)
- func ExplicitMappedEffort(model llm.Model, level llm.ModelThinkingLevel) (string, bool)
- func MappedEffort(model llm.Model, level llm.ModelThinkingLevel) string
- func OffEffort(model llm.Model) string
- func OffString(model llm.Model) (string, bool)
- func SanitizeToolCallID(id string) string
- func TruncateASCII(id string, limit int) string
- type Thinking
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeToolArguments ¶
EncodeToolArguments serializes provider-independent tool arguments for both OpenAI wire protocols.
func ExplicitMappedEffort ¶ added in v0.6.13
ExplicitMappedEffort returns an effort only when the model catalog explicitly maps the level. A supported but absent mapping represents the provider's fixed default and must not be serialized as a tunable effort.
func MappedEffort ¶
func MappedEffort(model llm.Model, level llm.ModelThinkingLevel) string
MappedEffort returns the provider-specific value for a level, falling back to the level's own name when the model omits a mapping.
func SanitizeToolCallID ¶
SanitizeToolCallID replaces characters outside [a-zA-Z0-9_-] with an underscore so IDs can be replayed across OpenAI-compatible protocols.
func TruncateASCII ¶
TruncateASCII caps an ASCII identifier at limit bytes.
Types ¶
type Thinking ¶
type Thinking struct {
Specified bool
Level llm.ModelThinkingLevel
}
Thinking preserves the difference between an omitted thinking option and an explicit request to disable thinking.
func ResolveThinking ¶
func ResolveThinking(model llm.Model, requested llm.ModelThinkingLevel) Thinking
ResolveThinking clamps an explicitly requested level to one the model supports. An empty request stays unspecified.