refactor(knowledge): Move the searchstore manager to app infra (#764)
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user