Versions in this module Expand all Collapse all v0 v0.1.1 Apr 12, 2026 Changes in this version + const DefaultBailianEndpoint + const KnowledgeAliyun + const KnowledgeQdrant + var ErrEmptyText = errors.New("empty text") + var ErrUnsupportedKnowledgeProvider = errors.New("unsupported knowledge provider") + type AliyunHandler struct + IndexID string + WorkspaceID string + func (h *AliyunHandler) Delete(ctx context.Context, ids []string, options *DeleteOptions) error + func (h *AliyunHandler) Get(ctx context.Context, ids []string, options *GetOptions) ([]Record, error) + func (h *AliyunHandler) List(ctx context.Context, options *ListOptions) (*ListResult, error) + func (h *AliyunHandler) Provider() string + func (h *AliyunHandler) Query(ctx context.Context, text string, options *QueryOptions) ([]QueryResult, error) + func (h *AliyunHandler) Upsert(ctx context.Context, records []Record, options *UpsertOptions) error + type AliyunOptions struct + AccessKeyID string + AccessKeySecret string + Endpoint string + IndexID string + RegionID string + WorkspaceID string + type Chunk struct + Index int + Metadata map[string]any + Text string + Title string + type ChunkOptions struct + DocumentTitle string + MaxChars int + MinChars int + OverlapChars int + PreChunkClean *utils.Options + type Chunker interface + Chunk func(ctx context.Context, text string, opts *ChunkOptions) ([]Chunk, error) + Provider func() string + type DeleteOptions struct + Namespace string + type Embedder interface + Embed func(ctx context.Context, inputs []string) ([][]float64, error) + type FactoryOptions struct + Aliyun *AliyunOptions + Qdrant *QdrantOptions + type GetOptions struct + Namespace string + type KnowledgeHandler interface + Delete func(ctx context.Context, ids []string, options *DeleteOptions) error + Get func(ctx context.Context, ids []string, options *GetOptions) ([]Record, error) + List func(ctx context.Context, options *ListOptions) (*ListResult, error) + Provider func() string + Query func(ctx context.Context, text string, options *QueryOptions) ([]QueryResult, error) + Upsert func(ctx context.Context, records []Record, options *UpsertOptions) error + func New(provider string, opts *FactoryOptions) (KnowledgeHandler, error) + type KnowledgeProvider string + func (kp KnowledgeProvider) ToString() string + type LLMChunker struct + LLM llm.LLMHandler + Model string + func (c *LLMChunker) Chunk(ctx context.Context, text string, opts *ChunkOptions) ([]Chunk, error) + func (c *LLMChunker) Provider() string + type ListOptions struct + Filters map[string]any + Limit int + Namespace string + Offset string + type ListResult struct + NextOffset string + Records []Record + type NvidiaEmbedClient struct + APIKey string + BaseURL string + HTTPClient *http.Client + Model string + func (c *NvidiaEmbedClient) Embed(ctx context.Context, inputs []string) ([][]float64, error) + type QdrantHandler struct + APIKey string + BaseURL string + Collection string + Embedder Embedder + HTTPClient *http.Client + func (qh *QdrantHandler) Delete(ctx context.Context, ids []string, options *DeleteOptions) error + func (qh *QdrantHandler) Get(ctx context.Context, ids []string, options *GetOptions) ([]Record, error) + func (qh *QdrantHandler) List(ctx context.Context, options *ListOptions) (*ListResult, error) + func (qh *QdrantHandler) Provider() string + func (qh *QdrantHandler) Query(ctx context.Context, text string, options *QueryOptions) ([]QueryResult, error) + func (qh *QdrantHandler) Upsert(ctx context.Context, records []Record, options *UpsertOptions) error + type QdrantOptions struct + APIKey string + BaseURL string + Collection string + Embedder Embedder + HTTPClient *http.Client + type QueryOptions struct + Filters map[string]any + Namespace string + TopK int + type QueryResult struct + Record Record + Score float64 + type Record struct + Content string + CreatedAt time.Time + ID string + Metadata map[string]any + Source string + Tags []string + Title string + UpdatedAt time.Time + type RerankResult struct + Index int + Score float64 + type SiliconFlowRerankClient struct + APIKey string + BaseURL string + HTTPClient *http.Client + Model string + func (c *SiliconFlowRerankClient) Rerank(ctx context.Context, query string, documents []string, topN int) ([]RerankResult, error) + type UpsertOptions struct + Namespace string + Overwrite bool