Skip to content

Commit 6ad6fe8

Browse files
yyyu-googlecopybara-github
authored andcommitted
feat: update discovery doc
PiperOrigin-RevId: 983296420
1 parent 81eee8c commit 6ad6fe8

2 files changed

Lines changed: 83 additions & 25 deletions

File tree

agentplatform/_genai/evals.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,13 @@ def _CustomCodeExecutionSpec_from_vertex(
215215
getv(from_object, ["evaluation_function"]),
216216
)
217217

218+
if getv(from_object, ["codeExecutionRegion"]) is not None:
219+
setv(
220+
to_object,
221+
["code_execution_region"],
222+
getv(from_object, ["codeExecutionRegion"]),
223+
)
224+
218225
return to_object
219226

220227

@@ -237,6 +244,13 @@ def _CustomCodeExecutionSpec_to_vertex(
237244
getv(from_object, ["remote_custom_function"]),
238245
)
239246

247+
if getv(from_object, ["code_execution_region"]) is not None:
248+
setv(
249+
to_object,
250+
["codeExecutionRegion"],
251+
getv(from_object, ["code_execution_region"]),
252+
)
253+
240254
return to_object
241255

242256

agentplatform/_genai/types/common.py

Lines changed: 69 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ class SandboxState(_common.CaseInSensitiveEnum):
328328
"""Sandbox runtime is pausing."""
329329
STATE_RESUMING = "STATE_RESUMING"
330330
"""Sandbox runtime is resuming."""
331+
STATE_STOPPING = "STATE_STOPPING"
332+
"""Sandbox runtime is stopping."""
331333

332334

333335
class Protocol(_common.CaseInSensitiveEnum):
@@ -1705,6 +1707,10 @@ def evaluate(instance: dict[str, Any]) -> float:
17051707
Instance is the evaluation instance, any fields populated in the instance
17061708
are available to the function as instance[field_name].""",
17071709
)
1710+
code_execution_region: Optional[str] = Field(
1711+
default=None,
1712+
description="""Optional. The region to use for code execution. If set, the Code Execution Sandbox will be invoked in the specified region regardless of the request's originating region. Must be a region where the Code Execution Sandbox is available. Supported regions: northamerica-northeast1, southamerica-east1, us-central1, us-east1, us-east4, us-west1, us-west4, europe-central2, europe-north1, europe-southwest1, europe-west1, europe-west2, europe-west3, europe-west4, europe-west6, europe-west8, europe-west9, me-west1, asia-east1, asia-east2, asia-northeast1, asia-northeast3, asia-south1, asia-south2, asia-southeast1, australia-southeast2. If unset, the request's originating region is used; requests from regions where the sandbox is unavailable will fail with UNIMPLEMENTED.""",
1713+
)
17081714

17091715

17101716
class CustomCodeExecutionSpecDict(TypedDict, total=False):
@@ -1724,6 +1730,9 @@ def evaluate(instance: dict[str, Any]) -> float:
17241730
Instance is the evaluation instance, any fields populated in the instance
17251731
are available to the function as instance[field_name]."""
17261732

1733+
code_execution_region: Optional[str]
1734+
"""Optional. The region to use for code execution. If set, the Code Execution Sandbox will be invoked in the specified region regardless of the request's originating region. Must be a region where the Code Execution Sandbox is available. Supported regions: northamerica-northeast1, southamerica-east1, us-central1, us-east1, us-east4, us-west1, us-west4, europe-central2, europe-north1, europe-southwest1, europe-west1, europe-west2, europe-west3, europe-west4, europe-west6, europe-west8, europe-west9, me-west1, asia-east1, asia-east2, asia-northeast1, asia-northeast3, asia-south1, asia-south2, asia-southeast1, australia-southeast2. If unset, the request's originating region is used; requests from regions where the sandbox is unavailable will fail with UNIMPLEMENTED."""
1735+
17271736

17281737
CustomCodeExecutionSpecOrDict = Union[
17291738
CustomCodeExecutionSpec, CustomCodeExecutionSpecDict
@@ -6665,7 +6674,7 @@ class ReservationAffinity(_common.BaseModel):
66656674
)
66666675
values: Optional[list[str]] = Field(
66676676
default=None,
6668-
description="""Optional. Corresponds to the label values of a reservation resource. This must be the full resource name of the reservation or reservation block.""",
6677+
description="""Optional. Corresponds to the label values of a reservation resource. This must be the resource name of the reservation, reservation block, or reservation sub- block.""",
66696678
)
66706679

