Skip to content

Commit 30f0fcf

Browse files
gcf-owl-bot[bot]copybara-github
authored andcommitted
Copybara import of the project:
-- f72e523 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: add support for Vertex AI Search engine PiperOrigin-RevId: 740862834 Source-Link: googleapis/googleapis@e02c606 Source-Link: googleapis/googleapis-gen@b8a2bc9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjhhMmJjOTM2MTA3NjY1MGNmYTA3ZTJkYTc4NDdjZjgxMTczYzFhYSJ9 -- b2bac31 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md -- f3944a0 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: add page spans in retrieved contexts from Vertex RAG Engine in aiplatform v1 PiperOrigin-RevId: 741233157 Source-Link: googleapis/googleapis@5b04a07 Source-Link: googleapis/googleapis-gen@cfb8c0f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2ZiOGMwZjBkOTJhMzM5OTA4ZmEwM2Q0NDQ0NTY0NzRjNzllZGIwMCJ9 -- d13840f by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md -- 9044e00 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: add page spans in retrieved contexts from Vertex RAG Engine in aiplatform v1beta1 docs: A comment for field `rag_files_count` in message `.google.cloud.aiplatform.v1beta1.RagCorpus` is changed docs: A comment for field `model_name` in message `.google.cloud.aiplatform.v1beta1.RagFileParsingConfig` is changed PiperOrigin-RevId: 741268484 Source-Link: googleapis/googleapis@d427057 Source-Link: googleapis/googleapis-gen@38842fc Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzg4NDJmYzI3YTZjZTYwZjU5NzRiYjlmMzgxNmY2NzJlZjEwZjdhMCJ9 -- 214d992 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md COPYBARA_INTEGRATE_REVIEW=#5103 from googleapis:owl-bot-copy 55f9915 PiperOrigin-RevId: 741593016
1 parent 1336b85 commit 30f0fcf

19 files changed

+485
-195
lines changed

google/cloud/aiplatform_v1/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,7 @@
971971
from .types.vertex_rag_data import CorpusStatus
972972
from .types.vertex_rag_data import FileStatus
973973
from .types.vertex_rag_data import ImportRagFilesConfig
974+
from .types.vertex_rag_data import RagChunk
974975
from .types.vertex_rag_data import RagCorpus
975976
from .types.vertex_rag_data import RagEmbeddingModelConfig
976977
from .types.vertex_rag_data import RagFile
@@ -979,6 +980,7 @@
979980
from .types.vertex_rag_data import RagFileTransformationConfig
980981
from .types.vertex_rag_data import RagVectorDbConfig
981982
from .types.vertex_rag_data import UploadRagFileConfig
983+
from .types.vertex_rag_data import VertexAiSearchConfig
982984
from .types.vertex_rag_data_service import CreateRagCorpusOperationMetadata
983985
from .types.vertex_rag_data_service import CreateRagCorpusRequest
984986
from .types.vertex_rag_data_service import DeleteRagCorpusRequest
@@ -1740,6 +1742,7 @@
17401742
"QuestionAnsweringRelevanceInstance",
17411743
"QuestionAnsweringRelevanceResult",
17421744
"QuestionAnsweringRelevanceSpec",
1745+
"RagChunk",
17431746
"RagContexts",
17441747
"RagCorpus",
17451748
"RagEmbeddingModelConfig",
@@ -1993,6 +1996,7 @@
19931996
"UserActionReference",
19941997
"Value",
19951998
"VertexAISearch",
1999+
"VertexAiSearchConfig",
19962000
"VertexRagDataServiceClient",
19972001
"VertexRagServiceClient",
19982002
"VertexRagStore",

google/cloud/aiplatform_v1/services/migration_service/client.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -264,40 +264,40 @@ def parse_dataset_path(path: str) -> Dict[str, str]:
264264
@staticmethod
265265
def dataset_path(
266266
project: str,
267+
location: str,
267268
dataset: str,
268269
) -> str:
269270
"""Returns a fully-qualified dataset string."""
270-
return "projects/{project}/datasets/{dataset}".format(
271+
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
271272
project=project,
273+
location=location,
272274
dataset=dataset,
273275
)
274276

