Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRetriever ¶
NewRetriever creates a router retriever. router retriever is useful when you want to retrieve documents from multiple retrievers with different queries. eg.
routerRetriever := router.NewRetriever(ctx, &router.Config{})
docs, err := routerRetriever.Retrieve(ctx, "how to build agent with eino")
if err != nil {
...
}
println(docs)
Types ¶
type Config ¶
type Config struct {
// Retrievers is the retrievers to be used.
Retrievers map[string]retriever.Retriever
// Router is the function to route the query to the retrievers.
Router func(ctx context.Context, query string) ([]string, error)
// FusionFunc is the function to fuse the documents from the retrievers.
FusionFunc func(ctx context.Context, result map[string][]*schema.Document) ([]*schema.Document, error)
}
Config is the config for router retriever.
Click to show internal directories.
Click to hide internal directories.