retriever

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KnowledgeBaseRetriever

type KnowledgeBaseRetriever struct {
	langchaingoschema.Retriever
	base.BaseNode
	DocNullReturn string
}

func NewKnowledgeBaseRetriever

func NewKnowledgeBaseRetriever(baseNode base.BaseNode) *KnowledgeBaseRetriever

func (*KnowledgeBaseRetriever) Run

func (l *KnowledgeBaseRetriever) Run(ctx context.Context, cli dynamic.Interface, args map[string]any) (map[string]any, error)

type KnowledgeBaseStuffDocuments

type KnowledgeBaseStuffDocuments struct {
	chains.StuffDocuments

	DocNullReturn string
	callbacks.SimpleHandler
	References []Reference
	// contains filtered or unexported fields
}

KnowledgeBaseStuffDocuments is similar to chains.StuffDocuments but with new joinDocuments method

func NewStuffDocuments

func NewStuffDocuments(llmChain *chains.LLMChain, docNullReturn string) *KnowledgeBaseStuffDocuments

func (*KnowledgeBaseStuffDocuments) Call

func (c *KnowledgeBaseStuffDocuments) Call(ctx context.Context, values map[string]any, options ...chains.ChainCallOption) (map[string]any, error)

func (KnowledgeBaseStuffDocuments) GetInputKeys

func (c KnowledgeBaseStuffDocuments) GetInputKeys() []string

func (KnowledgeBaseStuffDocuments) GetMemory

func (KnowledgeBaseStuffDocuments) GetOutputKeys

func (c KnowledgeBaseStuffDocuments) GetOutputKeys() []string

func (KnowledgeBaseStuffDocuments) HandleChainEnd

func (c KnowledgeBaseStuffDocuments) HandleChainEnd(ctx context.Context, outputValues map[string]any)

type Reference

type Reference struct {
	// Question row
	Question string `json:"question" example:"q: 旷工最小计算单位为多少天?"`
	// Answer row
	Answer string `json:"answer" example:"旷工最小计算单位为 0.5 天。"`
	// vector search score
	Score float32 `json:"score" example:"0.34"`
	// file fullpath
	FilePath string `json:"file_path" example:"dataset/dataset-playground/v1/qa.csv"`
	// line number in the file
	LineNumber int `json:"line_number" example:"7"`
}

Jump to

Keyboard shortcuts

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