Documentation
¶
Index ¶
- func CreateIndexIfNotExists(ctx context.Context, client *elasticsearch.Client, indexName string) error
- func DeleteDocument(ctx context.Context, client *elasticsearch.Client, documentID string) error
- func GetChatModel(ctx context.Context, cfg *openai.ChatModelConfig) (model.BaseChatModel, error)
- func GetEmbeddingModel(ctx context.Context, cfg *openai.ChatModelConfig) (model.BaseChatModel, error)
- func GetQAModel(ctx context.Context, cfg *qwen.ChatModelConfig) (model.BaseChatModel, error)
- func GetRerankModel(ctx context.Context, cfg *openai.ChatModelConfig) (model.BaseChatModel, error)
- func GetRewriteModel(ctx context.Context, cfg *qwen.ChatModelConfig) (model.BaseChatModel, error)
- func IsURL(str string) bool
- func NewEmbedding(ctx context.Context, conf *config.Config) (eb embedding.Embedder, err error)
- func Of[T any](v T) *T
- func RemoveDuplicates[T any, K comparable](slice []T, keyFunc func(T) K) []T
- func SteamResponse(ctx context.Context, streamReader *schema.StreamReader[*schema.Message], ...) (err error)
- type StreamData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateIndexIfNotExists ¶
func CreateIndexIfNotExists(ctx context.Context, client *elasticsearch.Client, indexName string) error
CreateIndexIfNotExists 已废弃:使用 vector.VectorStore 接口替代 Deprecated: Use vector.VectorStore.IndexExists and CreateIndex instead
func DeleteDocument ¶
DeleteDocument 删除索引中的单个文档 已废弃:使用 vector.VectorStore 接口替代 Deprecated: Use vector.VectorStore.DeleteDocument instead
func GetChatModel ¶
func GetChatModel(ctx context.Context, cfg *openai.ChatModelConfig) (model.BaseChatModel, error)
func GetEmbeddingModel ¶
func GetEmbeddingModel(ctx context.Context, cfg *openai.ChatModelConfig) (model.BaseChatModel, error)
func GetQAModel ¶
func GetQAModel(ctx context.Context, cfg *qwen.ChatModelConfig) (model.BaseChatModel, error)
func GetRerankModel ¶
func GetRerankModel(ctx context.Context, cfg *openai.ChatModelConfig) (model.BaseChatModel, error)
func GetRewriteModel ¶
func GetRewriteModel(ctx context.Context, cfg *qwen.ChatModelConfig) (model.BaseChatModel, error)
func NewEmbedding ¶
func RemoveDuplicates ¶
func RemoveDuplicates[T any, K comparable](slice []T, keyFunc func(T) K) []T
Types ¶
Click to show internal directories.
Click to hide internal directories.