config

package
v0.0.0-...-0f488bb Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Of

func Of[T any](v T) *T

Of 辅助函数

Types

type Config

type Config struct {
	Client       *elasticsearch.Client // ES 客户端
	QdrantClient *qdrant.Client        // Qdrant 客户端
	IndexName    string                // index name / collection name
	// embedding 时使用
	APIKey         string
	BaseURL        string
	EmbeddingModel string
	ChatModel      string
}

func (*Config) Copy

func (x *Config) Copy() *Config

func (*Config) CreateIndex

func (c *Config) CreateIndex(ctx context.Context) error

CreateIndex 创建索引/集合

func (*Config) DeleteDocument

func (c *Config) DeleteDocument(ctx context.Context, documentID string) error

DeleteDocument 删除文档

func (*Config) GetChatModelConfig

func (x *Config) GetChatModelConfig() *openai.ChatModelConfig

func (*Config) GetKnowledgeBaseList

func (c *Config) GetKnowledgeBaseList(ctx context.Context) ([]string, error)

GetKnowledgeBaseList 获取知识库列表

func (*Config) IndexExists

func (c *Config) IndexExists(ctx context.Context) (bool, error)

IndexExists 检查索引/集合是否存在

func (*Config) SearchDocumentsByIDs

func (c *Config) SearchDocumentsByIDs(ctx context.Context, knowledgeName string, docIDs []string, size int) ([]*schema.Document, error)

SearchDocumentsByIDs 根据文档 ID 列表搜索文档

Jump to

Keyboard shortcuts

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