Documentation
¶
Index ¶
- func DefaultModel(model string) string
- func FileOutputName(guideName string) string
- func NewProvider(ctx context.Context, model string, apiKey string, progressOut io.Writer) (service.LLMProvider, error)
- func ResolveAPIKey(model string) (string, error)
- type AnthropicProvider
- type GeminiProvider
- type PromptBuilder
- func (b *PromptBuilder) BuildClaudeWorkflowSystemPrompt(workflowName, locale, projectContext string) string
- func (b *PromptBuilder) BuildPersonalizedSkillsSystemPrompt(skillName, target, locale, projectContext string) string
- func (b *PromptBuilder) BuildPersonalizedWorkflowsSystemPrompt(workflowName, locale, projectContext string) string
- func (b *PromptBuilder) BuildSkillsUserMessage(guide service.TemplateGuide, target string) string
- func (b *PromptBuilder) BuildSpecSystemPrompt(existingContext string, locale string) string
- func (b *PromptBuilder) BuildSystemPromptForFile(guideName string, locale string) string
- func (b *PromptBuilder) BuildUserMessageForFile(req service.GenerationRequest, guide service.TemplateGuide) string
- func (b *PromptBuilder) BuildWorkflowsUserMessage(guide service.TemplateGuide, target string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultModel ¶
DefaultModel returns the default model name for the given provider. When model is empty, auto-detects based on available API keys.
func FileOutputName ¶
FileOutputName returns the output file name for a given template guide name.
func NewProvider ¶
func NewProvider(ctx context.Context, model string, apiKey string, progressOut io.Writer) (service.LLMProvider, error)
NewProvider creates the appropriate LLMProvider based on the model name. If model starts with "gemini-", uses Google Gemini. If model starts with "claude-" or is explicitly set, uses Anthropic. If model is empty, auto-detects provider from the API key.
func ResolveAPIKey ¶
ResolveAPIKey returns the API key for the given model from the appropriate env var. For Gemini models, checks GEMINI_API_KEY then GOOGLE_API_KEY. For Anthropic models, checks ANTHROPIC_API_KEY. When no model is specified (empty string), tries Anthropic first, then Gemini.
Types ¶
type AnthropicProvider ¶
type AnthropicProvider struct {
// contains filtered or unexported fields
}
AnthropicProvider implements service.LLMProvider using the Anthropic Claude API.
func NewAnthropicProvider ¶
func NewAnthropicProvider(apiKey string, model string, progressOut io.Writer) *AnthropicProvider
NewAnthropicProvider creates a new AnthropicProvider. If apiKey is empty, the SDK will use the ANTHROPIC_API_KEY env var. If model is empty, defaults to claude-sonnet-4-6. If progressOut is non-nil, progress messages will be written to it.
func (*AnthropicProvider) GenerateContext ¶
func (p *AnthropicProvider) GenerateContext(ctx context.Context, req service.GenerationRequest) (*service.GenerationResponse, error)
GenerateContext generates all context files by making one API call per file. This avoids JSON truncation issues and provides per-file progress.
type GeminiProvider ¶
type GeminiProvider struct {
// contains filtered or unexported fields
}
GeminiProvider implements service.LLMProvider using the Google Gemini API.
func NewGeminiProvider ¶
func NewGeminiProvider(ctx context.Context, apiKey string, model string, progressOut io.Writer) (*GeminiProvider, error)
NewGeminiProvider creates a new GeminiProvider. If apiKey is empty, the SDK will use the GEMINI_API_KEY or GOOGLE_API_KEY env var. If model is empty, defaults to gemini-3.1-pro-preview. If progressOut is non-nil, progress messages will be written to it.
func (*GeminiProvider) GenerateContext ¶
func (p *GeminiProvider) GenerateContext(ctx context.Context, req service.GenerationRequest) (*service.GenerationResponse, error)
GenerateContext generates all context files by making one API call per file.
type PromptBuilder ¶
type PromptBuilder struct{}
PromptBuilder constructs prompts for the LLM from templates and project description.
func NewPromptBuilder ¶
func NewPromptBuilder() *PromptBuilder
NewPromptBuilder creates a new PromptBuilder.
func (*PromptBuilder) BuildClaudeWorkflowSystemPrompt ¶ added in v1.14.0
func (b *PromptBuilder) BuildClaudeWorkflowSystemPrompt(workflowName, locale, projectContext string) string
BuildClaudeWorkflowSystemPrompt returns a system prompt for generating Claude Code workflow skills. Translates Antigravity execution annotations to prose instructions for Claude's SKILL.md format.
func (*PromptBuilder) BuildPersonalizedSkillsSystemPrompt ¶ added in v1.10.0
func (b *PromptBuilder) BuildPersonalizedSkillsSystemPrompt(skillName, target, locale, projectContext string) string
BuildPersonalizedSkillsSystemPrompt returns a system prompt for generating personalized Agent Skills. Unlike the generic version, this prompt instructs the LLM to adapt the skill to the user's project.
func (*PromptBuilder) BuildPersonalizedWorkflowsSystemPrompt ¶ added in v1.13.0
func (b *PromptBuilder) BuildPersonalizedWorkflowsSystemPrompt(workflowName, locale, projectContext string) string
BuildPersonalizedWorkflowsSystemPrompt returns a system prompt for generating personalized Antigravity workflows.
func (*PromptBuilder) BuildSkillsUserMessage ¶
func (b *PromptBuilder) BuildSkillsUserMessage(guide service.TemplateGuide, target string) string
BuildSkillsUserMessage constructs the user message for generating a single skill.
func (*PromptBuilder) BuildSpecSystemPrompt ¶
func (b *PromptBuilder) BuildSpecSystemPrompt(existingContext string, locale string) string
BuildSpecSystemPrompt returns a system prompt for generating spec files from existing context.
func (*PromptBuilder) BuildSystemPromptForFile ¶
func (b *PromptBuilder) BuildSystemPromptForFile(guideName string, locale string) string
BuildSystemPromptForFile returns a system prompt for generating a single context file.
func (*PromptBuilder) BuildUserMessageForFile ¶
func (b *PromptBuilder) BuildUserMessageForFile(req service.GenerationRequest, guide service.TemplateGuide) string
BuildUserMessageForFile constructs the user message for generating a single file.
func (*PromptBuilder) BuildWorkflowsUserMessage ¶ added in v1.13.0
func (b *PromptBuilder) BuildWorkflowsUserMessage(guide service.TemplateGuide, target string) string
BuildWorkflowsUserMessage constructs the user message for generating a single workflow.