Skip to content

Commit 8c240ca

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
feat: add agent_card to agent engine spec
PiperOrigin-RevId: 821726573
1 parent f0a4a00 commit 8c240ca

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-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: 9 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's capabilities.""",
4931+
)
49284932

49294933

49304934
class ReasoningEngineSpecDict(TypedDict, total=False):
@@ -4945,6 +4949,11 @@ 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] = Field(
4953+
default=None,
4954+
description="""Optional. The A2A agent card that describes the agent's capabilities.""",
4955+
)
4956+
49484957

49494958
ReasoningEngineSpecOrDict = Union[ReasoningEngineSpec, ReasoningEngineSpecDict]
49504959

0 commit comments

Comments
 (0)