Versions in this module Expand all Collapse all v0 v0.2.0 Aug 17, 2026 Changes in this version + var ErrEmptyReply = errors.New("backend returned an empty reply") v0.1.0 Aug 16, 2026 Changes in this version + const LoadSkillToolName + var ErrInvalidJSON = errors.New("reply is not valid JSON") + var ErrIterationLimit = errors.New("tool loop hit the iteration limit") + var ErrNoToolCalling = errors.New("backend did not return a tool call") + var ErrNotJSON = errors.New("reply is not JSON") + var ErrOutputLimit = errors.New("reply hit the output token limit") + var ErrResponseTooLarge = errors.New("response body exceeds the configured cap") + func Advertise(skills []Skill) string + func DecodeJSONObject(s string) (map[string]any, error) + func StripReasoning(s string) string + type Client struct + func NewClient(baseURL, apiKey string, opts ...Option) (*Client, error) + func (c *Client) ProbeToolCalling(ctx context.Context, model string) error + func (c *Client) Run(ctx context.Context, req RunRequest) (*RunResult, error) + type Option func(*config) + func WithHTTPClient(hc *http.Client) Option + func WithMaxResponseBytes(n int64) Option + func WithUserAgent(ua string) Option + type RunRequest struct + MaxIterations int + MaxTokens int64 + Model string + Prompt string + System string + Temperature float64 + Tools []Tool + type RunResult struct + Iterations int + Text string + ToolCalls int + type Skill struct + Body string + Description string + Name string + func LoadSkills(fsys fs.FS, dir string) ([]Skill, error) + func MergeSkills(base, overrides []Skill) []Skill + type Tool struct + Description string + InputSchema map[string]any + Name string + Run func(ctx context.Context, input json.RawMessage) (string, error) + func LoadSkillTool(skills []Skill) Tool