buildinaitools

package
v1.4.4-alpha1202-loadi... Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllTools

func GetAllTools() []*aitool.Tool

GetAllTools returns all built-in AI tools, including generated ones

func GetAllToolsDynamically

func GetAllToolsDynamically(db *gorm.DB) []*aitool.Tool

GetAllToolsDynamically returns all built-in AI tools, dynamically get from the database

func GetBasicBuildInTools

func GetBasicBuildInTools() []*aitool.Tool

Types

type AiToolManager

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

AiToolManager 是工具管理器的默认实现

func NewToolManager

func NewToolManager(options ...ToolManagerOption) *AiToolManager

NewToolManager 创建一个新的默认工具管理器实例

func NewToolManagerByToolGetter

func NewToolManagerByToolGetter(getter func() []*aitool.Tool, options ...ToolManagerOption) *AiToolManager

func (*AiToolManager) AppendTools

func (m *AiToolManager) AppendTools(tools ...*aitool.Tool) error

func (*AiToolManager) DisableTool

func (m *AiToolManager) DisableTool(name string)

DisableTool 关闭单个工具

func (*AiToolManager) EnableAIForgeSearch

func (m *AiToolManager) EnableAIForgeSearch(searcher searchtools.AISearcher[*schema.AIForge]) error

func (*AiToolManager) EnableAIToolSearch

func (m *AiToolManager) EnableAIToolSearch(searcher searchtools.AISearcher[*aitool.Tool]) error

func (*AiToolManager) EnableTool

func (m *AiToolManager) EnableTool(name string)

EnableTool 开启单个工具

func (*AiToolManager) GetEnableTools

func (m *AiToolManager) GetEnableTools() ([]*aitool.Tool, error)

GetEnableTools 获取所有可用的工具

func (*AiToolManager) GetToolByName

func (m *AiToolManager) GetToolByName(name string) (*aitool.Tool, error)

GetToolByName 通过工具名获取特定工具

func (*AiToolManager) SearchTools

func (m *AiToolManager) SearchTools(method string, query string) ([]*aitool.Tool, error)

SearchTools 通过字符串搜索相关工具

type ToolManagerOption

type ToolManagerOption func(*AiToolManager)

ToolManagerOption 定义工具管理器的配置选项

func WithAIToolsSearcher

func WithAIToolsSearcher(searcher searchtools.AISearcher[*aitool.Tool]) ToolManagerOption

WithAIToolsSearcher 设置搜索器

func WithAiForgeSearcher

func WithAiForgeSearcher(searcher searchtools.AISearcher[*schema.AIForge]) ToolManagerOption

WithAiForgeSearcher 设置forge搜索器

func WithDisableTools

func WithDisableTools(toolsName []string) ToolManagerOption

func WithEnableAllTools

func WithEnableAllTools() ToolManagerOption

WithEnableAllTools 设置开启所有工具

func WithEnabledTools

func WithEnabledTools(toolNames []string) ToolManagerOption

WithEnabledTools 设置开启的工具列表

func WithExtendTools

func WithExtendTools(tools []*aitool.Tool, suggested ...bool) ToolManagerOption

func WithForgeSearchToolEnabled

func WithForgeSearchToolEnabled(enabled bool) ToolManagerOption

func WithNoToolsCache

func WithNoToolsCache() ToolManagerOption

WithNoToolsCache 设置不缓存工具

func WithSearchToolEnabled

func WithSearchToolEnabled(enabled bool) ToolManagerOption

WithSearchToolEnabled 设置是否开启工具搜索

func WithToolEnabled

func WithToolEnabled(name string, enabled bool) ToolManagerOption

WithToolEnabled 设置单个工具的开启状态

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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