Skip to content

Commit 597c362

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
fix: update default input and output modes in create_agent_card
PiperOrigin-RevId: 833561382
1 parent 837c8ea commit 597c362

File tree

1 file changed

+8
-2
lines changed
  • vertexai/preview/reasoning_engines/templates

1 file changed

+8
-2
lines changed

vertexai/preview/reasoning_engines/templates/a2a.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ def create_agent_card(
5353
description: Optional[str] = None,
5454
skills: Optional[List["AgentSkill"]] = None,
5555
agent_card: Optional[Dict[str, Any]] = None,
56+
default_input_modes: Optional[List[str]] = None,
57+
default_output_modes: Optional[List[str]] = None,
5658
) -> "AgentCard":
5759
"""Creates an AgentCard object.
5860
@@ -67,6 +69,10 @@ def create_agent_card(
6769
description (Optional[str]): A description of the agent.
6870
skills (Optional[List[AgentSkill]]): A list of AgentSkills.
6971
agent_card (Optional[Dict[str, Any]]): Agent Card as a dictionary.
72+
default_input_modes (Optional[List[str]]): A list of input modes,
73+
default to ["text/plain"].
74+
default_output_modes (Optional[List[str]]): A list of output modes,
75+
default to ["application/json"].
7076
7177
Returns:
7278
AgentCard: A fully constructed AgentCard object.
@@ -88,8 +94,8 @@ def create_agent_card(
8894
description=description,
8995
url="http://localhost:9999/",
9096
version="1.0.0",
91-
default_input_modes=["text"],
92-
default_output_modes=["text"],
97+
default_input_modes=default_input_modes or ["text/plain"],
98+
default_output_modes=default_output_modes or ["application/json"],
9399
# Agent Engine does not support streaming yet
94100
capabilities=AgentCapabilities(streaming=False),
95101
skills=skills,

0 commit comments

Comments
 (0)