275277
@staticmethod
276278
def parse_dataset_path(path: str) -> Dict[str, str]:
277279
"""Parses a dataset path into its component segments."""
278-
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
280+
m = re.match(
281+
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
282+
path,
283+
)
279284
return m.groupdict() if m else {}
280285

281286
@staticmethod
282287
def dataset_path(
283288
project: str,
284-
location: str,
285289
dataset: str,
286290
) -> str:
287291
"""Returns a fully-qualified dataset string."""
288-
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
292+
return "projects/{project}/datasets/{dataset}".format(
289293
project=project,
290-
location=location,
291294
dataset=dataset,
292295
)
293296

294297
@staticmethod
295298
def parse_dataset_path(path: str) -> Dict[str, str]:
296299
"""Parses a dataset path into its component segments."""
297-
m = re.match(
298-
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
299-
path,
300-
)
300+
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
301301
return m.groupdict() if m else {}
302302

303303
@staticmethod

google/cloud/aiplatform_v1/types/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,7 @@
11001100
CorpusStatus,
11011101
FileStatus,
11021102
ImportRagFilesConfig,
1103+
RagChunk,
11031104
RagCorpus,
11041105
RagEmbeddingModelConfig,
11051106
RagFile,
@@ -1108,6 +1109,7 @@
11081109
RagFileTransformationConfig,
11091110
RagVectorDbConfig,
11101111
UploadRagFileConfig,
1112+
VertexAiSearchConfig,
11111113
)
11121114
from .vertex_rag_data_service import (
11131115
CreateRagCorpusOperationMetadata,
@@ -2022,6 +2024,7 @@
20222024
"CorpusStatus",
20232025
"FileStatus",
20242026
"ImportRagFilesConfig",
2027+
"RagChunk",
20252028
"RagCorpus",
20262029
"RagEmbeddingModelConfig",
20272030
"RagFile",
@@ -2030,6 +2033,7 @@
20302033
"RagFileTransformationConfig",
20312034
"RagVectorDbConfig",
20322035
"UploadRagFileConfig",
2036+
"VertexAiSearchConfig",
20332037
"CreateRagCorpusOperationMetadata",
20342038
"CreateRagCorpusRequest",
20352039
"DeleteRagCorpusRequest",

google/cloud/aiplatform_v1/types/content.py

+13
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
from google.cloud.aiplatform_v1.types import openapi
2323
from google.cloud.aiplatform_v1.types import tool
24+
from google.cloud.aiplatform_v1.types import vertex_rag_data
2425
from google.protobuf import duration_pb2 # type: ignore
2526
from google.type import date_pb2 # type: ignore
2627

@@ -1096,6 +1097,12 @@ class RetrievedContext(proto.Message):
10961097
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
10971098
10981099
Attributes:
1100+
rag_chunk (google.cloud.aiplatform_v1.types.RagChunk):
1101+
Additional context for the RAG retrieval
1102+
result. This is only populated when using the
1103+
RAG retrieval tool.
1104+
1105+
This field is a member of `oneof`_ ``context_details``.
10991106
uri (str):
11001107
URI reference of the attribution.
11011108
@@ -1110,6 +1117,12 @@ class RetrievedContext(proto.Message):
11101117
This field is a member of `oneof`_ ``_text``.
11111118
"""
11121119

1120+
rag_chunk: vertex_rag_data.RagChunk = proto.Field(
1121+
proto.MESSAGE,
1122+
number=4,
1123+
oneof="context_details",
1124+
message=vertex_rag_data.RagChunk,
1125+
)
11131126
uri: str = proto.Field(
11141127
proto.STRING,
11151128
number=1,

google/cloud/aiplatform_v1/types/vertex_rag_data.py

+96-11
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@
3030
"RagEmbeddingModelConfig",
3131
"RagVectorDbConfig",
3232
"FileStatus",
33+
"VertexAiSearchConfig",
3334
"CorpusStatus",
3435
"RagCorpus",
3536
"RagFile",
37+
"RagChunk",
3638
"RagFileChunkingConfig",
3739
"RagFileTransformationConfig",
3840
"RagFileParsingConfig",
@@ -238,6 +240,24 @@ class State(proto.Enum):
238240
)
239241

240242

243+
class VertexAiSearchConfig(proto.Message):
244+
r"""Config for the Vertex AI Search.
245+
246+
Attributes:
247+
serving_config (str):
248+
Vertex AI Search Serving Config resource full name. For
249+
example,
250+
``projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}``
251+
or
252+
``projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}``.
253+
"""
254+
255+
serving_config: str = proto.Field(
256+
proto.STRING,
257+
number=1,
258+
)
259+
260+
241261
class CorpusStatus(proto.Message):
242262
r"""RagCorpus status.
243263
@@ -284,10 +304,24 @@ class RagCorpus(proto.Message):
284304
r"""A RagCorpus is a RagFile container and a project can have
285305
multiple RagCorpora.
286306
307+
This message has `oneof`_ fields (mutually exclusive fields).
308+
For each oneof, at most one member field can be set at the same time.
309+
Setting any member of the oneof automatically clears all other
310+
members.
287311
288312
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
289313
290314
Attributes:
315+
vector_db_config (google.cloud.aiplatform_v1.types.RagVectorDbConfig):
316+
Optional. Immutable. The config for the
317+
Vector DBs.
318+
319+
This field is a member of `oneof`_ ``backend_config``.
320+
vertex_ai_search_config (google.cloud.aiplatform_v1.types.VertexAiSearchConfig):
321+
Optional. Immutable. The config for the
322+
Vertex AI Search.
323+
324+
This field is a member of `oneof`_ ``backend_config``.
291325
name (str):
292326
Output only. The resource name of the
293327
RagCorpus.
@@ -305,13 +339,20 @@ class RagCorpus(proto.Message):
305339
was last updated.
306340
corpus_status (google.cloud.aiplatform_v1.types.CorpusStatus):
307341
Output only. RagCorpus state.
308-
vector_db_config (google.cloud.aiplatform_v1.types.RagVectorDbConfig):
309-
Optional. Immutable. The config for the
310-
Vector DBs.
311-
312-
This field is a member of `oneof`_ ``backend_config``.
313342
"""
314343

