Documentation
¶
Overview ¶
Package llmtask provides one bounded, model-only JSON subtask tool.
Index ¶
- Constants
- func BuildChatInput(request Request) llm.ChatInput
- func DecodeContent(content string, maxChars int) (any, string, error)
- func Definition() toolcontract.Definition
- func Invoke(ctx context.Context, opts Options, request Request) (*llm.ChatResponse, error)
- func NewHandler(opts Options) toolcontract.Handler
- func NormalizeSchema(raw any) (map[string]any, error)
- func Register(reg toolcontract.Registrar, opts Options)
- func ValidateSchema(schema map[string]any) error
- func ValidateValue(value any, schema map[string]any) error
- type ChatWithInputFunc
- type Options
- type Request
Constants ¶
const DefaultMaxContentChars = defaultLLMTaskMaxContent
DefaultMaxContentChars is the default maximum model response size validated by the portable coordinator.
const DefaultTimeoutMs = defaultLLMTaskTimeoutMs
DefaultTimeoutMs is the default model call deadline used by NewHandler.
const Name = "llm_task"
Name is the catalog name of the LLM task tool.
Variables ¶
This section is empty.
Functions ¶
func BuildChatInput ¶
BuildChatInput builds the model request without executing it.
func DecodeContent ¶
DecodeContent extracts and decodes one bounded JSON value from model text.
func Definition ¶
func Definition() toolcontract.Definition
Definition returns the stable llm_task schema.
func NewHandler ¶
func NewHandler(opts Options) toolcontract.Handler
NewHandler returns the portable model-facing handler.
func NormalizeSchema ¶
NormalizeSchema accepts an object or JSON object string.
func Register ¶
func Register(reg toolcontract.Registrar, opts Options)
Register adds llm_task when both a registrar and explicit model port exist.
func ValidateSchema ¶
ValidateSchema validates the supported JSON Schema subset.
Types ¶
type ChatWithInputFunc ¶
ChatWithInputFunc is the narrow Host-owned model invocation port.
type Options ¶
type Options struct {
ModelConfig string
AllowModelOverride bool
DefaultTimeoutMs int
MaxContentChars int
ChatWithInput ChatWithInputFunc
}
Options configures the portable LLM task coordinator.
ChatWithInput is required. The package never discovers a provider, model, credential, endpoint, or global model registry.