Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions vertexai/_genai/agent_engines.py
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,18 @@ def _create_config(
agent=agent,
)
)

if hasattr(agent, "agent_card"):
agent_card = getattr(agent, "agent_card")
if agent_card:
try:
agent_engine_spec["agent_card"] = agent_card.model_dump(
exclude_none=True
)
except TypeError as e:
raise ValueError(
f"Failed to convert agent card to dict (serialization error): {e}"
) from e
update_masks.append("spec.agent_framework")

if identity_type is not None or service_account is not None:
Expand Down
7 changes: 7 additions & 0 deletions vertexai/_genai/types/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4797,6 +4797,10 @@ class ReasoningEngineSpecSourceCodeSpecDict(TypedDict, total=False):
class ReasoningEngineSpec(_common.BaseModel):
"""The specification of an agent engine."""

agent_card: Optional[dict[str, Any]] = Field(
default=None,
description="""Optional. The A2A Agent Card for the agent (if available). It follows the specification at https://a2a-protocol.org/latest/specification/#5-agent-discovery-the-agent-card.""",
)
agent_framework: Optional[str] = Field(
default=None,
description="""Optional. The OSS agent framework used to develop the agent. Currently supported values: "google-adk", "langchain", "langgraph", "ag2", "llama-index", "custom".""",
Expand Down Expand Up @@ -4834,6 +4838,9 @@ class ReasoningEngineSpec(_common.BaseModel):
class ReasoningEngineSpecDict(TypedDict, total=False):
"""The specification of an agent engine."""

agent_card: Optional[dict[str, Any]]
"""Optional. The A2A Agent Card for the agent (if available). It follows the specification at https://a2a-protocol.org/latest/specification/#5-agent-discovery-the-agent-card."""

agent_framework: Optional[str]
"""Optional. The OSS agent framework used to develop the agent. Currently supported values: "google-adk", "langchain", "langgraph", "ag2", "llama-index", "custom"."""

Expand Down
Loading