44
44
SlackChannelsSource ,
45
45
JiraSource ,
46
46
VertexFeatureStore ,
47
+ VertexVectorSearch ,
47
48
Weaviate ,
48
49
)
49
50
@@ -99,8 +100,8 @@ def convert_gapic_to_embedding_model_config(
99
100
100
101
def convert_gapic_to_vector_db (
101
102
gapic_vector_db : RagVectorDbConfig ,
102
- ) -> Union [Weaviate , VertexFeatureStore , Pinecone ]:
103
- """Convert Gapic RagVectorDbConfig to Weaviate, VertexFeatureStore, or Pinecone."""
103
+ ) -> Union [Weaviate , VertexFeatureStore , VertexVectorSearch , Pinecone ]:
104
+ """Convert Gapic RagVectorDbConfig to Weaviate, VertexFeatureStore, VertexVectorSearch, or Pinecone."""
104
105
if gapic_vector_db .__contains__ ("weaviate" ):
105
106
return Weaviate (
106
107
weaviate_http_endpoint = gapic_vector_db .weaviate .http_endpoint ,
@@ -116,6 +117,11 @@ def convert_gapic_to_vector_db(
116
117
index_name = gapic_vector_db .pinecone .index_name ,
117
118
api_key = gapic_vector_db .api_auth .api_key_config .api_key_secret_version ,
118
119
)
120
+ elif gapic_vector_db .__contains__ ("vertex_vector_search" ):
121
+ return VertexVectorSearch (
122
+ index_endpoint = gapic_vector_db .vertex_vector_search .index_endpoint ,
123
+ index = gapic_vector_db .vertex_vector_search .index ,
124
+ )
119
125
else :
120
126
return None
121
127
@@ -418,7 +424,7 @@ def set_embedding_model_config(
418
424
419
425
420
426
def set_vector_db (
421
- vector_db : Union [Weaviate , VertexFeatureStore , Pinecone ],
427
+ vector_db : Union [Weaviate , VertexFeatureStore , VertexVectorSearch , Pinecone ],
422
428
rag_corpus : GapicRagCorpus ,
423
429
) -> None :
424
430
"""Sets the vector db configuration for the rag corpus."""
@@ -446,6 +452,16 @@ def set_vector_db(
446
452
feature_view_resource_name = resource_name ,
447
453
),
448
454
)
455
+ elif isinstance (vector_db , VertexVectorSearch ):
456
+ index_endpoint = vector_db .index_endpoint
457
+ index = vector_db .index
458
+
459
+ rag_corpus .rag_vector_db_config = RagVectorDbConfig (
460
+ vertex_vector_search = RagVectorDbConfig .VertexVectorSearch (
461
+ index_endpoint = index_endpoint ,
462
+ index = index ,
463
+ ),
464
+ )
449
465
elif isinstance (vector_db , Pinecone ):
450
466
index_name = vector_db .index_name
451
467
api_key = vector_db .api_key
@@ -462,5 +478,5 @@ def set_vector_db(
462
478
)
463
479
else :
464
480
raise TypeError (
465
- "vector_db must be a Weaviate, VertexFeatureStore, or Pinecone."
481
+ "vector_db must be a Weaviate, VertexFeatureStore, VertexVectorSearch, or Pinecone."
466
482
)
0 commit comments