yaml

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 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 added in v1.1.3

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 added in v1.1.3

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

LoadFragment loads a fragment by name and optional path

func (*PromptRepository) SavePrompt added in v1.1.3

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

SavePrompt saves a prompt configuration (not yet implemented)

type ToolRepository added in v1.1.3

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 added in v1.1.3

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

ListTools returns all available tool names

func (*ToolRepository) LoadDirectory added in v1.1.3

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

LoadDirectory recursively loads all YAML tool files from a directory

func (*ToolRepository) LoadTool added in v1.1.3

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

LoadTool loads a tool descriptor by name

func (*ToolRepository) LoadToolFromFile added in v1.1.3

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

LoadToolFromFile loads a tool from a YAML file and registers it

func (*ToolRepository) RegisterTool added in v1.1.3

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

RegisterTool adds a tool descriptor directly to the repository

func (*ToolRepository) SaveTool added in v1.1.3

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

SaveTool saves a tool descriptor (not yet implemented)

Jump to

Keyboard shortcuts

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