Documentation
¶
Index ¶
- func Of[T any](v T) *T
- type Config
- func (x *Config) Copy() *Config
- func (c *Config) CreateIndex(ctx context.Context) error
- func (c *Config) DeleteDocument(ctx context.Context, documentID string) error
- func (x *Config) GetChatModelConfig() *openai.ChatModelConfig
- func (c *Config) GetKnowledgeBaseList(ctx context.Context) ([]string, error)
- func (c *Config) IndexExists(ctx context.Context) (bool, error)
- func (c *Config) SearchDocumentsByIDs(ctx context.Context, knowledgeName string, docIDs []string, size int) ([]*schema.Document, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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) CreateIndex ¶
CreateIndex 创建索引/集合
func (*Config) DeleteDocument ¶
DeleteDocument 删除文档
func (*Config) GetChatModelConfig ¶
func (x *Config) GetChatModelConfig() *openai.ChatModelConfig
func (*Config) GetKnowledgeBaseList ¶
GetKnowledgeBaseList 获取知识库列表
func (*Config) IndexExists ¶
IndexExists 检查索引/集合是否存在
Click to show internal directories.
Click to hide internal directories.