config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config handles loading and parsing of simulation configurations and query files. It supports both YAML and JSON formats for flexibility.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigFile

type ConfigFile struct {
	Configs []SimConfig `json:"configs" yaml:"configs"`
}

ConfigFile represents the configs file structure.

type Needle added in v0.4.0

type Needle struct {
	Text       string `json:"text"`
	Source     string `json:"source,omitempty"`
	Difficulty string `json:"difficulty,omitempty"`
}

Needle represents a specific text span required to answer a query.

type QueriesFile

type QueriesFile struct {
	Queries []Query `json:"queries" yaml:"queries"`
}

QueriesFile represents the queries file structure.

type Query

type Query struct {
	ID           string   `json:"id" yaml:"id"`
	Text         string   `json:"text" yaml:"text"`
	RelevantDocs []string `json:"relevant_docs" yaml:"relevant_docs"`
	Notes        string   `json:"notes,omitempty" yaml:"notes,omitempty"`
	Needles      []Needle `json:"needles,omitempty" yaml:"needles,omitempty"`
}

Query represents a query with ground truth.

func LoadQueries

func LoadQueries(path string) ([]Query, error)

LoadQueries loads queries from a JSON file.

type SimConfig

type SimConfig struct {
	Name      string `json:"name" yaml:"name"`
	TopK      int    `json:"top_k" yaml:"top_k"`
	ChunkSize int    `json:"chunk_size,omitempty" yaml:"chunk_size,omitempty"`
	Overlap   int    `json:"overlap,omitempty" yaml:"overlap,omitempty"`
}

SimConfig represents a simulation configuration variant.

func LoadConfigs

func LoadConfigs(path string) ([]SimConfig, error)

LoadConfigs loads simulation configs from a YAML or JSON file.

Jump to

Keyboard shortcuts

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