66716680

@@ -6679,7 +6688,7 @@ class ReservationAffinityDict(TypedDict, total=False):
66796688
"""Required. Specifies the reservation affinity type."""
66806689

66816690
values: Optional[list[str]]
6682-
"""Optional. Corresponds to the label values of a reservation resource. This must be the full resource name of the reservation or reservation block."""
6691+
"""Optional. Corresponds to the label values of a reservation resource. This must be the resource name of the reservation, reservation block, or reservation sub- block."""
66836692

66846693

66856694
ReservationAffinityOrDict = Union[ReservationAffinity, ReservationAffinityDict]
@@ -11538,6 +11547,9 @@ class Memory(_common.BaseModel):
1153811547
default=None,
1153911548
description="""Optional. Represents the structured content of the memory.""",
1154011549
)
11550+
context: Optional[str] = Field(
11551+
default=None, description="""Optional. Represents the context of the memory."""
11552+
)
1154111553

1154211554

1154311555
class MemoryDict(TypedDict, total=False):
@@ -11594,6 +11606,9 @@ class MemoryDict(TypedDict, total=False):
1159411606
structured_content: Optional[MemoryStructuredContentDict]
1159511607
"""Optional. Represents the structured content of the memory."""
1159611608

11609+
context: Optional[str]
11610+
"""Optional. Represents the context of the memory."""
11611+
1159711612

1159811613
MemoryOrDict = Union[Memory, MemoryDict]
1159911614

@@ -13281,6 +13296,10 @@ class MemoryRevision(_common.BaseModel):
1328113296
default=None,
1328213297
description="""Output only. Represents the structured value of the memory at the time of revision creation.""",
1328313298
)
13299+
context: Optional[str] = Field(
13300+
default=None,
13301+
description="""Output only. Represents the context of the Memory Revision. The context may include context from both the historical revisions and the extracted content.""",
13302+
)
1328413303

1328513304

1328613305
class MemoryRevisionDict(TypedDict, total=False):
@@ -13307,6 +13326,9 @@ class MemoryRevisionDict(TypedDict, total=False):
1330713326
structured_data: Optional[dict[str, Any]]
1330813327
"""Output only. Represents the structured value of the memory at the time of revision creation."""
1330913328

13329+
context: Optional[str]
13330+
"""Output only. Represents the context of the Memory Revision. The context may include context from both the historical revisions and the extracted content."""
13331+
1331013332

1331113333
MemoryRevisionOrDict = Union[MemoryRevision, MemoryRevisionDict]
1331213334

@@ -16564,13 +16586,13 @@ class SandboxEnvironmentSpecComputerUseEnvironmentDict(TypedDict, total=False):
1656416586

1656516587

1656616588
class SandboxEnvironmentSpecShellEnvironment(_common.BaseModel):
16567-
"""The shell environment with customized settings."""
16589+
"""The shell environment."""
1656816590

1656916591
pass
1657016592

1657116593

1657216594
class SandboxEnvironmentSpecShellEnvironmentDict(TypedDict, total=False):
16573-
"""The shell environment with customized settings."""
16595+
"""The shell environment."""
1657416596

1657516597
pass
1657616598

@@ -16590,7 +16612,12 @@ class SandboxEnvironmentSpec(_common.BaseModel):
1659016612
Field(default=None, description="""Optional. The computer use environment.""")
1659116613
)
1659216614
shell_environment: Optional[SandboxEnvironmentSpecShellEnvironment] = Field(
16593-
default=None, description="""Optional. The shell environment."""
16615+
default=None,
16616+
description="""Optional. The shell environment for executing shell commands and scripts.""",
16617+
)
16618+
use_gke_td: Optional[bool] = Field(
16619+
default=None,
16620+
description="""Optional. Immutable. Whether to provision the SandboxEnvironment via the GKE TD pool. Immutable.""",
1659416621
)
1659516622

1659616623

