Skip to content

Commit 13ffdd9

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
feat: add agent_card to agent engine spec
PiperOrigin-RevId: 821726573
1 parent 7ae013e commit 13ffdd9

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

vertexai/_genai/agent_engines.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,11 @@ def _create_config(
10761076
_agent_engines_utils._get_agent_framework(agent=agent)
10771077
)
10781078
update_masks.append("spec.agent_framework")
1079+
1080+
agent_engine_spec["agent_card"] = getattr(
1081+
getattr(agent, "agent_card", None), "model_dump_json", lambda: None
1082+
)()
1083+
10791084
config["spec"] = agent_engine_spec
10801085
if update_masks and mode == "update":
10811086
config["update_mask"] = ",".join(update_masks)

vertexai/_genai/types.py

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4925,6 +4925,10 @@ class ReasoningEngineSpec(_common.BaseModel):
49254925
default=None,
49264926
description="""Optional. The service account that the Reasoning Engine artifact runs as. It should have "roles/storage.objectViewer" for reading the user project's Cloud Storage and "roles/aiplatform.user" for using Vertex extensions. If not specified, the Vertex AI Reasoning Engine Service Agent in the project will be used.""",
49274927
)
4928+
agent_card: Optional[str] = Field(
4929+
default=None,
4930+
description="""Optional. The A2A Agent Card that describes the agent capabilities.""",
4931+
)
49284932

49294933

49304934
class ReasoningEngineSpecDict(TypedDict, total=False):
@@ -4945,6 +4949,9 @@ class ReasoningEngineSpecDict(TypedDict, total=False):
49454949
service_account: Optional[str]
49464950
"""Optional. The service account that the Reasoning Engine artifact runs as. It should have "roles/storage.objectViewer" for reading the user project's Cloud Storage and "roles/aiplatform.user" for using Vertex extensions. If not specified, the Vertex AI Reasoning Engine Service Agent in the project will be used."""
49474951

4952+
agent_card: Optional[str]
4953+
"""Optional. The A2A Agent Card that describes the agent capabilities."""
4954+
49484955

49494956
ReasoningEngineSpecOrDict = Union[ReasoningEngineSpec, ReasoningEngineSpecDict]
49504957

@@ -7834,12 +7841,33 @@ class SandboxEnvironmentSpecCodeExecutionEnvironmentDict(TypedDict, total=False)
78347841
]
78357842

78367843

7844+
class SandboxEnvironmentSpecComputerUseEnvironment(_common.BaseModel):
7845+
"""The computer use environment with customized settings."""
7846+
7847+
pass
7848+
7849+
7850+
class SandboxEnvironmentSpecComputerUseEnvironmentDict(TypedDict, total=False):
7851+
"""The computer use environment with customized settings."""
7852+
7853+
pass
7854+
7855+
7856+
SandboxEnvironmentSpecComputerUseEnvironmentOrDict = Union[
7857+
SandboxEnvironmentSpecComputerUseEnvironment,
7858+
SandboxEnvironmentSpecComputerUseEnvironmentDict,
7859+
]
7860+
7861+
78377862
class SandboxEnvironmentSpec(_common.BaseModel):
78387863
"""The specification of a sandbox environment."""
78397864

78407865
code_execution_environment: Optional[
78417866
SandboxEnvironmentSpecCodeExecutionEnvironment
78427867
] = Field(default=None, description="""Optional. The code execution environment.""")
7868+
computer_use_environment: Optional[SandboxEnvironmentSpecComputerUseEnvironment] = (
7869+
Field(default=None, description="""Optional. The computer use environment.""")
7870+
)
78437871

78447872

78457873
class SandboxEnvironmentSpecDict(TypedDict, total=False):
@@ -7850,6 +7878,9 @@ class SandboxEnvironmentSpecDict(TypedDict, total=False):
78507878
]
78517879
"""Optional. The code execution environment."""
78527880

7881+
computer_use_environment: Optional[SandboxEnvironmentSpecComputerUseEnvironmentDict]
7882+
"""Optional. The computer use environment."""
7883+
78537884

78547885
SandboxEnvironmentSpecOrDict = Union[SandboxEnvironmentSpec, SandboxEnvironmentSpecDict]
78557886

@@ -7927,9 +7958,47 @@ class _CreateAgentEngineSandboxRequestParametersDict(TypedDict, total=False):
79277958
]
79287959

79297960

7961+
class SandboxEnvironmentConnectionInfo(_common.BaseModel):
7962+
"""The connection information of the SandboxEnvironment."""
7963+
7964+
load_balancer_hostname: Optional[str] = Field(
7965+
default=None, description="""Output only. The hostname of the load balancer."""
7966+
)
7967+
load_balancer_ip: Optional[str] = Field(
7968+
default=None,
7969+
description="""Output only. The IP address of the load balancer.""",
7970+
)
7971+
sandbox_internal_ip: Optional[str] = Field(
7972+
default=None,
7973+
description="""Output only. The internal IP address of the SandboxEnvironment.""",
7974+
)
7975+
7976+
7977+
class SandboxEnvironmentConnectionInfoDict(TypedDict, total=False):
7978+
"""The connection information of the SandboxEnvironment."""
7979+
7980+
load_balancer_hostname: Optional[str]
7981+
"""Output only. The hostname of the load balancer."""
7982+
7983+
load_balancer_ip: Optional[str]
7984+
"""Output only. The IP address of the load balancer."""
7985+
7986+
sandbox_internal_ip: Optional[str]
7987+
"""Output only. The internal IP address of the SandboxEnvironment."""
7988+
7989+
7990+
SandboxEnvironmentConnectionInfoOrDict = Union[
7991+
SandboxEnvironmentConnectionInfo, SandboxEnvironmentConnectionInfoDict
7992+
]
7993+
7994+
79307995
class SandboxEnvironment(_common.BaseModel):
79317996
"""A sandbox environment."""
79327997

7998+
connection_info: Optional[SandboxEnvironmentConnectionInfo] = Field(
7999+
default=None,
8000+
description="""Output only. The connection information of the SandboxEnvironment.""",
8001+
)
79338002
create_time: Optional[datetime.datetime] = Field(
79348003
default=None,
79358004
description="""Output only. The timestamp when this SandboxEnvironment was created.""",
@@ -7962,6 +8031,9 @@ class SandboxEnvironment(_common.BaseModel):
79628031
class SandboxEnvironmentDict(TypedDict, total=False):
79638032
"""A sandbox environment."""
79648033

8034+
connection_info: Optional[SandboxEnvironmentConnectionInfoDict]
8035+
"""Output only. The connection information of the SandboxEnvironment."""
8036+
79658037
create_time: Optional[datetime.datetime]
79668038
"""Output only. The timestamp when this SandboxEnvironment was created."""
79678039

0 commit comments

Comments
 (0)