Skip to content

Commit ad470da

Browse files
fix: AgentCardBuilder field inconsistencies
1 parent 13ff009 commit ad470da

File tree

1 file changed

+18
-21
lines changed

1 file changed

+18
-21
lines changed

src/google/adk/a2a/utils/agent_card_builder.py

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ def __init__(
5959
agent: BaseAgent,
6060
rpc_url: Optional[str] = None,
6161
capabilities: Optional[AgentCapabilities] = None,
62-
doc_url: Optional[str] = None,
6362
provider: Optional[AgentProvider] = None,
6463
agent_version: Optional[str] = None,
6564
security_schemes: Optional[Dict[str, SecurityScheme]] = None,
@@ -70,7 +69,6 @@ def __init__(
7069
self._agent = agent
7170
self._rpc_url = rpc_url or 'http://localhost:80/a2a'
7271
self._capabilities = capabilities or AgentCapabilities()
73-
self._doc_url = doc_url
7472
self._provider = provider
7573
self._security_schemes = security_schemes
7674
self._agent_version = agent_version or '0.0.1'
@@ -85,16 +83,15 @@ async def build(self) -> AgentCard:
8583
return AgentCard(
8684
name=self._agent.name,
8785
description=self._agent.description or 'An ADK Agent',
88-
doc_url=self._doc_url,
8986
url=f"{self._rpc_url.rstrip('/')}",
9087
version=self._agent_version,
9188
capabilities=self._capabilities,
9289
skills=all_skills,
93-
defaultInputModes=['text/plain'],
94-
defaultOutputModes=['text/plain'],
95-
supportsAuthenticatedExtendedCard=False,
90+
default_input_modes=['text/plain'],
91+
default_output_modes=['text/plain'],
92+
supports_authenticated_extended_card=False,
9693
provider=self._provider,
97-
securitySchemes=self._security_schemes,
94+
security_schemes=self._security_schemes,
9895
)
9996
except Exception as e:
10097
raise RuntimeError(
@@ -125,8 +122,8 @@ async def _build_llm_agent_skills(agent: LlmAgent) -> List[AgentSkill]:
125122
name='model',
126123
description=agent_description,
127124
examples=agent_examples,
128-
inputModes=_get_input_modes(agent),
129-
outputModes=_get_output_modes(agent),
125+
input_modes=_get_input_modes(agent),
126+
output_modes=_get_output_modes(agent),
130127
tags=['llm'],
131128
)
132129
)
@@ -160,8 +157,8 @@ async def _build_sub_agent_skills(agent: BaseAgent) -> List[AgentSkill]:
160157
name=f'{sub_agent.name}: {skill.name}',
161158
description=skill.description,
162159
examples=skill.examples,
163-
inputModes=skill.inputModes,
164-
outputModes=skill.outputModes,
160+
input_modes=skill.input_modes,
161+
output_modes=skill.output_modes,
165162
tags=[f'sub_agent:{sub_agent.name}'] + (skill.tags or []),
166163
)
167164
sub_agent_skills.append(aggregated_skill)
@@ -197,8 +194,8 @@ async def _build_tool_skills(agent: LlmAgent) -> List[AgentSkill]:
197194
name=tool_name,
198195
description=getattr(tool, 'description', f'Tool: {tool_name}'),
199196
examples=None,
200-
inputModes=None,
201-
outputModes=None,
197+
input_modes=None,
198+
output_modes=None,
202199
tags=['llm', 'tools'],
203200
)
204201
)
@@ -213,8 +210,8 @@ def _build_planner_skill(agent: LlmAgent) -> AgentSkill:
213210
name='planning',
214211
description='Can think about the tasks to do and make plans',
215212
examples=None,
216-
inputModes=None,
217-
outputModes=None,
213+
input_modes=None,
214+
output_modes=None,
218215
tags=['llm', 'planning'],
219216
)
220217

@@ -226,8 +223,8 @@ def _build_code_executor_skill(agent: LlmAgent) -> AgentSkill:
226223
name='code-execution',
227224
description='Can execute codes',
228225
examples=None,
229-
inputModes=None,
230-
outputModes=None,
226+
input_modes=None,
227+
output_modes=None,
231228
tags=['llm', 'code_execution'],
232229
)
233230

@@ -250,8 +247,8 @@ async def _build_non_llm_agent_skills(agent: BaseAgent) -> List[AgentSkill]:
250247
name=agent_name,
251248
description=agent_description,
252249
examples=agent_examples,
253-
inputModes=_get_input_modes(agent),
254-
outputModes=_get_output_modes(agent),
250+
input_modes=_get_input_modes(agent),
251+
output_modes=_get_output_modes(agent),
255252
tags=[agent_type],
256253
)
257254
)
@@ -282,8 +279,8 @@ def _build_orchestration_skill(
282279
name='sub-agents',
283280
description='Orchestrates: ' + '; '.join(sub_agent_descriptions),
284281
examples=None,
285-
inputModes=None,
286-
outputModes=None,
282+
input_modes=None,
283+
output_modes=None,
287284
tags=[agent_type, 'orchestration'],
288285
)
289286

0 commit comments

Comments
 (0)