Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Document ¶
type Document struct {
Content string // The document text/chunk content
SourcePath string // File path or document identifier
Metadata map[string]string // Custom metadata (e.g., date, author, type, tags)
ChunkIndex int // Position of this chunk within the source document (0-based)
}
Document represents a document for reranking with content and metadata This is a generic structure that can be used across the RAG system
type Event ¶
type Event struct {
Type EventTye
StrategyName string // Name of the component emitting the event (strategy name, "reranker", "fusion", etc.)
Message string
Progress *Progress
Error error
TotalTokens int64 // For usage events
Cost float64 // For usage events
}
Event represents a RAG operation lifecycle event. This is the canonical RAG event type used by strategies, reranking, fusion, the RAG manager, and the runtime.
type EventCallback ¶ added in v1.83.0
type EventCallback func(event Event)
EventCallback receives RAG manager events during initialization.
type EventForwarder ¶ added in v1.83.0
type EventForwarder interface {
// Name returns the toolset's user-facing name.
Name() string
// SetEventCallback registers the callback; must be called before Start.
SetEventCallback(callback EventCallback)
}
EventForwarder is implemented by RAG toolsets that can stream lifecycle events (indexing progress, usage, errors) to a callback. The runtime type-asserts to this interface to wire event forwarding without importing the concrete rag toolset package — which keeps the cgo tree-sitter dependency out of the runtime's import graph.