Help us shape the future of Go! Take the 2026 Go Developer Survey

datatest

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeAnswerOnly = eval.ModeAnswerOnly
	ModeDebate     = eval.ModeDebate
	ModeBoth       = eval.ModeBoth
)

Variables

This section is empty.

Functions

func SaveQuestionBank

func SaveQuestionBank(path string, bank *QuestionBank) error

SaveQuestionBank persists the question bank.

Types

type Analysis

type Analysis = eval.Analysis

Question = qa.Question QuestionBank = qa.QuestionBank RunConfig = eval.RunConfig RunResult = eval.RunResult Analysis = eval.Analysis

type Option

type Option func(*Options)

Option configures Suite behavior.

func WithCacheDir

func WithCacheDir(dir string) Option

func WithChapterTarget

func WithChapterTarget(n int) Option

func WithChunkOverlap

func WithChunkOverlap(n int) Option

func WithChunkSize

func WithChunkSize(n int) Option

func WithEmbedder

func WithEmbedder(e embedding.Embedder) Option

func WithForceDownload

func WithForceDownload(force bool) Option

func WithLogger

func WithLogger(l *slog.Logger) Option

func WithMaxFetchBytes

func WithMaxFetchBytes(n int64) Option

func WithTopK

func WithTopK(k int) Option

type Options

type Options struct {
	Embedder      embedding.Embedder
	TopK          int
	ChunkSize     int
	ChunkOverlap  int
	CacheDir      string
	ForceDownload bool
	ChapterTarget int
	Logger        *slog.Logger
	ChunkMin      int
	MaxFetchBytes int64
}

type Question

type Question = qa.Question

Question = qa.Question QuestionBank = qa.QuestionBank RunConfig = eval.RunConfig RunResult = eval.RunResult Analysis = eval.Analysis

type QuestionBank

type QuestionBank = qa.QuestionBank

Question = qa.Question QuestionBank = qa.QuestionBank RunConfig = eval.RunConfig RunResult = eval.RunResult Analysis = eval.Analysis

func LoadQuestionBank

func LoadQuestionBank(path string) (*QuestionBank, error)

LoadQuestionBank loads a question bank.

type QuestionnaireConfig

type QuestionnaireConfig struct {
	Sources            []string
	PerChapter         int
	Total              int
	MaxChapters        int
	Options            int
	Difficulty         string
	Style              string
	IncludeExplanation bool
	MaxChapterChars    int
	Language           string
}

QuestionnaireConfig is the configuration for generating a questionnaire.

type RunConfig

type RunConfig = eval.RunConfig

Question = qa.Question QuestionBank = qa.QuestionBank RunConfig = eval.RunConfig RunResult = eval.RunResult Analysis = eval.Analysis

type RunMode

type RunMode = eval.Mode

Question = qa.Question QuestionBank = qa.QuestionBank RunConfig = eval.RunConfig RunResult = eval.RunResult Analysis = eval.Analysis

type RunResult

type RunResult = eval.RunResult

Question = qa.Question QuestionBank = qa.QuestionBank RunConfig = eval.RunConfig RunResult = eval.RunResult Analysis = eval.Analysis

type Suite

type Suite struct {
	// contains filtered or unexported fields
}

Suite ties corpus parsing, chunking, RAG indexing, agent creation, QA generation, evaluation, and reporting.

func New

func New(ctx context.Context, opts ...Option) *Suite

func (*Suite) AddAgent

func (s *Suite) AddAgent(ctx context.Context, name, systemPrompt string, sources []string, model model.BaseModel[*schema.Message], agentOpts ...adk.AgentOption) (*adk.ChatModelAgent, error)

AddAgent creates an adk.ChatModelAgent with a retrieval tool scoped to sources.

func (*Suite) AddSource

func (s *Suite) AddSource(name, pathOrURL string) error

AddSource ingests a source from a local file path or an http(s) URL. The source is parsed, chapter-segmented, chunked, and added to the in-memory corpus; the index is marked dirty for lazy rebuild.

func (*Suite) Agents

func (s *Suite) Agents() []adk.Agent

Agents returns all registered agents in order of registration.

func (*Suite) Analyze

func (s *Suite) Analyze(res *RunResult) *Analysis

Analyze computes analysis for a run result.

func (*Suite) GenerateQuestionnaire

func (s *Suite) GenerateQuestionnaire(ctx context.Context, qaModel model.BaseModel[*schema.Message], cfg *QuestionnaireConfig) (*QuestionBank, error)

GenerateQuestionnaire generates a question bank using the provided QA model.

func (*Suite) RegisterParser

func (s *Suite) RegisterParser(ext string, p corpus.Parser)

RegisterParser registers a custom corpus parser for an extension.

func (*Suite) Run

func (s *Suite) Run(ctx context.Context, bank *QuestionBank, cfg RunConfig) (*RunResult, error)

Run evaluates agents against a question bank.

func (*Suite) Sources

func (s *Suite) Sources() []*corpus.Source

Sources returns all parsed sources.

Jump to

Keyboard shortcuts

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