setup

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const BenchmarkToolPrefix = "benchmark_tool_"
View Source
const BenchmarkTreeSeed int64 = 42
View Source
const MockLLMModel = "benchmark-mock"
View Source
const RootAgentName = "benchmark-agent"

Variables

This section is empty.

Functions

func AppendMemoryOptions added in v0.2.2

func AppendMemoryOptions(cfg *Config, opts []agent.Option) ([]agent.Option, error)

AppendMemoryOptions adds WithMemory when memory is enabled in cfg.

func CloseAgents

func CloseAgents(agents []*agent.Agent)

func DefaultConfigPath

func DefaultConfigPath() string

DefaultConfigPath returns the default benchmark config file path.

func FindRepoRoot

func FindRepoRoot(from string) (string, error)

func MemoryAgentOption added in v0.2.2

func MemoryAgentOption(cfg *Config) (agent.Option, error)

MemoryAgentOption returns WithMemory when memory is enabled.

func RandomUserPrompt

func RandomUserPrompt(rng *rand.Rand) string

func RegisterBenchmarkTools

func RegisterBenchmarkTools(count int, cfg ToolConfig, rng *rand.Rand) agent.ToolRegistry

func RootOptions

func RootOptions(
	cfg *Config,
	llm interfaces.LLMClient,
	lgr logger.Logger,
	name, systemPrompt string,
	subAgents []*agent.Agent,
	taskQueue string,
) []agent.Option

RootOptions returns agent options shared by the benchmark root agent and root worker.

func RootSystemPrompt

func RootSystemPrompt(treeRng *rand.Rand) string

func RunRNG

func RunRNG() *rand.Rand

func SetupAgentLogger

func SetupAgentLogger(cfg *Config, repoRoot string) (logger.Logger, func(), error)

func SetupWorkerLogger

func SetupWorkerLogger(cfg *Config, repoRoot string, workerID int) (logger.Logger, func(), error)

func TaskQueueFor

func TaskQueueFor(cfg *Config, suffix string) string

func TreeRNG

func TreeRNG() *rand.Rand

Types

type AgentConfig

type AgentConfig struct {
	Runs            int              `yaml:"runs"`
	Concurrent      bool             `yaml:"concurrent"`
	ConcurrentCount int              `yaml:"concurrent_count"`
	Tools           AgentToolsConfig `yaml:"tools"`
	Subagents       SubagentsConfig  `yaml:"subagents"`
}

type AgentToolsConfig

type AgentToolsConfig struct {
	Count     int    `yaml:"count"`
	Execution string `yaml:"execution"`
}

type AgentTree

type AgentTree struct {
	RootPrompt string
	SubAgents  []*agent.Agent
	Created    []*agent.Agent
}

func BuildAgentTree

func BuildAgentTree(cfg *Config, llm interfaces.LLMClient, lgr logger.Logger) (*AgentTree, error)

type Config