@@ -16606,7 +16633,10 @@ class SandboxEnvironmentSpecDict(TypedDict, total=False):
1660616633
"""Optional. The computer use environment."""
1660716634

1660816635
shell_environment: Optional[SandboxEnvironmentSpecShellEnvironmentDict]
16609-
"""Optional. The shell environment."""
16636+
"""Optional. The shell environment for executing shell commands and scripts."""
16637+
16638+
use_gke_td: Optional[bool]
16639+
"""Optional. Immutable. Whether to provision the SandboxEnvironment via the GKE TD pool. Immutable."""
1661016640

1661116641

1661216642
SandboxEnvironmentSpecOrDict = Union[SandboxEnvironmentSpec, SandboxEnvironmentSpecDict]
@@ -17551,11 +17581,11 @@ class SandboxEnvironmentTemplateEgressControlConfigDnsPeeringConfig(_common.Base
1755117581
)
1755217582
target_network: Optional[str] = Field(
1755317583
default=None,
17554-
description="""Required. The VPC network name in the target_project where the DNS zone specified by 'domain' is visible.""",
17584+
description="""Required. The VPC network name in the target_project where the DNS zone specified by `domain` is visible.""",
1755517585
)
1755617586
target_project: Optional[str] = Field(
1755717587
default=None,
17558-
description="""Required. The project ID hosting the Cloud DNS managed zone that contains the 'domain'. The Vertex AI Service Agent requires the dns.peer role on this project.""",
17588+
description="""Required. The project ID hosting the Cloud DNS managed zone that contains the `domain`. The Vertex AI Service Agent requires the dns.peer role on this project.""",
1755917589
)
1756017590

1756117591

