tools

package
v1.6.14 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LangChainToolAdapter

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

LangChainToolAdapter LangChain tool adapter

func NewLangChainToolAdapter

func NewLangChainToolAdapter(baseTool types.Tool) *LangChainToolAdapter

NewLangChainToolAdapter creates a new LangChain tool adapter

func (*LangChainToolAdapter) Call

func (a *LangChainToolAdapter) Call(ctx context.Context, input string) (string, error)

Call calls the tool (LangChain interface)

func (*LangChainToolAdapter) Description

func (a *LangChainToolAdapter) Description() string

Description returns the tool description

func (*LangChainToolAdapter) Name

func (a *LangChainToolAdapter) Name() string

Name returns the tool name

type Manager

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

Manager tool manager

func NewManager

func NewManager() *Manager

NewManager creates a new tool manager

func (*Manager) Clear

func (m *Manager) Clear()

Clear clears all tools

func (*Manager) Get

func (m *Manager) Get(name string) (types.Tool, error)

Get gets a tool

func (*Manager) GetAll

func (m *Manager) GetAll() []types.Tool

GetAll gets all tools

func (*Manager) GetAllToolInfo

func (m *Manager) GetAllToolInfo() []ToolInfo

GetAllToolInfo gets all tool information

func (*Manager) GetByType

func (m *Manager) GetByType(toolType string) []types.Tool

GetByType gets tools by type

func (*Manager) GetToolInfo

func (m *Manager) GetToolInfo(name string) (*ToolInfo, error)

GetToolInfo gets tool information

func (*Manager) Register

func (m *Manager) Register(tool types.Tool) error

Register registers a tool

func (*Manager) RegisterMultiple

func (m *Manager) RegisterMultiple(tools []types.Tool) error

RegisterMultiple registers multiple tools

func (*Manager) Remove

func (m *Manager) Remove(name string) error

Remove removes a tool

func (*Manager) Size

func (m *Manager) Size() int

Size gets the number of tools

type Registry

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

Registry tool registry

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new tool registry

func (*Registry) Clear

func (r *Registry) Clear()

Clear clears all tools

func (*Registry) Get

func (r *Registry) Get(name string) (types.Tool, error)

Get gets a tool

func (*Registry) GetAll

func (r *Registry) GetAll() []types.Tool

GetAll gets all tools

func (*Registry) GetByType

func (r *Registry) GetByType(toolType string) []types.Tool

GetByType gets tools by type

func (*Registry) Register

func (r *Registry) Register(tool types.Tool) error

Register registers a tool

func (*Registry) RegisterMultiple

func (r *Registry) RegisterMultiple(tools []types.Tool) error

RegisterMultiple registers multiple tools

func (*Registry) Remove

func (r *Registry) Remove(name string) error

Remove removes a tool

func (*Registry) Size

func (r *Registry) Size() int

Size gets the number of tools

type ToolInfo

type ToolInfo struct {
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Type        string                 `json:"type"`
	Metadata    types.ToolMetadata     `json:"metadata"`
	Schema      map[string]interface{} `json:"schema"`
}

ToolInfo tool information

Directories

Path Synopsis
builtin
fs
mcp
net
web

Jump to

Keyboard shortcuts

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