fix(tcvdb): improve collection compatibility

This commit is contained in:
langcaiye
2026-06-02 20:14:06 +08:00
committed by lyingbug
parent 1e98739dbf
commit d07a62af06
5 changed files with 90 additions and 4 deletions
+1 -1
View File
@@ -704,7 +704,7 @@ func GetVectorStoreTypes() []VectorStoreTypeInfo {
IndexFields: []VectorStoreFieldInfo{
{Name: "collection_name", Type: "string", Required: false, Description: "Collection Name", Default: "weknora_embeddings"},
{Name: "shards_num", Type: "number", Required: false, Description: "Shards", Default: 1},
{Name: "replica_number", Type: "number", Required: false, Description: "Replicas", Default: 1},
{Name: "replica_number", Type: "number", Required: false, Description: "Replicas", Default: 0},
},
},
{
+17
View File
@@ -327,6 +327,23 @@ func TestGetVectorStoreTypes(t *testing.T) {
assert.True(t, passwordField.Sensitive)
})
t.Run("tencent vectordb defaults to serverless replicas", func(t *testing.T) {
var tencentType VectorStoreTypeInfo
for _, typ := range types {
if typ.Type == "tencent_vectordb" {
tencentType = typ
break
}
}
require.NotEmpty(t, tencentType.IndexFields)
seen := map[string]VectorStoreFieldInfo{}
for _, f := range tencentType.IndexFields {
seen[f.Name] = f
}
assert.Equal(t, 0, seen["replica_number"].Default)
})
t.Run("display names have no parenthetical suffix", func(t *testing.T) {
for _, typ := range types {
assert.NotContains(t, typ.DisplayName, "(", "display_name should not contain parenthetical suffix: %s", typ.DisplayName)