Versions in this module Expand all Collapse all v0 v0.0.12 May 14, 2026 Changes in this version + const AnthropicAPIVersion + const DefaultAnthropicModel + const DefaultAnthropicURL + const MaxTokens + type AnthropicClient struct + func NewAnthropicClient(cfg AnthropicConfig) (*AnthropicClient, error) + func (c *AnthropicClient) Model() string + func (c *AnthropicClient) Stream(ctx context.Context, system string, msgs []AnthropicMessage, ...) <-chan StreamEvent + func (c *AnthropicClient) URL() string + type AnthropicConfig struct + APIKeyFile string + HTTPClient *http.Client + Model string + URL string + type AnthropicContentBlock struct + Content string + ID string + Input json.RawMessage + IsError bool + Name string + Text string + ToolUseID string + Type string + type AnthropicMessage struct + Content []AnthropicContentBlock + Role string + type AnthropicTool struct + Description string + InputSchema json.RawMessage + Name string + type Engine struct + func NewEngine(client *AnthropicClient, tools []Tool, pageInstructions map[string]string, ...) *Engine + func (e *Engine) Stream(ctx context.Context, w *Writer, actor string, req Request) error + func (e *Engine) Tool(name string) Tool + type Request struct + AutoApprove []string + Messages []RequestMessage + Page string + PageContext string + PreApprovedToolUseIDs []string + type RequestMessage struct + ID string + Parts []RequestMessagePart + Role string + type RequestMessagePart struct + ErrorText string + Input json.RawMessage + Output json.RawMessage + State string + Text string + ToolCallID string + Type string + type StreamEvent struct + Err error + Kind string + StopReason string + Text string + ToolInput json.RawMessage + ToolName string + ToolUseID string + type Tool interface + AvailablePages func() []string + ClientSide func() bool + Description func() string + Execute func(ctx context.Context, actor string, input json.RawMessage) (string, error) + InputSchema func() json.RawMessage + Name func() string + RequiresConfirmation func() bool + type Writer struct + func NewWriter(rw http.ResponseWriter) *Writer + func (w *Writer) Close() + func (w *Writer) FinishText() + func (w *Writer) WriteConfirmationRequest(toolCallID, toolName string, args json.RawMessage) + func (w *Writer) WriteError(msg string) + func (w *Writer) WriteFinish(_ string) + func (w *Writer) WriteStepFinish() + func (w *Writer) WriteStepStart() + func (w *Writer) WriteText(s string) + func (w *Writer) WriteToolCall(toolCallID, toolName string, args json.RawMessage, providerExecuted bool) + func (w *Writer) WriteToolError(toolCallID, _, msg string) + func (w *Writer) WriteToolResult(toolCallID, _, result string)