Documentation
¶
Overview ¶
Package responseformat defines structured output constraints for LLM responses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResponseFormat ¶
type ResponseFormat struct {
// Type is one of "text", "json_object", "json_schema".
Type Type `yaml:"type"`
// Name identifies the schema (required by OpenAI for json_schema).
Name string `yaml:"name"`
// Schema is the JSON Schema as a Go map (required for json_schema).
Schema map[string]any `yaml:"schema"`
// Strict enables strict schema adherence when supported (OpenAI, OpenRouter).
Strict bool `yaml:"strict"`
}
ResponseFormat constrains the LLM's response to a specific format.
func (*ResponseFormat) EffectiveName ¶
func (r *ResponseFormat) EffectiveName() string
EffectiveName returns the schema name, defaulting to "response" when empty. OpenAI requires a non-empty name for json_schema; others ignore it.
Click to show internal directories.
Click to hide internal directories.