tools

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 7 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 (sorted by name)

func (*Registry) GetAllVisible added in v1.10.0

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

GetAllVisible returns only tools whose exposure is Direct (the default). It is the E1 filter used when assembling the model's initial tool list. GetAll() keeps its original semantics (all tools) for subagent dispatch/debug.

func (*Registry) GetByType

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

GetByType gets tools by type

func (*Registry) GetDeferred added in v1.10.0

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

GetDeferred returns all tools whose exposure is Deferred. It feeds the tool_search index (E2).

func (*Registry) GetDeferredTool added in v1.10.0

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

GetDeferredTool returns a single deferred tool by name. It is used by the tool_search index build and by tests; the runtime discover path uses the per-session pre-wrapped cache instead (see dino/factory.go sessionDeferredTools).

func (*Registry) Has added in v1.8.0

func (r *Registry) Has(name string) bool

Has reports whether a tool is registered by name

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