tool

package
v1.0.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadTools

func LoadTools(defs []Def, workDir string, logger *zap.Logger) ([]fantasy.AgentTool, error)

Types

type Def

type Def struct {
	Name        string
	Description string
	Binary      string
	Args        []string
	Doc         string
}

type Input

type Input struct {
	Args  []string `` /* 138-byte string literal not displayed */
	Stdin string   `` /* 174-byte string literal not displayed */
}

Input is the BIN tool call shape exposed to the LLM. Fantasy reflects this struct into a JSON schema, so the model sees `args` and `stdin` as named fields and picks whichever the tool needs.

Both fields are optional. Tools that take only argv use `args` and ignore `stdin`; tools whose meaningful input flows over stdin (`yaegi run -`, `pandoc`, `markitdown`, …) use `stdin` (often alongside a small `args` like `["run", "-"]`). At least one of them is required — empty calls are rejected so the model gets immediate feedback rather than the binary's own help text.

Jump to

Keyboard shortcuts

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