344+
vector_db_config: "RagVectorDbConfig" = proto.Field(
345+
proto.MESSAGE,
346+
number=9,
347+
oneof="backend_config",
348+
message="RagVectorDbConfig",
349+
)
350+
vertex_ai_search_config: "VertexAiSearchConfig" = proto.Field(
351+
proto.MESSAGE,
352+
number=10,
353+
oneof="backend_config",
354+
message="VertexAiSearchConfig",
355+
)
315356
name: str = proto.Field(
316357
proto.STRING,
317358
number=1,
@@ -339,12 +380,6 @@ class RagCorpus(proto.Message):
339380
number=8,
340381
message="CorpusStatus",
341382
)
342-
vector_db_config: "RagVectorDbConfig" = proto.Field(
343-
proto.MESSAGE,
344-
number=9,
345-
oneof="backend_config",
346-
message="RagVectorDbConfig",
347-
)
348383

349384

350385
class RagFile(proto.Message):
@@ -473,6 +508,56 @@ class RagFile(proto.Message):
473508
)
474509

475510

511+
class RagChunk(proto.Message):
512+
r"""A RagChunk includes the content of a chunk of a RagFile, and
513+
associated metadata.
514+
515+
516+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
517+
518+
Attributes:
519+
text (str):
520+
The content of the chunk.
521+
page_span (google.cloud.aiplatform_v1.types.RagChunk.PageSpan):
522+
If populated, represents where the chunk
523+
starts and ends in the document.
524+
525+
This field is a member of `oneof`_ ``_page_span``.
526+
"""
527+
528+
class PageSpan(proto.Message):
529+
r"""Represents where the chunk starts and ends in the document.
530+
531+
Attributes:
532+
first_page (int):
533+
Page where chunk starts in the document.
534+
Inclusive. 1-indexed.
535+
last_page (int):
536+
Page where chunk ends in the document.
537+
Inclusive. 1-indexed.
538+
"""
539+
540+
first_page: int = proto.Field(
541+
proto.INT32,
542+
number=1,
543+
)
544+
last_page: int = proto.Field(
545+
proto.INT32,
546+
number=2,
547+
)
548+
549+
text: str = proto.Field(
550+
proto.STRING,
551+
number=1,
552+
)
553+
page_span: PageSpan = proto.Field(
554+
proto.MESSAGE,
555+
number=2,
556+
optional=True,
557+
message=PageSpan,
558+
)
559+
560+
476561
class RagFileChunkingConfig(proto.Message):
477562
r"""Specifies the size and overlap of chunks for RagFiles.
478563

google/cloud/aiplatform_v1/types/vertex_rag_service.py

+18
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
from google.cloud.aiplatform_v1.types import content as gca_content
2323
from google.cloud.aiplatform_v1.types import tool
24+
from google.cloud.aiplatform_v1.types import vertex_rag_data
2425

2526

2627
__protobuf__ = proto.module(
@@ -194,6 +195,8 @@ class Context(proto.Message):
194195
relevant and 2 means the least relevant.
195196
196197
This field is a member of `oneof`_ ``_score``.
198+
chunk (google.cloud.aiplatform_v1.types.RagChunk):
199+
Context of the retrieved chunk.
197200
"""
198201

