Documentation
¶
Index ¶
- Constants
- func ContextCallStack(ctx context.Context, jobName string, jobSize, stepID int) context.Context
- func ContextForEach(ctx context.Context, jobName string, index, total int) context.Context
- func ContextRouter(ctx context.Context, jobName string) context.Context
- func WithReporter(ctx context.Context, reporter *Reporter) context.Context
- func WithStepInfo(ctx context.Context, info StepInfo) context.Context
- type ProfileTokenUsage
- type ProgressBar
- type Reporter
- func (r *Reporter) BatchComplete()
- func (r *Reporter) BatchProgress(processed, total int)
- func (r *Reporter) BatchStart(inputPath, outputPath string, mutable bool)
- func (r *Reporter) ChunkingStart(strategy string, chunkCount int)
- func (r *Reporter) DocumentComplete(path string, duration time.Duration)
- func (r *Reporter) DocumentError(path string, err error)
- func (r *Reporter) DocumentSkipped(path string, reason string)
- func (r *Reporter) DocumentStart(path string, sizeKB float64)
- func (r *Reporter) ForeachComplete(successCount, totalCount int, duration time.Duration)
- func (r *Reporter) ForeachItem(index, total int, status string)
- func (r *Reporter) ForeachStart(itemCount int)
- func (r *Reporter) GetStats() Stats
- func (r *Reporter) RetryAttempt(attempt, maxAttempts int, delay time.Duration)
- func (r *Reporter) RetryExhausted(maxAttempts int)
- func (r *Reporter) RetrySuccess(attempt int)
- func (r *Reporter) RouterDefault(targetJob string)
- func (r *Reporter) RouterEvaluating()
- func (r *Reporter) RouterMatched(routeName string, targetJob string)
- func (r *Reporter) RouterNoMatch()
- func (r *Reporter) SetForeachMode(inForeach bool)
- func (r *Reporter) SetTokenSource(source TokenSource)
- func (r *Reporter) StepComplete(jobName, stepName string, stepNum, totalSteps int, duration time.Duration, ...)
- func (r *Reporter) StepError(jobName, stepName string, stepNum, totalSteps int, err error)
- func (r *Reporter) StepProgress(message string)
- func (r *Reporter) StepSkipped(jobName, stepName string, stepNum, totalSteps int, reason string)
- func (r *Reporter) StepStart(jobName, stepName string, stepNum, totalSteps int)
- func (r *Reporter) Summary()
- func (r *Reporter) SummaryQuick(docCount int, duration time.Duration)
- func (r *Reporter) ThinkingContent(text string)
- func (r *Reporter) UpdateTokens(inputTokens, outputTokens int)
- func (r *Reporter) WorkflowCompiled(name string, jobCount, stepCount int)
- func (r *Reporter) WorkflowError(err error)
- func (r *Reporter) WorkflowLoading(path string)
- type Silent
- func (s *Silent) BatchComplete()
- func (s *Silent) BatchProgress(processed, total int)
- func (s *Silent) BatchStart(inputPath, outputPath string, mutable bool)
- func (s *Silent) ChunkingStart(strategy string, chunkCount int)
- func (s *Silent) DocumentComplete(path string, duration time.Duration)
- func (s *Silent) DocumentError(path string, err error)
- func (s *Silent) DocumentSkipped(path string, reason string)
- func (s *Silent) DocumentStart(path string, sizeKB float64)
- func (s *Silent) ForeachComplete(successCount, totalCount int, duration time.Duration)
- func (s *Silent) ForeachItem(index, total int, status string)
- func (s *Silent) ForeachStart(itemCount int)
- func (s *Silent) GetStats() Stats
- func (s *Silent) RetryAttempt(attempt, maxAttempts int, delay time.Duration)
- func (s *Silent) RetryExhausted(maxAttempts int)
- func (s *Silent) RetrySuccess(attempt int)
- func (s *Silent) RouterDefault(targetJob string)
- func (s *Silent) RouterEvaluating()
- func (s *Silent) RouterMatched(routeName string, targetJob string)
- func (s *Silent) RouterNoMatch()
- func (s *Silent) SetForeachMode(inForeach bool)
- func (s *Silent) SetTokenSource(source TokenSource)
- func (s *Silent) StepComplete(jobName, stepName string, stepNum, totalSteps int, duration time.Duration, ...)
- func (s *Silent) StepError(jobName, stepName string, stepNum, totalSteps int, err error)
- func (s *Silent) StepProgress(message string)
- func (s *Silent) StepSkipped(jobName, stepName string, stepNum, totalSteps int, reason string)
- func (s *Silent) StepStart(jobName, stepName string, stepNum, totalSteps int)
- func (s *Silent) Summary()
- func (s *Silent) SummaryQuick(docCount int, duration time.Duration)
- func (s *Silent) ThinkingContent(text string)
- func (s *Silent) UpdateTokens(inputTokens, outputTokens int)
- func (s *Silent) WorkflowCompiled(name string, jobCount, stepCount int)
- func (s *Silent) WorkflowError(err error)
- func (s *Silent) WorkflowLoading(path string)
- type Stats
- type StepInfo
- type TokenSource
- type TokenUsage
Constants ¶
const ( IconWorkflowLoad = "📋" // Loading workflow file IconWorkflowCompiled = "✅" // Workflow successfully compiled IconWorkflowError = "❌" // Workflow error IconDocumentStart = "📄" // Document processing started IconDocumentComplete = "✅" // Document processed successfully IconDocumentError = "❌" // Document processing error IconDocumentSkipped = "⏭️" // Document skipped IconStepProcessing = "⚙️ " // Step is processing (mutable line) IconStepComplete = "✅" // Step completed successfully IconStepError = "❌" // Step failed with error IconRouterEvaluating = "🧭" // Router evaluating conditions IconRouterMatched = "↳" // Router matched a route (text, not emoji) IconForeachStart = "🔁" // Foreach loop started IconForeachItem = "✅" // Foreach item completed IconRetryAttempt = "🔄" // Retry attempt IconRetrySuccess = "✅" // Retry succeeded IconRetryExhausted = "❌" // All retries exhausted IconBatchProcessing = "📂" // Batch processing IconChunking = "✂️" // Document chunking IconThinking = "💭" // LLM thinking/reasoning content IconSummary = "📊" // Pipeline summary IconWarning = "⚠️" // Warning message )
Icons used for progress reporting - centralized for easy customization
Variables ¶
This section is empty.
Functions ¶
func ContextCallStack ¶ added in v0.2.0
func ContextForEach ¶ added in v0.2.0
func ContextRouter ¶ added in v0.2.0
func WithReporter ¶
WithReporter embeds a progress reporter in the context
Types ¶
type ProfileTokenUsage ¶
type ProfileTokenUsage struct {
Name string
Usage TokenUsage
}
ProfileTokenUsage represents token usage for a specific profile
type ProgressBar ¶ added in v0.2.0
type ProgressBar interface {
// Token source management
SetTokenSource(source TokenSource)
SetForeachMode(inForeach bool)
// Workflow lifecycle events
WorkflowLoading(path string)
WorkflowCompiled(name string, jobCount, stepCount int)
WorkflowError(err error)
// Document processing events
DocumentStart(path string, sizeKB float64)
DocumentComplete(path string, duration time.Duration)
DocumentError(path string, err error)
DocumentSkipped(path string, reason string)
// Step execution events
StepStart(jobName, stepName string, stepNum, totalSteps int)
StepProgress(message string)
StepComplete(jobName, stepName string, stepNum, totalSteps int, duration time.Duration, tokens int)
StepSkipped(jobName, stepName string, stepNum, totalSteps int, reason string)
StepError(jobName, stepName string, stepNum, totalSteps int, err error)
// Router and control flow events
RouterEvaluating()
RouterMatched(routeName string, targetJob string)
RouterDefault(targetJob string)
RouterNoMatch()
// Foreach iteration events
ForeachStart(itemCount int)
ForeachItem(index, total int, status string)
ForeachComplete(successCount, totalCount int, duration time.Duration)
// Retry and recovery events
RetryAttempt(attempt, maxAttempts int, delay time.Duration)
RetrySuccess(attempt int)
RetryExhausted(maxAttempts int)
// LLM thinking events
ThinkingContent(text string)
// Batch processing events
BatchStart(inputPath, outputPath string, mutable bool)
BatchProgress(processed, total int)
BatchComplete()
// Chunking events
ChunkingStart(strategy string, chunkCount int)
// Summary and statistics
Summary()
SummaryQuick(docCount int, duration time.Duration)
UpdateTokens(inputTokens, outputTokens int)
GetStats() Stats
}
ProgressBar interface defines all progress reporting methods
func FromContext ¶
func FromContext(ctx context.Context) ProgressBar
FromContext extracts the progress reporter from context
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter handles all progress output to stderr with educational messages
func NewWithWriter ¶
NewWithWriter creates a reporter with a custom writer (for testing)
func (*Reporter) BatchComplete ¶
func (r *Reporter) BatchComplete()
BatchComplete finalizes batch progress
func (*Reporter) BatchProgress ¶
BatchProgress reports batch processing progress
func (*Reporter) BatchStart ¶
BatchStart indicates batch processing is starting
func (*Reporter) ChunkingStart ¶
ChunkingStart indicates document is being split
func (*Reporter) DocumentComplete ¶
DocumentComplete indicates successful document completion
func (*Reporter) DocumentError ¶
DocumentError reports a document processing error
func (*Reporter) DocumentSkipped ¶
DocumentSkipped indicates a document was skipped
func (*Reporter) DocumentStart ¶
DocumentStart indicates a document is starting to process
func (*Reporter) ForeachComplete ¶
ForeachComplete indicates foreach loop completed
func (*Reporter) ForeachItem ¶
ForeachItem reports progress on a foreach item
func (*Reporter) ForeachStart ¶
ForeachStart indicates foreach loop is starting
func (*Reporter) RetryAttempt ¶
RetryAttempt indicates a retry is being attempted
func (*Reporter) RetryExhausted ¶
RetryExhausted indicates all retry attempts failed
func (*Reporter) RetrySuccess ¶
RetrySuccess indicates retry succeeded
func (*Reporter) RouterDefault ¶
RouterDefault indicates router is using default route
func (*Reporter) RouterEvaluating ¶
func (r *Reporter) RouterEvaluating()
RouterEvaluating indicates router is evaluating conditions
func (*Reporter) RouterMatched ¶
RouterMatched indicates router matched a route
func (*Reporter) RouterNoMatch ¶
func (r *Reporter) RouterNoMatch()
RouterNoMatch indicates no route was matched
func (*Reporter) SetForeachMode ¶
SetForeachMode sets whether we're inside a foreach loop
func (*Reporter) SetTokenSource ¶
func (r *Reporter) SetTokenSource(source TokenSource)
SetTokenSource sets the token source for final usage reporting
func (*Reporter) StepComplete ¶
func (r *Reporter) StepComplete(jobName, stepName string, stepNum, totalSteps int, duration time.Duration, tokens int)
StepComplete indicates step completion
func (*Reporter) StepProgress ¶
StepProgress updates the current step status (mutable)
func (*Reporter) StepSkipped ¶ added in v0.1.16
StepSkipped indicates step was skipped (e.g., cache hit)
func (*Reporter) SummaryQuick ¶
SummaryQuick prints a compact one-line summary
func (*Reporter) ThinkingContent ¶
ThinkingContent displays LLM thinking/reasoning content This is used when --llm-think is enabled to show intermediate reasoning
func (*Reporter) UpdateTokens ¶
UpdateTokens updates token statistics
func (*Reporter) WorkflowCompiled ¶
WorkflowCompiled indicates successful workflow compilation
func (*Reporter) WorkflowError ¶
WorkflowError reports a workflow-level error
func (*Reporter) WorkflowLoading ¶
WorkflowLoading indicates workflow file is being loaded
type Silent ¶ added in v0.2.0
type Silent struct{}
Silent is a no-op implementation of ProgressBar that does nothing
func NewSilent ¶ added in v0.2.0
func NewSilent() *Silent
NewSilent creates a new silent progress reporter
func (*Silent) BatchComplete ¶ added in v0.2.0
func (s *Silent) BatchComplete()
BatchComplete does nothing
func (*Silent) BatchProgress ¶ added in v0.2.0
BatchProgress does nothing
func (*Silent) BatchStart ¶ added in v0.2.0
BatchStart does nothing
func (*Silent) ChunkingStart ¶ added in v0.2.0
ChunkingStart does nothing
func (*Silent) DocumentComplete ¶ added in v0.2.0
DocumentComplete does nothing
func (*Silent) DocumentError ¶ added in v0.2.0
DocumentError does nothing
func (*Silent) DocumentSkipped ¶ added in v0.2.0
DocumentSkipped does nothing
func (*Silent) DocumentStart ¶ added in v0.2.0
DocumentStart does nothing
func (*Silent) ForeachComplete ¶ added in v0.2.0
ForeachComplete does nothing
func (*Silent) ForeachItem ¶ added in v0.2.0
ForeachItem does nothing
func (*Silent) ForeachStart ¶ added in v0.2.0
ForeachStart does nothing
func (*Silent) RetryAttempt ¶ added in v0.2.0
RetryAttempt does nothing
func (*Silent) RetryExhausted ¶ added in v0.2.0
RetryExhausted does nothing
func (*Silent) RetrySuccess ¶ added in v0.2.0
RetrySuccess does nothing
func (*Silent) RouterDefault ¶ added in v0.2.0
RouterDefault does nothing
func (*Silent) RouterEvaluating ¶ added in v0.2.0
func (s *Silent) RouterEvaluating()
RouterEvaluating does nothing
func (*Silent) RouterMatched ¶ added in v0.2.0
RouterMatched does nothing
func (*Silent) RouterNoMatch ¶ added in v0.2.0
func (s *Silent) RouterNoMatch()
RouterNoMatch does nothing
func (*Silent) SetForeachMode ¶ added in v0.2.0
SetForeachMode does nothing
func (*Silent) SetTokenSource ¶ added in v0.2.0
func (s *Silent) SetTokenSource(source TokenSource)
SetTokenSource does nothing
func (*Silent) StepComplete ¶ added in v0.2.0
func (s *Silent) StepComplete(jobName, stepName string, stepNum, totalSteps int, duration time.Duration, tokens int)
StepComplete does nothing
func (*Silent) StepProgress ¶ added in v0.2.0
StepProgress does nothing
func (*Silent) StepSkipped ¶ added in v0.2.0
StepSkipped does nothing
func (*Silent) SummaryQuick ¶ added in v0.2.0
SummaryQuick does nothing
func (*Silent) ThinkingContent ¶ added in v0.2.0
ThinkingContent does nothing
func (*Silent) UpdateTokens ¶ added in v0.2.0
UpdateTokens does nothing
func (*Silent) WorkflowCompiled ¶ added in v0.2.0
WorkflowCompiled does nothing
func (*Silent) WorkflowError ¶ added in v0.2.0
WorkflowError does nothing
func (*Silent) WorkflowLoading ¶ added in v0.2.0
WorkflowLoading does nothing
type Stats ¶
type Stats struct {
DocsProcessed int
DocsSkipped int
DocsErrors int
TokensInput int
TokensOutput int
Errors []error
}
Stats tracks processing metrics
type StepInfo ¶
type StepInfo struct {
// Nesting support for router and foreach
Parent *StepInfo // Link to parent step (for nested jobs)
JobName string
JobSize int
StepID int
StepName string
// Retry-specific fields
Attempt int
Delay int
// ForEach-specific fields
ItemIndex int // Current item (1-based), 0 = not in foreach
ItemTotal int // Total items, 0 = not in foreach
}
StepInfo carries information about the current step execution
func GetStepInfo ¶
GetStepInfo extracts step information from context
type TokenSource ¶
type TokenSource interface {
Usage() TokenUsage
ProfileUsage() []ProfileTokenUsage
}
TokenSource interface for accessing token usage from LLM routers
type TokenUsage ¶
TokenUsage represents token usage statistics