feat: conversion-driven extensions — resolvers, DefineTool, hooks, ops controls
Phase 9a (ADR-0014): Registry.RegisterResolver for dynamic tiers; DefineTool[Args] typed tools; Usage cache/reasoning detail fields wired through anthropic/openai/google; WithPromptCaching (Anthropic cache_control); agent supervision hooks (WithMaxStepsFunc, WithSteer, WithCompactor, WithToolErrorLimits + ErrToolLoop); health Bench/Unbench/Snapshot; ChainConfig.Observer failover events. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,12 @@ import (
|
||||
// suitable for WithSchema and tool parameters.
|
||||
func SchemaFor[T any]() (json.RawMessage, error) { return llm.SchemaFor[T]() }
|
||||
|
||||
// DefineTool re-exports llm.DefineTool: a typed tool whose parameter schema
|
||||
// is derived from Args and whose handler receives decoded arguments.
|
||||
func DefineTool[Args any](name, description string, fn func(ctx context.Context, args Args) (any, error)) Tool {
|
||||
return llm.DefineTool(name, description, fn)
|
||||
}
|
||||
|
||||
// Generate performs a structured-output request and unmarshals the result
|
||||
// into T: the schema is derived from T (llm.SchemaFor), injected via the
|
||||
// provider's native structured-output mechanism, and the response text is
|
||||
|
||||
Reference in New Issue
Block a user