Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotConfigured = errors.New("ai: not configured (no API key)")
ErrNotConfigured is returned when AI features are used without an API key.
Functions ¶
func RecipePrompt ¶ added in v0.7.0
RecipePrompt returns the system prompt for recipe creation. If promptFile is non-empty and the file exists, its contents are appended to the base prompt.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles Anthropic API interactions.
func NewClient ¶
NewClient creates a Client. If apiKey is empty, calls will return ErrNotConfigured.
func (*Client) RunAgent ¶ added in v0.7.0
func (c *Client) RunAgent( systemPrompt string, userPrompt string, tools []Tool, maxIterations int, ) (string, error)
RunAgent executes an agentic loop with tools. Returns the final text response. The agent calls tools until it produces a text-only response or hits maxIterations.
type Tool ¶ added in v0.7.0
Tool defines a tool the agent can call.
func RecipeTools ¶ added in v0.7.0
RecipeTools returns the tools available for recipe creation, a cleanup function, and any error from creating the temp download directory. recipeDir is where recipes are written (letter-bucketed). The caller must check error before deferring cleanup; on error, cleanup is a no-op.