Documentation
¶
Index ¶
- Constants
- func CombineStreams(stdout, stderr string) string
- func SanitizeFileName(value string) string
- type Engine
- func (e *Engine) Execute(ctx context.Context, inv Invocation, passthrough bool) (Result, error)
- func (e *Engine) ExecuteStreaming(ctx context.Context, inv Invocation, passthrough bool, ...) (Result, error)
- func (e *Engine) Explain(inv Invocation) Profile
- func (e *Engine) ExplainDecisions(inv Invocation) []ExplainDecision
- func (e *Engine) ExplainPreferences(inv Invocation) (Invocation, []PreferenceDecision)
- func (e *Engine) Profiles() []Profile
- type Execution
- type ExplainDecision
- type FastPathDecision
- type Invocation
- type OutputBudget
- type PartialResult
- type PreferenceDecision
- type Profile
- type RenderedExecution
- type Result
- type StreamReducer
- type StreamReducerDone
- type StreamReducerPreview
- type StreamRenderFactory
Constants ¶
View Source
const ( ConfidenceHigh = "high" ConfidenceMedium = "medium" ConfidenceLow = "low" )
View Source
const ( SourceBuiltin = "built-in" SourceProject = "project-local" SourcePreference = "project-preference" SourceFallback = "fallback" )
View Source
const ( StreamAuto = "auto" StreamStdoutOnly = "stdout-only" StreamStderrOnly = "stderr-only" StreamStdoutFirst = "stdout-first" StreamStderrFirst = "stderr-first" )
Variables ¶
This section is empty.
Functions ¶
func CombineStreams ¶
func SanitizeFileName ¶
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) ExecuteStreaming ¶
func (e *Engine) ExecuteStreaming( ctx context.Context, inv Invocation, passthrough bool, onPartial func(PartialResult), ) (Result, error)
func (*Engine) Explain ¶
func (e *Engine) Explain(inv Invocation) Profile
func (*Engine) ExplainDecisions ¶
func (e *Engine) ExplainDecisions(inv Invocation) []ExplainDecision
func (*Engine) ExplainPreferences ¶
func (e *Engine) ExplainPreferences(inv Invocation) (Invocation, []PreferenceDecision)
type ExplainDecision ¶
type FastPathDecision ¶
func DecideFastPath ¶
type Invocation ¶
type OutputBudget ¶
type OutputBudget struct {
MaxLines int
MaxBytes int
MaxTokens int
MinFailures int
MinAnchors int
MinHints int
}
func ExpandBudgetForFailureEscape ¶
func ExpandBudgetForFailureEscape(budget OutputBudget, inv Invocation) OutputBudget
func ResolveBudget ¶
func ResolveBudget(profile Profile, inv Invocation, fallbackLines int) OutputBudget
type PartialResult ¶
type PreferenceDecision ¶
type Profile ¶
type Profile struct {
Name string
Description string
Source string
Confidence string
StreamPreference string
Budget OutputBudget
LatencyBudget time.Duration
Match func(Invocation) bool
Prepare func(Invocation) []string
Render func(Invocation, Execution) string
StreamRender StreamRenderFactory
ParseBytes func(Execution) int
Explain []string
}
type RenderedExecution ¶
type RenderedExecution struct {
Text string
RawCombined string
BytesParsed int
BytesEmitted int
RawTokens int
FilteredTokens int
FallbackUsed bool
}
func RenderExecution ¶
func RenderExecution(profile Profile, inv Invocation, exec Execution, fallbackLines int, passthrough bool) RenderedExecution
type StreamReducer ¶
type StreamReducerDone ¶
type StreamReducerDone interface {
Done() bool
}
type StreamReducerPreview ¶
type StreamReducerPreview interface {
Preview() string
}
type StreamRenderFactory ¶
type StreamRenderFactory func(Invocation, OutputBudget) StreamReducer
Click to show internal directories.
Click to hide internal directories.