yaml

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package yaml provides YAML file-based implementations of persistence repositories.

This package is primarily for Arena and development use, loading prompts and tools from YAML configuration files on disk.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PromptRepository

type PromptRepository struct {
	*common.BasePromptRepository
}

YAMLPromptRepository loads prompts from YAML files on disk

func NewYAMLPromptRepository

func NewYAMLPromptRepository(basePath string, taskTypeToFile map[string]string) *PromptRepository

NewYAMLPromptRepository creates a YAML file-based prompt repository If taskTypeToFile mappings are provided, they will be used for lookups. Otherwise, the repository will search the basePath directory.

func (*PromptRepository) LoadFragment

func (r *PromptRepository) LoadFragment(name, relativePath, baseDir string) (*prompt.Fragment, error)

LoadFragment loads a fragment by name and optional path

func (*PromptRepository) SavePrompt

func (r *PromptRepository) SavePrompt(config *prompt.Config) error

SavePrompt saves a prompt configuration to a YAML file

type ToolRepository

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

YAMLToolRepository loads tools from YAML files on disk

func NewYAMLToolRepository

func NewYAMLToolRepository(basePath string) *ToolRepository

NewYAMLToolRepository creates a YAML file-based tool repository

func (*ToolRepository) ListTools

func (r *ToolRepository) ListTools() ([]string, error)

ListTools returns all available tool names

func (*ToolRepository) LoadDirectory

func (r *ToolRepository) LoadDirectory(dirPath string) error

LoadDirectory recursively loads all YAML tool files from a directory

func (*ToolRepository) LoadTool

func (r *ToolRepository) LoadTool(name string) (*tools.ToolDescriptor, error)

LoadTool loads a tool descriptor by name

func (*ToolRepository) LoadToolFromFile

func (r *ToolRepository) LoadToolFromFile(filename string) error

LoadToolFromFile loads a tool from a YAML file and registers it

func (*ToolRepository) RegisterTool

func (r *ToolRepository) RegisterTool(name string, descriptor *tools.ToolDescriptor)

RegisterTool adds a tool descriptor directly to the repository

func (*ToolRepository) SaveTool

func (r *ToolRepository) SaveTool(descriptor *tools.ToolDescriptor) error

SaveTool saves a tool descriptor to a YAML file using K8s manifest format. The file will be named <tool-name>.yaml in the repository's base path.

Jump to

Keyboard shortcuts

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