type Config struct {
	Runtime  string         `yaml:"runtime"`
	Temporal TemporalConfig `yaml:"temporal"`
	Restate  RestateConfig  `yaml:"restate"`
	LLM      LLMConfig      `yaml:"llm"`
	Tool     ToolConfig     `yaml:"tool"`
	Agent    AgentConfig    `yaml:"agent"`
	Memory   MemoryConfig   `yaml:"memory"`
	Logger   LoggerConfig   `yaml:"logger"`
	Output   OutputConfig   `yaml:"output"`
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

func (*Config) ExternalWorkersEnabled

func (c *Config) ExternalWorkersEnabled() bool

func (*Config) LogDir

func (c *Config) LogDir(repoRoot string) string

func (*Config) MemoryEnabled added in v0.2.2

func (c *Config) MemoryEnabled() bool

MemoryEnabled reports whether long-term memory is wired for benchmark runs.

func (*Config) OutputDir

func (c *Config) OutputDir(repoRoot string) string

func (*Config) UseDurableRuntime added in v0.3.3

func (c *Config) UseDurableRuntime() bool

UseDurableRuntime reports whether Temporal or Restate is selected.

func (*Config) UseRestate added in v0.3.3

func (c *Config) UseRestate() bool

func (*Config) UseTemporal

func (c *Config) UseTemporal() bool

type LLMConfig

type LLMConfig struct {
	LatencyMs  int `yaml:"latency_ms"`
	JitterMs   int `yaml:"jitter_ms"`
	MockTokens int `yaml:"mock_tokens"`
}

type LLMStats

type LLMStats struct {
	TotalInputTokens  int
	TotalOutputTokens int
	// contains filtered or unexported fields
}

func NewLLMStats

func NewLLMStats() *LLMStats

func (*LLMStats) Snapshot

func (s *LLMStats) Snapshot() (input, output int)

type LoggerConfig

type LoggerConfig struct {
	Enabled bool   `yaml:"enabled"`
	Dir     string `yaml:"dir"`
	Level   string `yaml:"level"`
}

type MemoryConfig added in v0.2.2

type MemoryConfig struct {
	Enabled   bool   `yaml:"enabled"`
	StoreMode string `yaml:"store_mode"`
	UserID    string `yaml:"user_id"`
}

MemoryConfig configures long-term memory for benchmark runs.

type MockBenchmarkTool

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

func NewMockBenchmarkTool

func NewMockBenchmarkTool(index int, cfg ToolConfig, rng *rand.Rand) *MockBenchmarkTool

func (*MockBenchmarkTool) Description

func (t *MockBenchmarkTool) Description() string

func (*MockBenchmarkTool) DisplayName

func (t *MockBenchmarkTool) DisplayName() string

func (*MockBenchmarkTool) Execute

func (t *MockBenchmarkTool) Execute(ctx context.Context, args map[string]any) (any, error)

func (*MockBenchmarkTool) Name

func (t *MockBenchmarkTool) Name() string

func (*MockBenchmarkTool) Parameters

func (t *MockBenchmarkTool) Parameters() interfaces.JSONSchema

type MockLLMClient

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

func NewMockLLMClient

func NewMockLLMClient(cfg LLMConfig, stats *LLMStats, rng *rand.Rand) *MockLLMClient

func (*MockLLMClient) Generate

func (*MockLLMClient) GenerateStream

func (m *MockLLMClient) GenerateStream(ctx context.Context, request *interfaces.LLMRequest) (interfaces.LLMStream, error)

func (*MockLLMClient) GetModel

func (m *MockLLMClient) GetModel() string

func (*MockLLMClient) GetProvider

func (m *MockLLMClient) GetProvider() interfaces.LLMProvider

func (*MockLLMClient) IsStreamSupported

func (m *MockLLMClient) IsStreamSupported() bool

func (*MockLLMClient) Stats

func (m *MockLLMClient) Stats() *LLMStats

type OutputConfig

type OutputConfig struct {
	Console bool   `yaml:"console"`
	File    bool   `yaml:"file"`
	Dir     string `yaml:"dir"`
	Format  string `yaml:"format"`
}

type RestateConfig added in v0.3.3

type RestateConfig struct {
	IngressURL            string `yaml:"ingress_url"`
	AdminURL              string `yaml:"admin_url"`
	AuthKey               string `yaml:"auth_key"`
	EndpointListenAddress string `yaml:"endpoint_listen_address"`
	DeploymentURL         string `yaml:"deployment_url"`
}

RestateConfig configures Restate when runtime is restate.

type SubagentsConfig

type SubagentsConfig struct {
	Count  int `yaml:"count"`
	Levels int `yaml:"levels"`
}

type TemporalConfig

type TemporalConfig struct {
	Host         string `yaml:"host"`
	Port         int    `yaml:"port"`
	Namespace    string `yaml:"namespace"`
	TaskQueue    string `yaml:"task_queue"`
	WorkersCount int    `yaml:"workers_count"`
}

type ToolConfig

type ToolConfig struct {
	LatencyMs int `yaml:"latency_ms"`
	JitterMs  int `yaml:"jitter_ms"`
}

Jump to

Keyboard shortcuts

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