Skip to content

Commit 7007455

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
feat: add agent_card to agent engine spec
PiperOrigin-RevId: 821726573
1 parent 55b7c23 commit 7007455

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

vertexai/_genai/agent_engines.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,14 @@ def _create_config(
10761076
_agent_engines_utils._get_agent_framework(agent=agent)
10771077
)
10781078
update_masks.append("spec.agent_framework")
1079+
1080+
if hasattr(agent, "agent_card"):
1081+
agent_card = getattr(agent, "agent_card")
1082+
if agent_card:
1083+
agent_engine_spec["agent_card"] = _agent_engines_utils._to_proto(
1084+
agent_card
1085+
)
1086+
10791087
config["spec"] = agent_engine_spec
10801088
if update_masks and mode == "update":
10811089
config["update_mask"] = ",".join(update_masks)

vertexai/_genai/types.py

Lines changed: 7 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

0 commit comments

Comments
 (0)