Documentation
¶
Overview ¶
Package rag is RAG implementations
Index ¶
- type Option
- func WithChunker(chunker embedder.Chunker) Option
- func WithContextGenerator(fn func(string, []vectordb.Record) string) Option
- func WithEhanceQueryAgent(v agents.TypeableAgent[schema.String, schema.String]) Option
- func WithEmbedder(e embedder.Embedder) Option
- func WithName(name string) Option
- func WithSearchOptions(opts ...vectordb.SearchOption) Option
- func WithVectorDB(v vectordb.Engine) Option
- type Options
- type RAG
- func (r *RAG[O]) AddDocuments(ctx context.Context, collectionName string, docs ...document.Document) (*components.LLMUsage, error)
- func (r *RAG[O]) Name() string
- func (r *RAG[O]) Run(ctx context.Context, query *schema.String, output *O, ...) error
- func (r *RAG[O]) RunAnonymous(ctx context.Context, query any, llmResp *components.LLMResponse) (any, error)
- func (r *RAG[O]) Search(ctx context.Context, query string, opts ...vectordb.SearchOption) ([]vectordb.Record, *components.LLMUsage, error)
- func (r *RAG[O]) SetSearchOptions(opts ...vectordb.SearchOption)
- func (r *RAG[O]) Stream(ctx context.Context, query *schema.String) (<-chan string, agents.MergeResponse, error)
- func (r *RAG[O]) StreamAnonymous(ctx context.Context, query any) (<-chan string, agents.MergeResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Options)
func WithChunker ¶
func WithContextGenerator ¶
func WithEhanceQueryAgent ¶
func WithEmbedder ¶
func WithSearchOptions ¶
func WithSearchOptions(opts ...vectordb.SearchOption) Option
func WithVectorDB ¶
type RAG ¶
func (*RAG[O]) AddDocuments ¶
func (*RAG[O]) Run ¶
func (r *RAG[O]) Run(ctx context.Context, query *schema.String, output *O, llmResp *components.LLMResponse) error
func (*RAG[O]) RunAnonymous ¶
func (r *RAG[O]) RunAnonymous(ctx context.Context, query any, llmResp *components.LLMResponse) (any, error)
func (*RAG[O]) SetSearchOptions ¶
func (r *RAG[O]) SetSearchOptions(opts ...vectordb.SearchOption)
func (*RAG[O]) StreamAnonymous ¶
Click to show internal directories.
Click to hide internal directories.