199202
source_uri: str = proto.Field(
@@ -213,6 +216,11 @@ class Context(proto.Message):
213216
number=6,
214217
optional=True,
215218
)
219+
chunk: vertex_rag_data.RagChunk = proto.Field(
220+
proto.MESSAGE,
221+
number=7,
222+
message=vertex_rag_data.RagChunk,
223+
)
216224

217225
contexts: MutableSequence[Context] = proto.RepeatedField(
218226
proto.MESSAGE,
@@ -457,6 +465,10 @@ class Fact(proto.Message):
457465
and 2 means the least relevant.
458466
459467
This field is a member of `oneof`_ ``_score``.
468+
chunk (google.cloud.aiplatform_v1.types.RagChunk):
469+
If present, chunk properties.
470+
471+
This field is a member of `oneof`_ ``_chunk``.
460472
"""
461473

462474
query: str = proto.Field(
@@ -489,6 +501,12 @@ class Fact(proto.Message):
489501
number=6,
490502
optional=True,
491503
)
504+
chunk: vertex_rag_data.RagChunk = proto.Field(
505+
proto.MESSAGE,
506+
number=7,
507+
optional=True,
508+
message=vertex_rag_data.RagChunk,
509+
)
492510

493511

494512
class Claim(proto.Message):

google/cloud/aiplatform_v1beta1/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,7 @@
11791179
from .types.vertex_rag_data import CorpusStatus
11801180
from .types.vertex_rag_data import FileStatus
11811181
from .types.vertex_rag_data import ImportRagFilesConfig
1182+
from .types.vertex_rag_data import RagChunk
11821183
from .types.vertex_rag_data import RagCorpus
11831184
from .types.vertex_rag_data import RagEmbeddingModelConfig
11841185
from .types.vertex_rag_data import RagFile
@@ -2086,6 +2087,7 @@
20862087
"QuestionAnsweringRelevanceInstance",
20872088
"QuestionAnsweringRelevanceResult",
20882089
"QuestionAnsweringRelevanceSpec",
2090+
"RagChunk",
20892091
"RagContexts",
20902092
"RagCorpus",
20912093
"RagEmbeddingModelConfig",

google/cloud/aiplatform_v1beta1/types/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -1332,6 +1332,7 @@
13321332
CorpusStatus,
13331333
FileStatus,
13341334
ImportRagFilesConfig,
1335+
RagChunk,
13351336
RagCorpus,
13361337
RagEmbeddingModelConfig,
13371338
RagFile,
@@ -2453,6 +2454,7 @@
24532454
"CorpusStatus",
24542455
"FileStatus",
24552456
"ImportRagFilesConfig",
2457+
"RagChunk",
24562458
"RagCorpus",
24572459
"RagEmbeddingModelConfig",
24582460
"RagFile",

0 commit comments

Comments
 (0)