feat: support Milvus database selection for vector stores
This commit is contained in:
@@ -137,7 +137,8 @@ type ConnectionConfig struct {
|
||||
// Weaviate
|
||||
GrpcAddress string `yaml:"grpc_address" json:"grpc_address,omitempty"`
|
||||
Scheme string `yaml:"scheme" json:"scheme,omitempty"`
|
||||
// Tencent VectorDB and Doris database name.
|
||||
// Database name used by engines that support database-level namespaces
|
||||
// (currently Milvus, Tencent VectorDB, and Doris).
|
||||
Database string `yaml:"database" json:"database,omitempty"`
|
||||
// Postgres
|
||||
UseDefaultConnection bool `yaml:"use_default_connection" json:"use_default_connection,omitempty"`
|
||||
@@ -681,6 +682,7 @@ func GetVectorStoreTypes() []VectorStoreTypeInfo {
|
||||
DisplayName: "Milvus",
|
||||
ConnectionFields: []VectorStoreFieldInfo{
|
||||
{Name: "addr", Type: "string", Required: true, Description: "Address", Default: "localhost:19530"},
|
||||
{Name: "database", Type: "string", Required: false, Description: "Database Name"},
|
||||
{Name: "username", Type: "string", Required: false, Description: "Username", Default: "root"},
|
||||
{Name: "password", Type: "string", Required: false, Sensitive: true, Description: "Password"},
|
||||
},
|
||||
|
||||
@@ -286,6 +286,25 @@ func TestGetVectorStoreTypes(t *testing.T) {
|
||||
assert.True(t, seen["password"].Sensitive)
|
||||
})
|
||||
|
||||
t.Run("milvus exposes optional database connection field", func(t *testing.T) {
|
||||
var milvusType VectorStoreTypeInfo
|
||||
for _, typ := range types {
|
||||
if typ.Type == "milvus" {
|
||||
milvusType = typ
|
||||
break
|
||||
}
|
||||
}
|
||||
require.NotEmpty(t, milvusType.ConnectionFields)
|
||||
|
||||
seen := map[string]VectorStoreFieldInfo{}
|
||||
for _, f := range milvusType.ConnectionFields {
|
||||
seen[f.Name] = f
|
||||
}
|
||||
require.Contains(t, seen, "database")
|
||||
assert.False(t, seen["database"].Required)
|
||||
assert.Equal(t, "string", seen["database"].Type)
|
||||
})
|
||||
|
||||
t.Run("elasticsearch has connection and index fields", func(t *testing.T) {
|
||||
var esType VectorStoreTypeInfo
|
||||
for _, typ := range types {
|
||||
|
||||
Reference in New Issue
Block a user