ask

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package ask provides RAG-based Q&A functionality for repositories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AskOptions

type AskOptions struct {
	Question          string
	Repo              string // optional full_name filter
	Limit             int    // default 10
	DB                *sql.DB
	EmbeddingProvider provider.EmbeddingProvider
	LLMProvider       provider.LLMProvider
}

AskOptions configures the Q&A query.

type AskResult

type AskResult struct {
	Answer       string
	Sources      []SourceAttribution
	Question     string
	InputTokens  int
	OutputTokens int
	DurationMs   int64
}

AskResult contains the Q&A result.

func AskQuestion

func AskQuestion(ctx context.Context, opts AskOptions, onChunk func(string)) (AskResult, error)

AskQuestion performs RAG-based Q&A on repositories.

type SourceAttribution

type SourceAttribution struct {
	RepoFullName string
	ChunkType    string
	Similarity   float64
}

SourceAttribution represents a source used in the answer.

Jump to

Keyboard shortcuts

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