agenttool

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package agenttool wraps an Agent as a Toolkit, allowing one agent to be invoked as a tool by another agent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentToolkit

type AgentToolkit struct {
	*toolkit.BaseToolkit
	// contains filtered or unexported fields
}

AgentToolkit wraps an Agent as a single-function toolkit. The registered function is named "ask_<agent_name>" and accepts an "input" string parameter. When invoked, it spawns the wrapped agent using agent.Spawn and returns its output content.

func New

func New(ag *agent.Agent, description string) *AgentToolkit

New creates a new AgentToolkit that wraps the given agent. The description is used as the tool function's description, helping the parent agent understand when to delegate to this agent. Panics if ag is nil.

Jump to

Keyboard shortcuts

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