indexer

package
v0.0.0-...-e986fc6 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildIndexer

func BuildIndexer(ctx context.Context, conf *config.Config) (r compose.Runnable[any, []string], err error)

func BuildIndexerAsync

func BuildIndexerAsync(ctx context.Context, conf *config.Config) (r compose.Runnable[[]*schema.Document, []string], err error)

func NewQdrantIndexer

func NewQdrantIndexer(ctx context.Context, config *QdrantIndexerConfig) (indexer.Indexer, error)

NewQdrantIndexer 创建 Qdrant indexer,使用 eino-ext 库

Types

type QdrantIndexer

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

QdrantIndexer Qdrant indexer 实现(包装 eino-ext 的实现)

func (*QdrantIndexer) GetType

func (idx *QdrantIndexer) GetType() string

GetType 返回 indexer 类型

func (*QdrantIndexer) Store

func (idx *QdrantIndexer) Store(ctx context.Context, docs []*schema.Document, opts ...indexer.Option) ([]string, error)

Store 存储文档(实现 Indexer 接口) 注意:由于 eino-ext 的 indexer 不支持命名向量,这里使用自定义实现

func (*QdrantIndexer) StoreWithNamedVectors

func (idx *QdrantIndexer) StoreWithNamedVectors(ctx context.Context, docs []*schema.Document, opts ...indexer.Option) ([]string, error)

StoreWithNamedVectors 使用命名向量存储文档到 Qdrant 这是自定义实现,因为 eino-ext 的 indexer 不支持命名向量

type QdrantIndexerConfig

type QdrantIndexerConfig struct {
	Client     *qdrant.Client     // Required: Qdrant client
	Collection string             // Required: Collection name
	VectorDim  int                // Required: Vector dimension
	Distance   qdrant.Distance    // Required: Distance metric
	BatchSize  int                // Optional: Batch size (default: 10)
	Embedding  embedding.Embedder // Required: Embedding component
	IsAsync    bool               // Optional: 是否异步模式(包含 QA 向量)
}

QdrantIndexerConfig Qdrant indexer 配置

Jump to

Keyboard shortcuts

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