@@ -17568,10 +17598,10 @@ class SandboxEnvironmentTemplateEgressControlConfigDnsPeeringConfigDict(
1756817598
"""Required. The DNS name suffix of the zone being peered to, e.g., "my-internal-domain.corp.". Must end with a dot."""
1756917599

1757017600
target_network: Optional[str]
17571-
"""Required. The VPC network name in the target_project where the DNS zone specified by 'domain' is visible."""
17601+
"""Required. The VPC network name in the target_project where the DNS zone specified by `domain` is visible."""
1757217602

1757317603
target_project: Optional[str]
17574-
"""Required. The project ID hosting the Cloud DNS managed zone that contains the 'domain'. The Vertex AI Service Agent requires the dns.peer role on this project."""
17604+
"""Required. The project ID hosting the Cloud DNS managed zone that contains the `domain`. The Vertex AI Service Agent requires the dns.peer role on this project."""
1757517605

1757617606

1757717607
SandboxEnvironmentTemplateEgressControlConfigDnsPeeringConfigOrDict = Union[
@@ -17586,10 +17616,6 @@ class SandboxEnvironmentTemplateEgressControlConfig(_common.BaseModel):
1758617616
internet_access: Optional[bool] = Field(
1758717617
default=None, description="""Optional. Whether to allow internet access."""
1758817618
)
17589-
customer_vpc_network: Optional[str] = Field(
17590-
default=None,
17591-
description="""Optional. The customer VPC network that sandbox egress is routed into.""",
17592-
)
1759317619
dns_peering_configs: Optional[
1759417620
list[SandboxEnvironmentTemplateEgressControlConfigDnsPeeringConfig]
1759517621
] = Field(
@@ -17598,7 +17624,7 @@ class SandboxEnvironmentTemplateEgressControlConfig(_common.BaseModel):
1759817624
)
1759917625
network_attachment: Optional[str] = Field(
1760017626
default=None,
17601-
description="""Optional. The name of the customer VPC NetworkAttachment used to draw a PSC interface IP into the customer VPC for sandbox egress.""",
17627+
description="""Optional. The name of the customer VPC `NetworkAttachment` used to draw a PSC interface IP into the customer VPC for sandbox egress.""",
1760217628
)
1760317629

1760417630

@@ -17608,16 +17634,13 @@ class SandboxEnvironmentTemplateEgressControlConfigDict(TypedDict, total=False):
1760817634
internet_access: Optional[bool]
1760917635
"""Optional. Whether to allow internet access."""
1761017636

17611-
customer_vpc_network: Optional[str]
17612-
"""Optional. The customer VPC network that sandbox egress is routed into."""
17613-
1761417637
dns_peering_configs: Optional[
1761517638
list[SandboxEnvironmentTemplateEgressControlConfigDnsPeeringConfigDict]
1761617639
]
1761717640
"""Optional. DNS peering configurations that allow sandbox egress to resolve customer-internal domains via the customer VPC."""
1761817641

1761917642
network_attachment: Optional[str]
17620-
"""Optional. The name of the customer VPC NetworkAttachment used to draw a PSC interface IP into the customer VPC for sandbox egress."""
17643+
"""Optional. The name of the customer VPC `NetworkAttachment` used to draw a PSC interface IP into the customer VPC for sandbox egress."""
1762117644

1762217645

1762317646
SandboxEnvironmentTemplateEgressControlConfigOrDict = Union[
@@ -17873,6 +17896,10 @@ class SandboxEnvironmentTemplate(_common.BaseModel):
1787317896
default=None,
1787417897
description="""Optional. The configuration for private ingress (PSC-E) of this template. When set, the sandbox router is exposed privately via a PSC service attachment so VPC-SC customers can connect from their VPC over a private endpoint instead of the public internet. The resulting service attachment is surfaced on `SandboxEnvironment.connection_info.service_attachment`. Only the PSC-E (service-attachment/ingress) portion of `PrivateServiceConnectConfig` applies here: `enable_private_service_connect` and `project_allowlist` (the consumer projects allowed to connect). The nested `psc_interface_config` (PSC-I / egress) is not used for sandbox ingress; sandbox egress is configured via `egress_control_config` instead.""",
1787517898
)
17899+
use_gke_td: Optional[bool] = Field(
17900+
default=None,
17901+
description="""Optional. Immutable. Whether to provision the SandboxEnvironmentTemplate via the GKE TD pool.""",
17902+
)
1787617903

1787717904

1787817905
class SandboxEnvironmentTemplateDict(TypedDict, total=False):
@@ -17909,6 +17936,9 @@ class SandboxEnvironmentTemplateDict(TypedDict, total=False):
1790917936
ingress_control_config: Optional[PrivateServiceConnectConfigDict]
1791017937
"""Optional. The configuration for private ingress (PSC-E) of this template. When set, the sandbox router is exposed privately via a PSC service attachment so VPC-SC customers can connect from their VPC over a private endpoint instead of the public internet. The resulting service attachment is surfaced on `SandboxEnvironment.connection_info.service_attachment`. Only the PSC-E (service-attachment/ingress) portion of `PrivateServiceConnectConfig` applies here: `enable_private_service_connect` and `project_allowlist` (the consumer projects allowed to connect). The nested `psc_interface_config` (PSC-I / egress) is not used for sandbox ingress; sandbox egress is configured via `egress_control_config` instead."""
1791117938

17939+
use_gke_td: Optional[bool]
17940+
"""Optional. Immutable. Whether to provision the SandboxEnvironmentTemplate via the GKE TD pool."""
17941+
1791217942

1791317943
SandboxEnvironmentTemplateOrDict = Union[
1791417944
SandboxEnvironmentTemplate, SandboxEnvironmentTemplateDict
@@ -18340,6 +18370,10 @@ class SandboxEnvironmentSnapshot(_common.BaseModel):
1834018370
default=None,
1834118371
description="""Output only. The timestamp when this SandboxEnvironment was most recently updated.""",
1834218372
)
18373+
use_gke_td: Optional[bool] = Field(
18374+
default=None,
18375+
description="""Output only. Whether the source SandboxEnvironment uses the GKE TD pool.""",
18376+
)
1834318377

1834418378

1834518379
class SandboxEnvironmentSnapshotDict(TypedDict, total=False):
@@ -18379,6 +18413,9 @@ class SandboxEnvironmentSnapshotDict(TypedDict, total=False):
1837918413
update_time: Optional[datetime.datetime]
1838018414
"""Output only. The timestamp when this SandboxEnvironment was most recently updated."""
1838118415

18416+
use_gke_td: Optional[bool]
18417+
"""Output only. Whether the source SandboxEnvironment uses the GKE TD pool."""
18418+
1838218419

1838318420
SandboxEnvironmentSnapshotOrDict = Union[
1838418421
SandboxEnvironmentSnapshot, SandboxEnvironmentSnapshotDict
@@ -20965,6 +21002,10 @@ class SchemaPromptSpecAppBuilderData(_common.BaseModel):
2096521002
description="""Linked resources attached to the application by the user.""",
2096621003
)
2096721004
)
21005+
deployed_regions: Optional[list[str]] = Field(
21006+
default=None,
21007+
description="""Optional. The Cloud Run regions in which the application is currently deployed. Used to rediscover and redeploy the app in the regions it already runs in, which may differ from the prompt's location.""",
21008+
)
2096821009

2096921010

2097021011
class SchemaPromptSpecAppBuilderDataDict(TypedDict, total=False):
@@ -20979,6 +21020,9 @@ class SchemaPromptSpecAppBuilderDataDict(TypedDict, total=False):
2097921020
linked_resources: Optional[list[SchemaPromptSpecAppBuilderDataLinkedResourceDict]]
2098021021
"""Linked resources attached to the application by the user."""
2098121022

21023+
deployed_regions: Optional[list[str]]
21024+
"""Optional. The Cloud Run regions in which the application is currently deployed. Used to rediscover and redeploy the app in the regions it already runs in, which may differ from the prompt's location."""
21025+
2098221026

2098321027
SchemaPromptSpecAppBuilderDataOrDict = Union[
2098421028
SchemaPromptSpecAppBuilderData, SchemaPromptSpecAppBuilderDataDict
@@ -28666,33 +28710,33 @@ class AudioTranscriptionWordInfoDict(TypedDict, total=False):
2866628710

2866728711

2866828712
class AudioTranscription(_common.BaseModel):
28669-
"""The transcription of an audio part. For multi-speaker audio, each speaker segment is a separate Part with its own AudioTranscription carrying the speaker_label."""
28713+
"""The transcription of an audio part. For multi-speaker audio, each speaker segment is a separate `Part` with its own `AudioTranscription` carrying the `speaker_label`."""
2867028714

2867128715
speaker_label: Optional[str] = Field(
2867228716
default=None,
28673-
description="""Optional. A label identifying the speaker of this audio segment (e.g. "spk_1", "spk_2"). Present when diarization is set.""",
28717+
description="""Optional. A label identifying the speaker of this audio segment (e.g. `spk_1`, `spk_2`). Present when `diarization` is set.""",
2867428718
)
2867528719
text: Optional[str] = Field(
2867628720
default=None,
2867728721
description="""Required. The transcription text of this audio segment.""",
2867828722
)
2867928723
words: Optional[list[AudioTranscriptionWordInfo]] = Field(
2868028724
default=None,
28681-
description="""Optional. Detailed word-level transcriptions and timing details. Present when word_timestamp is set.""",
28725+
description="""Optional. Detailed word-level transcriptions and timing details. Present when `word_timestamp` is set.""",
2868228726
)
2868328727

2868428728

2868528729
class AudioTranscriptionDict(TypedDict, total=False):
28686-
"""The transcription of an audio part. For multi-speaker audio, each speaker segment is a separate Part with its own AudioTranscription carrying the speaker_label."""
28730+
"""The transcription of an audio part. For multi-speaker audio, each speaker segment is a separate `Part` with its own `AudioTranscription` carrying the `speaker_label`."""
2868728731

2868828732
speaker_label: Optional[str]
28689-
"""Optional. A label identifying the speaker of this audio segment (e.g. "spk_1", "spk_2"). Present when diarization is set."""
28733+
"""Optional. A label identifying the speaker of this audio segment (e.g. `spk_1`, `spk_2`). Present when `diarization` is set."""
2869028734

2869128735
text: Optional[str]
2869228736
"""Required. The transcription text of this audio segment."""
2869328737

2869428738
words: Optional[list[AudioTranscriptionWordInfoDict]]
28695-
"""Optional. Detailed word-level transcriptions and timing details. Present when word_timestamp is set."""
28739+
"""Optional. Detailed word-level transcriptions and timing details. Present when `word_timestamp` is set."""
2869628740

2869728741

2869828742
AudioTranscriptionOrDict = Union[AudioTranscription, AudioTranscriptionDict]

0 commit comments

Comments
 (0)