Documentation
¶
Overview ¶
Package rewriter implements LLM-based query rewriting strategy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LLMRewriter ¶
type LLMRewriter struct {
// contains filtered or unexported fields
}
LLMRewriter — встроенная LLM-стратегия переписывания запросов.
Использует LLMProvider для генерации переформулировки. По умолчанию работает в режиме 1:1; для multi-query используйте кастомный prompt, который возвращает несколько строк (по одной переформулировке на строку).
func NewLLMRewriter ¶
func NewLLMRewriter(llm domain.LLMProvider, promptTemplate string) (*LLMRewriter, error)
NewLLMRewriter создаёт LLMRewriter. llm — обязательный LLMProvider. promptTemplate — опциональный system prompt (пустая строка = дефолтный).
func (*LLMRewriter) Rewrite ¶
func (r *LLMRewriter) Rewrite(ctx context.Context, query string, history domain.QueryHistory) ([]domain.RewrittenQuery, error)
@sk-task query-rewriting#T3.3: LLMRewriter.Rewrite (AC-006) Rewrite переписывает запрос через LLM с учётом истории диалога.
Click to show internal directories.
Click to hide internal directories.