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>
This commit is contained in:
@@ -14,4 +14,7 @@ var (
|
||||
|
||||
// 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")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user