Documentation
¶
Index ¶
- Variables
- func ExtractCode(text string) string
- func ExtractJSON(text string) string
- func HandleToolCall(name string, input json.RawMessage) (string, error)
- type Client
- func (c *Client) GenerateComponent(ctx context.Context, spec ai.ComponentSpec) (string, error)
- func (c *Client) GenerateWorkflow(ctx context.Context, req ai.GenerateRequest) (*ai.GenerateResponse, error)
- func (c *Client) IdentifyMissingComponents(ctx context.Context, cfg *config.WorkflowConfig) ([]ai.ComponentSpec, error)
- func (c *Client) SuggestWorkflow(ctx context.Context, useCase string) ([]ai.WorkflowSuggestion, error)
- type ClientConfig
- type ToolDefinition
Constants ¶
This section is empty.
Variables ¶
var BuiltinModuleTypes = map[string]string{
"http.server": "HTTP server with address config",
"http.router": "HTTP router, depends on server",
"http.handler": "Generic HTTP handler with contentType",
"api.handler": "REST API handler with resourceName",
"http.middleware.auth": "Authentication middleware",
"http.middleware.logging": "Logging middleware with logLevel",
"http.middleware.ratelimit": "Rate limiter with requestsPerMinute and burstSize",
"http.middleware.cors": "CORS middleware with allowedOrigins and allowedMethods",
"messaging.broker": "In-memory message broker",
"messaging.handler": "Message subscription handler",
"statemachine.engine": "State machine engine",
"state.tracker": "State tracker for resources",
"state.connector": "Connects state machines to resources",
"event.processor": "Complex event pattern processor",
"httpserver.modular": "Modular HTTP server",
"httpclient.modular": "Modular HTTP client",
"chimux.router": "Chi-based HTTP router",
"scheduler.modular": "Cron-based scheduler",
"eventbus.modular": "Event bus pub/sub",
"eventlogger.modular": "Event logger",
"cache.modular": "Cache module",
"database.modular": "Database module",
"auth.modular": "Auth module",
"jsonschema.modular": "JSON schema validation",
"reverseproxy": "Reverse proxy",
"http.proxy": "Reverse proxy (alias)",
}
BuiltinModuleTypes returns the list of available module types and their descriptions.
Functions ¶
func ExtractCode ¶
ExtractCode strips markdown code fences from generated Go code.
func ExtractJSON ¶
ExtractJSON finds the first JSON object or array in text.
func HandleToolCall ¶
func HandleToolCall(name string, input json.RawMessage) (string, error)
HandleToolCall executes a tool call and returns the result as a string.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements ai.WorkflowGenerator using the Anthropic Claude API.
func NewClient ¶
func NewClient(cfg ClientConfig) (*Client, error)
NewClient creates a new Anthropic LLM client.
func (*Client) GenerateComponent ¶
GenerateComponent generates Go source code for a component specification.
func (*Client) GenerateWorkflow ¶
func (c *Client) GenerateWorkflow(ctx context.Context, req ai.GenerateRequest) (*ai.GenerateResponse, error)
GenerateWorkflow creates a workflow config from a natural language request.
func (*Client) IdentifyMissingComponents ¶
func (c *Client) IdentifyMissingComponents(ctx context.Context, cfg *config.WorkflowConfig) ([]ai.ComponentSpec, error)
IdentifyMissingComponents analyzes a config for non-built-in module types.
func (*Client) SuggestWorkflow ¶
func (c *Client) SuggestWorkflow(ctx context.Context, useCase string) ([]ai.WorkflowSuggestion, error)
SuggestWorkflow returns workflow suggestions for a use case.
type ClientConfig ¶
type ClientConfig struct {
APIKey string // Defaults to ANTHROPIC_API_KEY env var
Model string // Defaults to claude-sonnet-4-20250514
BaseURL string // Defaults to https://api.anthropic.com
}
ClientConfig holds configuration for the Anthropic LLM client.