rewriter

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

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 с учётом истории диалога.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL