Quick Reference
Prompt Options
Model Configuration
ai.WithModel(model)ai.WithModelName(string)ai.WithConfig(any)
Prompt Content
ai.WithPrompt(string)- User prompt templateai.WithPromptFn(func)- Dynamic user promptai.WithSystem(string)- System instructionsai.WithSystemFn(func)- Dynamic system instructionsai.WithMessages([]*Message)- Conversation historyai.WithMessagesFn(func)- Dynamic messages
Input/Output
ai.WithInputType(T)- Input schema from typeai.WithInputSchema(map[string]any)- Custom input schemaai.WithOutputType(T)- Output schema from typeai.WithOutputSchema(map[string]any)- Custom output schemaai.WithOutputFormat(string)- Output format (json, text)
Tools
ai.WithTools(...Tool)- Enable toolsai.WithToolChoice(ToolChoice)- Control tool usageai.WithMaxTurns(int)- Max tool iterations