toolset

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package toolset adapts a fixed list of individual gollem.Tool values into the gollem.ToolSet (Specs/Run) contract.

gollem's type-safe constructor gollem.NewTool builds one gollem.Tool per handler, but Warren groups tools as a ToolSet: the planner selects tools by ToolSet ID and hands the whole group to a task agent. This adapter bridges the two so Warren can author type-safe tools with gollem.NewTool while still exposing the ToolSet grouping that interfaces.ToolSet requires, removing the hand-written Specs() literals and args[...] type assertions each tool used to carry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

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

Set is a gollem.ToolSet backed by a fixed list of gollem.Tool values. Run dispatches by tool name; Specs returns each tool's spec in registration order so the wire-level ordering stays stable across calls.

func New

func New(tools ...gollem.Tool) *Set

New builds a Set from the given tools. The tool list is fixed at construction time (static registration), so a duplicate tool name is a programming error and panics rather than silently shadowing a sibling — mirroring the MustNewTool convention used to build the tools passed in here.

func (*Set) Run

func (s *Set) Run(ctx context.Context, name string, args map[string]any) (map[string]any, error)

Run implements gollem.ToolSet.

func (*Set) Specs

func (s *Set) Specs(_ context.Context) ([]gollem.ToolSpec, error)

Specs implements gollem.ToolSet.

Jump to

Keyboard shortcuts

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