refactor(knowledge): Move the searchstore manager to app infra (#764)

This commit is contained in:
Ryo
2025-08-15 10:46:09 +08:00
committed by GitHub
parent 710bbbff2b
commit ff00dcb31b
6 changed files with 312 additions and 295 deletions

View File

@@ -65,6 +65,10 @@ type VikingEmbeddingConfig struct {
BuiltinEmbedding embedding.Embedder
}
func NewVikingDBService(host string, region string, ak string, sk string, scheme string) *vikingdb.VikingDBService {
return vikingdb.NewVikingDBService(host, region, ak, sk, scheme)
}
func NewManager(config *ManagerConfig) (searchstore.Manager, error) {
if config.Service == nil {
return nil, fmt.Errorf("[NewManager] vikingdb service is nil")

View File

@@ -33,6 +33,15 @@ import (
"github.com/coze-dev/coze-studio/backend/types/errno"
)
type EmbeddingConfig = ark.EmbeddingConfig
type APIType = ark.APIType
const (
APITypeText = ark.APITypeText
APITypeMultiModal APIType = ark.APITypeMultiModal
)
func NewArkEmbedder(ctx context.Context, config *ark.EmbeddingConfig, dimensions int64, batchSize int) (contract.Embedder, error) {
emb, err := ark.NewEmbedder(ctx, config)
if err != nil {