Documentation
¶
Index ¶
- Constants
- func AskSystemPrompt(instructions string) string
- func AskUserPrompt(question string, files []input.FileContent, stdin string) string
- func HelpPrompt(command, shell string) string
- func ShouldUseLazyContext(files []input.FileContent, specs []EditSpec) bool
- func ShouldUseUnifiedDiff(model, diffFormat string) bool
- func StreamEditSystemPrompt(instructions string, specs []EditSpec, model, diffFormat string) string
- func StreamEditSystemPromptLazy(instructions string, specs []EditSpec, model, diffFormat string) string
- func StreamEditUserPrompt(request string, files []input.FileContent, specs []EditSpec, ...) string
- func StreamEditUserPromptLazy(request string, files []input.FileContent, specs []EditSpec, ...) string
- func SuggestSchema(numSuggestions int) map[string]interface{}
- func SuggestSystemPrompt(shell, instructions string, numSuggestions int, enableSearch bool) string
- func SuggestUserPrompt(userInput string, files []input.FileContent, stdin string) string
- type EditSpec
Constants ¶
const LazyContextPadding = 10
LazyContextPadding is the number of lines to show around the editable region.
const LazyContextThreshold = 100
LazyContextThreshold is the minimum file size (in lines) to use lazy context loading.
Variables ¶
This section is empty.
Functions ¶
func AskSystemPrompt ¶
AskSystemPrompt returns the system prompt for ask command. Returns empty string if no instructions configured (preserves current behavior).
func AskUserPrompt ¶ added in v0.0.4
func AskUserPrompt(question string, files []input.FileContent, stdin string) string
AskUserPrompt formats a question with optional file context
func HelpPrompt ¶
HelpPrompt returns the prompt for generating detailed command help
func ShouldUseLazyContext ¶ added in v0.0.11
func ShouldUseLazyContext(files []input.FileContent, specs []EditSpec) bool
ShouldUseLazyContext determines if lazy context loading should be used. Returns true if any guarded file exceeds the threshold.
func ShouldUseUnifiedDiff ¶ added in v0.0.10
ShouldUseUnifiedDiff determines if unified diff format should be used. diffFormat can be "auto", "udiff", or "replace".
func StreamEditSystemPrompt ¶ added in v0.0.10
StreamEditSystemPrompt builds a system prompt for streaming edit format. diffFormat: "auto", "udiff", or "replace"
func StreamEditSystemPromptLazy ¶ added in v0.0.11
func StreamEditSystemPromptLazy(instructions string, specs []EditSpec, model, diffFormat string) string
StreamEditSystemPromptLazy builds a system prompt for lazy context loading mode. This is similar to StreamEditSystemPrompt but adds info about the read_context tool.
func StreamEditUserPrompt ¶ added in v0.0.10
func StreamEditUserPrompt(request string, files []input.FileContent, specs []EditSpec, useUnifiedDiff bool) string
StreamEditUserPrompt builds the user prompt with file context. useUnifiedDiff determines which format instruction to include.
func StreamEditUserPromptLazy ¶ added in v0.0.11
func StreamEditUserPromptLazy(request string, files []input.FileContent, specs []EditSpec, useUnifiedDiff bool) string
StreamEditUserPromptLazy builds a user prompt with lazy context loading. For large guarded files, only the editable region + padding is included. The LLM can use read_context tool to fetch more if needed.
func SuggestSchema ¶
SuggestSchema returns the JSON schema for structured output
func SuggestSystemPrompt ¶
SuggestSystemPrompt returns the system prompt for command suggestions
func SuggestUserPrompt ¶
func SuggestUserPrompt(userInput string, files []input.FileContent, stdin string) string
SuggestUserPrompt formats the user's request with optional file context