Files
go-llm/v2/errors.go
Steve Dudenhoeffer be572a76f4
All checks were successful
CI / Lint (push) Successful in 9m35s
CI / V2 Module (push) Successful in 11m43s
CI / Root Module (push) Successful in 11m53s
Add structured output support with Generate[T] and GenerateWith[T]
Generic functions that use the "hidden tool" technique to force models
to return structured JSON matching a Go struct's schema, replacing the
verbose "tool as structured output" pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 22:36:33 -05:00

21 lines
799 B
Go

package llm
import "errors"
var (
// ErrNoToolsConfigured is returned when the model requests tool calls but no tools are available.
ErrNoToolsConfigured = errors.New("model requested tool calls but no tools configured")
// ErrToolNotFound is returned when a requested tool is not in the toolbox.
ErrToolNotFound = errors.New("tool not found")
// ErrNotConnected is returned when trying to use an MCP server that isn't connected.
ErrNotConnected = errors.New("MCP server not connected")
// ErrStreamClosed is returned when trying to read from a closed stream.
ErrStreamClosed = errors.New("stream closed")
// ErrNoStructuredOutput is returned when the model did not return a structured output tool call.
ErrNoStructuredOutput = errors.New("model did not return structured output")
)