Documentation ¶
Index ¶
- func AddReferencesToArgs(args map[string]any, refs []Reference) map[string]any
- type KnowledgeBaseRetriever
- func (l *KnowledgeBaseRetriever) Cleanup()
- func (l *KnowledgeBaseRetriever) Init(ctx context.Context, cli client.Client, _ map[string]any) error
- func (l *KnowledgeBaseRetriever) Ready() (isReady bool, msg string)
- func (l *KnowledgeBaseRetriever) Run(ctx context.Context, cli client.Client, args map[string]any) (map[string]any, error)
- type KnowledgeBaseStuffDocuments
- func (c *KnowledgeBaseStuffDocuments) Call(ctx context.Context, values map[string]any, options ...chains.ChainCallOption) (map[string]any, error)
- func (c *KnowledgeBaseStuffDocuments) GetCallbackHandler() callbacks.Handler
- func (c KnowledgeBaseStuffDocuments) GetInputKeys() []string
- func (c KnowledgeBaseStuffDocuments) GetMemory() langchaingoschema.Memory
- func (c KnowledgeBaseStuffDocuments) GetOutputKeys() []string
- func (c KnowledgeBaseStuffDocuments) HandleChainEnd(ctx context.Context, outputValues map[string]any)
- type Reference
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KnowledgeBaseRetriever ¶
type KnowledgeBaseRetriever struct { langchaingoschema.Retriever base.BaseNode DocNullReturn string Instance *apiretriever.KnowledgeBaseRetriever Finish func() }
func NewKnowledgeBaseRetriever ¶
func NewKnowledgeBaseRetriever(baseNode base.BaseNode) *KnowledgeBaseRetriever
func (*KnowledgeBaseRetriever) Cleanup ¶
func (l *KnowledgeBaseRetriever) Cleanup()
func (*KnowledgeBaseRetriever) Ready ¶
func (l *KnowledgeBaseRetriever) Ready() (isReady bool, msg string)
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) GetCallbackHandler ¶
func (c *KnowledgeBaseStuffDocuments) GetCallbackHandler() callbacks.Handler
func (KnowledgeBaseStuffDocuments) GetInputKeys ¶
func (c KnowledgeBaseStuffDocuments) GetInputKeys() []string
func (KnowledgeBaseStuffDocuments) GetMemory ¶
func (c KnowledgeBaseStuffDocuments) GetMemory() langchaingoschema.Memory
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"` // the qa file fullpath QAFilePath string `json:"qa_file_path" example:"dataset/dataset-playground/v1/qa.csv"` // line number in the qa file QALineNumber int `json:"qa_line_number" example:"7"` // source file name, only file name, not full path FileName string `json:"file_name" example:"员工考勤管理制度-2023.pdf"` // page number in the source file PageNumber int `json:"page_number" example:"1"` // related content in the source file or in webpage Content string `` /* 144-byte string literal not displayed */ // Title of the webpage Title string `json:"title,omitempty" example:"开始使用 Microsoft 帐户 – Microsoft"` // URL of the webpage URL string `json:"url,omitempty" example:"https://www.microsoft.com/zh-cn/welcome"` }
func (Reference) SimpleString ¶
Click to show internal directories.
Click to hide internal directories.