Documentation
¶
Index ¶
Constants ¶
View Source
const ( // RRFK is the damping factor for Reciprocal Rank Fusion // A value of 60 is commonly used in information retrieval RRFK = 60 )
RRF constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdaptiveRetriever ¶
type AdaptiveRetriever struct {
// contains filtered or unexported fields
}
AdaptiveRetriever 自适应检索器 根据查询复杂度和结果质量动态调整检索策略
func NewAdaptiveRetriever ¶
func NewAdaptiveRetriever( st *store.Store, embeddingService ai.EmbeddingService, rerankerService ai.RerankerService, ) *AdaptiveRetriever
NewAdaptiveRetriever 创建自适应检索器
func (*AdaptiveRetriever) Retrieve ¶
func (r *AdaptiveRetriever) Retrieve(ctx context.Context, opts *RetrievalOptions) ([]*SearchResult, error)
Retrieve 自适应检索主入口
type QualityLevel ¶
type QualityLevel int
QualityLevel 结果质量等级
const ( LowQuality QualityLevel = iota MediumQuality HighQuality )
type RetrievalOptions ¶
type RetrievalOptions struct {
Query string
UserID int32
Strategy string
TimeRange *queryengine.TimeRange
MinScore float32
Limit int
RequestID string // 请求追踪 ID
Logger *slog.Logger // 结构化日志记录器
ScheduleQueryMode queryengine.ScheduleQueryMode // P1: 日程查询模式
}
RetrievalOptions 检索选项
Click to show internal directories.
Click to hide internal directories.