Help us shape the future of Go! Take the 2026 Go Developer Survey

knowledge

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetReasoningTools

func GetReasoningTools(retriever retriever.Retriever, retrieverOptions []retriever.Option) []tool.BaseTool

GetReasoningTools 获取知识推理工具集合

func GetTools

func GetTools(indexer indexer.Indexer, retriever retriever.Retriever, retrieverOptions *retriever.Options) []tool.BaseTool

func NewKnowledgeAnalysisTool

func NewKnowledgeAnalysisTool() tool.InvokableTool

NewKnowledgeAnalysisTool 创建知识分析工具实例

func NewKnowledgeSearchTool

func NewKnowledgeSearchTool(retriever retriever.Retriever, retrieverOptions []retriever.Option) tool.InvokableTool

NewKnowledgeSearchTool 创建知识搜索工具实例

func NewKnowledgeThinkTool

func NewKnowledgeThinkTool() tool.InvokableTool

NewKnowledgeThinkTool 创建知识思考工具实例

func NewLoadDocumentsTool

func NewLoadDocumentsTool(indexer indexer.Indexer) tool.InvokableTool

NewLoadDocumentsTool 创建文档加载工具实例

func NewSearchDocumentsTool

func NewSearchDocumentsTool(retriever retriever.Retriever, options *retriever.Options) tool.InvokableTool

NewSearchDocumentsTool 创建文档搜索工具实例

Types

type AnalysisParams

type AnalysisParams struct {
	Analysis string `json:"analysis" jsonschema:"description=对搜索结果的分析和评估,required"`
}

AnalysisParams 分析参数

type AnalysisResult

type AnalysisResult struct {
	Analysis    string   `json:"analysis"`
	AnalysisLog []string `json:"analysisLog"`
	Success     bool     `json:"success"`
	Error       string   `json:"error,omitempty"`
	Operation   string   `json:"operation"`
	Timestamp   int64    `json:"timestamp"`
}

AnalysisResult 分析结果

type KnowledgeAnalysisTool

type KnowledgeAnalysisTool struct {
}

KnowledgeAnalysisTool 知识分析工具 提供搜索结果分析功能

type KnowledgeSearchParams

type KnowledgeSearchParams struct {
	Query string `json:"query" jsonschema:"description=搜索查询内容,required"`
	Limit int    `json:"limit,omitempty" jsonschema:"description=搜索结果数量限制,默认为10"`
}

KnowledgeSearchParams 知识搜索参数

type KnowledgeSearchResult

type KnowledgeSearchResult struct {
	Query         string             `json:"query"`
	Documents     []*schema.Document `json:"documents"`
	DocumentCount int                `json:"documentCount"`
	Success       bool               `json:"success"`
	Error         string             `json:"error,omitempty"`
	Operation     string             `json:"operation"`
	Timestamp     int64              `json:"timestamp"`
}

KnowledgeSearchResult 知识搜索结果

type KnowledgeSearchTool

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

KnowledgeSearchTool 知识搜索工具 提供知识库搜索功能

type KnowledgeThinkTool

type KnowledgeThinkTool struct {
}

KnowledgeThinkTool 知识推理思考工具 提供思考和推理功能,用于知识探索策略规划

type LoadDocumentSourceType

type LoadDocumentSourceType string
const (
	LoadDocumentSourceTypeFile LoadDocumentSourceType = "file"
	LoadDocumentSourceTypeUrl  LoadDocumentSourceType = "url"
)

func (LoadDocumentSourceType) String

func (l LoadDocumentSourceType) String() string

type LoadDocumentsParams

type LoadDocumentsParams struct {
	// 文档来源类型:file, url
	SourceType LoadDocumentSourceType `json:"sourceType" jsonschema:"description=文档来源类型,required,enum=file,enum=url"`

	Uri string `json:"uri"`
}

LoadDocumentsParams 加载文档的参数

type LoadDocumentsTool

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

LoadDocumentsTool 文档加载工具 提供将文档加载到知识库的功能

type SearchDocumentsTool

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

SearchDocumentsTool 文档搜索工具 提供在知识库中搜索文档的功能

type SearchParams

type SearchParams struct {
	Query string `json:"query" jsonschema:"description=搜索查询,required"`
}

SearchParams 搜索参数

type ThinkParams

type ThinkParams struct {
	Thought string `json:"thought" jsonschema:"description=思考内容和推理过程,required"`
}

ThinkParams 思考参数

type ThinkResult

type ThinkResult struct {
	Thought     string   `json:"thought"`
	ThoughtsLog []string `json:"thoughtsLog"`
	Success     bool     `json:"success"`
	Error       string   `json:"error,omitempty"`
	Operation   string   `json:"operation"`
	Timestamp   int64    `json:"timestamp"`
}

ThinkResult 思考结果

Jump to

Keyboard shortcuts

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