Content-Length: 565035 | pFad | https://github.com/googleapis/python-aiplatform/commit/d64c414549e9ca22d66fdc747a45599ed3313778

20 Copybara import of the project: · googleapis/python-aiplatform@d64c414 · GitHub
Skip to content

Commit d64c414

Browse files
gcf-owl-bot[bot]copybara-github
authored andcommitted
Copybara import of the project:
-- a9fed09 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=#5194 from googleapis:owl-bot-copy cd97261 PiperOrigin-RevId: 755982628
1 parent c9d624f commit d64c414

File tree

3 files changed

+59
-18
lines changed

3 files changed

+59
-18
lines changed

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -281,23 +281,18 @@ def parse_dataset_path(path: str) -> Dict[str, str]:
281281
@staticmethod
282282
def dataset_path(
283283
project: str,
284-
location: str,
285284
dataset: str,
286285
) -> str:
287286
"""Returns a fully-qualified dataset string."""
288-
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
287+
return "projects/{project}/datasets/{dataset}".format(
289288
project=project,
290-
location=location,
291289
dataset=dataset,
292290
)
293291

294292
@staticmethod
295293
def parse_dataset_path(path: str) -> Dict[str, str]:
296294
"""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-
)
295+
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
301296
return m.groupdict() if m else {}
302297

303298
@staticmethod

google/cloud/aiplatform_v1/types/vertex_rag_data.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,12 +615,21 @@ class RagFileTransformationConfig(proto.Message):
615615
class RagFileParsingConfig(proto.Message):
616616
r"""Specifies the parsing config for RagFiles.
617617
618+
This message has `oneof`_ fields (mutually exclusive fields).
619+
For each oneof, at most one member field can be set at the same time.
620+
Setting any member of the oneof automatically clears all other
621+
members.
622+
618623
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
619624
620625
Attributes:
621626
layout_parser (google.cloud.aiplatform_v1.types.RagFileParsingConfig.LayoutParser):
622627
The Layout Parser to use for RagFiles.
623628
629+
This field is a member of `oneof`_ ``parser``.
630+
llm_parser (google.cloud.aiplatform_v1.types.RagFileParsingConfig.LlmParser):
631+
The LLM Parser to use for RagFiles.
632+
624633
This field is a member of `oneof`_ ``parser``.
625634
"""
626635

@@ -656,12 +665,52 @@ class LayoutParser(proto.Message):
656665
number=2,
657666
)
658667

668+
class LlmParser(proto.Message):
669+
r"""Specifies the advanced parsing for RagFiles.
670+
671+
Attributes:
672+
model_name (str):
673+
The name of a LLM model used for parsing. Format:
674+
675+
- ``projects/{project_id}/locations/{location}/publishers/{publisher}/models/{model}``
676+
max_parsing_requests_per_min (int):
677+
The maximum number of requests the job is
678+
allowed to make to the LLM model per minute.
679+
Consult
680+
https://cloud.google.com/vertex-ai/generative-ai/docs/quotas
681+
and your document size to set an appropriate
682+
value here. If unspecified, a default value of
683+
5000 QPM would be used.
684+
custom_parsing_prompt (str):
685+
The prompt to use for parsing. If not
686+
specified, a default prompt will be used.
687+
"""
688+
689+
model_name: str = proto.Field(
690+
proto.STRING,
691+
number=1,
692+
)
693+
max_parsing_requests_per_min: int = proto.Field(
694+
proto.INT32,
695+
number=2,
696+
)
697+
custom_parsing_prompt: str = proto.Field(
698+
proto.STRING,
699+
number=3,
700+
)
701+
659702
layout_parser: LayoutParser = proto.Field(
660703
proto.MESSAGE,
661704
number=4,
662705
oneof="parser",
663706
message=LayoutParser,
664707
)
708+
llm_parser: LlmParser = proto.Field(
709+
proto.MESSAGE,
710+
number=5,
711+
oneof="parser",
712+
message=LlmParser,
713+
)
665714

666715

667716
class UploadRagFileConfig(proto.Message):

tests/unit/gapic/aiplatform_v1/test_migration_service.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5420,9 +5420,9 @@ def test_parse_dataset_path():
54205420

54215421

54225422
def test_dataset_path():
5423-
project = "scallop"
5424-
location = "abalone"
5425-
dataset = "squid"
5423+
project = "squid"
5424+
location = "clam"
5425+
dataset = "whelk"
54265426
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
54275427
project=project,
54285428
location=location,
@@ -5446,22 +5446,19 @@ def test_parse_dataset_path():
54465446

54475447

54485448
def test_dataset_path():
5449-
project = "oyster"
5450-
location = "nudibranch"
5451-
dataset = "cuttlefish"
5452-
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
5449+
project = "cuttlefish"
5450+
dataset = "mussel"
5451+
expected = "projects/{project}/datasets/{dataset}".format(
54535452
project=project,
5454-
location=location,
54555453
dataset=dataset,
54565454
)
5457-
actual = MigrationServiceClient.dataset_path(project, location, dataset)
5455+
actual = MigrationServiceClient.dataset_path(project, dataset)
54585456
assert expected == actual
54595457

54605458

54615459
def test_parse_dataset_path():
54625460
expected = {
5463-
"project": "mussel",
5464-
"location": "winkle",
5461+
"project": "winkle",
54655462
"dataset": "nautilus",
54665463
}
54675464
path = MigrationServiceClient.dataset_path(**expected)

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/googleapis/python-aiplatform/commit/d64c414549e9ca22d66fdc747a45599ed3313778

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy