Documentation
¶
Overview ¶
Package reranker provides the Reranker agent that uses tool calls to select the most relevant topics from vector search candidates.
Index ¶
Constants ¶
const ( // ParamCandidates is the key for reranker candidates ([]Candidate). ParamCandidates = "candidates" // ParamPersonCandidates is the key for person candidates ([]PersonCandidate) (v0.5.1). ParamPersonCandidates = "person_candidates" // ParamContextualizedQuery is the key for enriched query (string). ParamContextualizedQuery = "contextualized_query" // ParamOriginalQuery is the key for original user query (string). ParamOriginalQuery = "original_query" // ParamCurrentMessages is the key for recent conversation (string). ParamCurrentMessages = "current_messages" // ParamMediaParts is the key for multimodal content ([]interface{}). ParamMediaParts = "media_parts" )
Request parameters for Reranker agent.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Candidate ¶
type Candidate struct {
TopicID int64
Score float32
Topic storage.Topic
MessageCount int
SizeChars int // Estimated: MessageCount * avgCharsPerMessage
}
Candidate is a topic candidate for reranking.
type MessageRepository ¶
type MessageRepository interface {
GetMessagesByTopicID(ctx context.Context, topicID int64) ([]storage.Message, error)
}
MessageRepository is the interface for loading topic messages.
type PersonCandidate ¶ added in v0.5.1
PersonCandidate is a person candidate for reranking (v0.5.1).
type PersonSelection ¶ added in v0.5.1
PersonSelection represents a selected person with explanation (v0.5.1).
type ReasoningEntry ¶
ReasoningEntry holds reasoning text for one iteration.
type Reranker ¶
type Reranker struct {
// contains filtered or unexported fields
}
Reranker uses tool calls to select the most relevant topics from vector search candidates.
func New ¶
func New( client openrouter.Client, cfg *config.Config, logger *slog.Logger, translator *i18n.Translator, msgRepo MessageRepository, agentLogger *agentlog.Logger, ) *Reranker
New creates a new Reranker agent.
func (*Reranker) Capabilities ¶
func (r *Reranker) Capabilities() agent.Capabilities
Capabilities returns the agent's capabilities.
func (*Reranker) Description ¶
Description returns a human-readable description.
type Result ¶
type Result struct {
Topics []TopicSelection // Final selected topics with reasons
People []PersonSelection // Final selected people with reasons (v0.5.1)
}
Result contains the output of the reranker.
type TopicSelection ¶
TopicSelection represents a selected topic with explanation.