Documentation
¶
Index ¶
- func NewEntityExtractor(llm chat.Client, opts ...EntityExtractorOption) *entityExtractor
- func NewIntentRouter(llm chat.Client, opts ...IntentRouterOption) *intentRouter
- type Decomposer
- type DecomposerOption
- type EntityExtractorOption
- type HyDE
- type IntentRouterOption
- func WithDefaultIntent(intent core.IntentType) IntentRouterOption
- func WithIntentPromptTemplate(tmpl string) IntentRouterOption
- func WithIntentRouterCollector(collector observability.Collector) IntentRouterOption
- func WithIntentRouterLogger(logger logging.Logger) IntentRouterOption
- func WithMinConfidence(v float32) IntentRouterOption
- type Rewriter
- type StepBack
- type StepBackGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEntityExtractor ¶
func NewEntityExtractor(llm chat.Client, opts ...EntityExtractorOption) *entityExtractor
NewEntityExtractor creates a new entity extractor.
func NewIntentRouter ¶
func NewIntentRouter(llm chat.Client, opts ...IntentRouterOption) *intentRouter
NewIntentRouter creates a new intent router.
Types ¶
type Decomposer ¶
type Decomposer struct {
// contains filtered or unexported fields
}
Decomposer is the implementation of core.QueryDecomposer.
func NewDecomposer ¶
func NewDecomposer(llm chat.Client, opts ...DecomposerOption) *Decomposer
NewDecomposer creates a new query decomposer.
func (*Decomposer) Decompose ¶
func (d *Decomposer) Decompose(ctx context.Context, query *core.Query) (*core.DecompositionResult, error)
Decompose breaks down a complex query into simpler sub-queries.
type DecomposerOption ¶
type DecomposerOption func(*Decomposer)
DecomposerOption configures a Decomposer instance.
func WithDecomposerCollector ¶
func WithDecomposerCollector(collector observability.Collector) DecomposerOption
WithDecomposerCollector sets an observability collector.
func WithDecomposerLogger ¶
func WithDecomposerLogger(logger logging.Logger) DecomposerOption
WithDecomposerLogger sets a structured logger.
func WithDecompositionPromptTemplate ¶
func WithDecompositionPromptTemplate(tmpl string) DecomposerOption
WithDecompositionPromptTemplate overrides the default decomposition prompt.
func WithMaxSubQueries ¶
func WithMaxSubQueries(max int) DecomposerOption
WithMaxSubQueries sets the maximum number of sub-queries to generate.
type EntityExtractorOption ¶
type EntityExtractorOption func(*entityExtractor)
EntityExtractorOption configures an entityExtractor instance.
func WithEntityExtractionPromptTemplate ¶
func WithEntityExtractionPromptTemplate(tmpl string) EntityExtractorOption
WithEntityExtractionPromptTemplate overrides the default extraction prompt.
func WithEntityExtractorCollector ¶
func WithEntityExtractorCollector(collector observability.Collector) EntityExtractorOption
WithEntityExtractorCollector sets an observability collector.
func WithEntityExtractorLogger ¶
func WithEntityExtractorLogger(logger logging.Logger) EntityExtractorOption
WithEntityExtractorLogger sets a structured logger.
type HyDE ¶
type HyDE struct {
// contains filtered or unexported fields
}
HyDE generates hypothetical answers to improve search results.
type IntentRouterOption ¶
type IntentRouterOption func(*intentRouter)
IntentRouterOption configures an intentRouter instance.
func WithDefaultIntent ¶
func WithDefaultIntent(intent core.IntentType) IntentRouterOption
WithDefaultIntent sets the fallback intent when LLM confidence is low.
func WithIntentPromptTemplate ¶
func WithIntentPromptTemplate(tmpl string) IntentRouterOption
WithIntentPromptTemplate overrides the default intent classification prompt.
func WithIntentRouterCollector ¶
func WithIntentRouterCollector(collector observability.Collector) IntentRouterOption
WithIntentRouterCollector sets an observability collector.
func WithIntentRouterLogger ¶
func WithIntentRouterLogger(logger logging.Logger) IntentRouterOption
WithIntentRouterLogger sets a structured logger.
func WithMinConfidence ¶
func WithMinConfidence(v float32) IntentRouterOption
WithMinConfidence sets the minimum confidence threshold.
type Rewriter ¶
type Rewriter struct {
// contains filtered or unexported fields
}
Rewriter uses an LLM to rewrite and expand the user's query.
func NewRewriter ¶
NewRewriter creates a new query rewriter.
type StepBack ¶
type StepBack struct {
// contains filtered or unexported fields
}
StepBack abstracts queries into higher-level background questions.
func NewStepBack ¶
NewStepBack creates a new StepBack generator.