Skip to content

Commit e20489f

Browse files
fix: resolve spelling and linting issues
1 parent c535a6c commit e20489f

File tree

5 files changed

+47
-31
lines changed

5 files changed

+47
-31
lines changed

.github/actions/spelling/allow.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,19 @@ socio
3737
sse
3838
tagwords
3939
vulnz
40+
ASGI
41+
avancées
42+
dans
43+
dernières
44+
docstrings
45+
GPT
46+
gpt
47+
l'actualité
48+
llm
49+
LLMs
50+
m'appelle
51+
mcp
52+
mundo
53+
npx
54+
résultats
55+
éthiques

examples/google_adk/mcp_brave_search_agent/adk_agent_executor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ async def _upsert_session(self, session_id: str):
142142

143143

144144
def convert_a2a_parts_to_genai(parts: list[Part]) -> list[types.Part]:
145-
"""Converts a list of A2A Part objects to a list of Google GenAI Part objects."""
145+
"""Converts a list of A2A Part objects to a list of Google Gen AI Part objects."""
146146
return [convert_a2a_part_to_genai(part) for part in parts]
147147

148148

149149
def convert_a2a_part_to_genai(part: Part) -> types.Part:
150-
"""Converts a single A2A Part object to a Google GenAI Part object."""
150+
"""Converts a single A2A Part object to a Google Gen AI Part object."""
151151
part = part.root
152152
if isinstance(part, TextPart):
153153
return types.Part(text=part.text)
@@ -169,7 +169,7 @@ def convert_a2a_part_to_genai(part: Part) -> types.Part:
169169

170170

171171
def convert_genai_parts_to_a2a(parts: list[types.Part]) -> list[Part]:
172-
"""Converts a list of Google GenAI Part objects to a list of A2A Part objects."""
172+
"""Converts a list of Google Gen AI Part objects to a list of A2A Part objects."""
173173
return [
174174
convert_genai_part_to_a2a(part)
175175
for part in parts
@@ -178,7 +178,7 @@ def convert_genai_parts_to_a2a(parts: list[types.Part]) -> list[Part]:
178178

179179

180180
def convert_genai_part_to_a2a(part: types.Part) -> Part:
181-
"""Converts a single Google GenAI Part object to an A2A Part object."""
181+
"""Converts a single Google Gen AI Part object to an A2A Part object."""
182182
if part.text:
183183
return TextPart(text=part.text)
184184
if part.file_data:

examples/google_adk/search_agent/adk_agent_executor.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
from typing import Any
99
from uuid import uuid4 # For generating unique IDs
1010

11-
# 🔩 Third-party Library Imports: Google ADK and GenAI
11+
# 🔩 Third-party Library Imports: Google ADK and Gen AI
1212
from google.adk import Runner # Core ADK component for running agents
1313
from google.adk.agents import LlmAgent, RunConfig # ADK agent and run configuration
1414
from google.adk.artifacts import InMemoryArtifactService # For storing artifacts in memory
1515
from google.adk.events import Event # Represents events during agent execution
1616
from google.adk.memory.in_memory_memory_service import InMemoryMemoryService # For agent memory
1717
from google.adk.sessions import InMemorySessionService, Session # For managing agent sessions
1818
from google.adk.tools import BaseTool, ToolContext # Base for creating tools
19-
from google.genai import types as genai_types # Google GenAI specific types
19+
from google.genai import types as genai_types # Google Gen AI specific types
2020
from pydantic import ConfigDict # For Pydantic model configuration
2121

2222
# 🚀 A2A SDK Imports: Core components for A2A server and client interaction
@@ -88,7 +88,7 @@ def __init__(self):
8888
def _run_agent(
8989
self,
9090
session_id: str, # The ID of the current conversation session
91-
new_message: genai_types.Content, # The user's message, converted to Google GenAI format
91+
new_message: genai_types.Content, # The user's message, converted to Google Gen AI format
9292
task_updater: TaskUpdater, # A2A TaskUpdater, though not directly used in this ADK call
9393
) -> AsyncGenerator[Event, None]: # Returns an async generator of ADK Events
9494
"""
@@ -107,7 +107,7 @@ def _run_agent(
107107

108108
async def _process_request(
109109
self,
110-
new_message: genai_types.Content, # The user's message in Google GenAI format
110+
new_message: genai_types.Content, # The user's message in Google Gen AI format
111111
session_id: str, # The ID for the current session/conversation
112112
task_updater: TaskUpdater, # A2A TaskUpdater to send updates and artifacts
113113
) -> AsyncIterable[TaskStatus | Artifact]: # Note: This method doesn't directly yield; updates are via TaskUpdater
@@ -185,7 +185,7 @@ async def execute(
185185
# 🚦 Signal that the agent is starting to work on the task.
186186
updater.start_work() # Sends a 'task_started_working' event
187187

188-
# 📨 Convert the A2A message parts to Google GenAI `Content` format
188+
# 📨 Convert the A2A message parts to Google Gen AI `Content` format
189189
# and then process the request.
190190
# The `context.message.parts` contains the user's input.
191191
# `context.context_id` is used as the `session_id` for the ADK agent.
@@ -228,24 +228,24 @@ async def _upsert_session(self, session_id: str) -> Session:
228228
)
229229

230230

231-
# ↔️ Data Conversion Utilities: A2A <-> Google GenAI
231+
# ↔️ Data Conversion Utilities: A2A <-> Google Gen AI
232232

233233
def convert_a2a_parts_to_genai(parts: list[Part]) -> list[genai_types.Part]:
234234
"""
235-
🔄 Converts a list of A2A `Part` objects to a list of Google GenAI `Part` objects.
235+
🔄 Converts a list of A2A `Part` objects to a list of Google Gen AI `Part` objects.
236236
This is used to prepare user messages for the ADK agent.
237237
"""
238238
return [convert_a2a_part_to_genai(part) for part in parts]
239239

240240

241241
def convert_a2a_part_to_genai(part: Part) -> genai_types.Part:
242242
"""
243-
🔄 Converts a single A2A `Part` object to a Google GenAI `Part` object.
243+
🔄 Converts a single A2A `Part` object to a Google Gen AI `Part` object.
244244
Handles `TextPart` and `FilePart` (with URI or bytes).
245245
"""
246246
actual_part = part.root # A2A `Part` is a discriminated union, `root` holds the actual data.
247247
if isinstance(actual_part, TextPart):
248-
# 📄 Convert A2A TextPart to Google GenAI Text Part
248+
# 📄 Convert A2A TextPart to Google Gen AI Text Part
249249
return genai_types.Part(text=actual_part.text)
250250
if isinstance(actual_part, FilePart):
251251
# 📁 Convert A2A FilePart
@@ -258,7 +258,7 @@ def convert_a2a_part_to_genai(part: Part) -> genai_types.Part:
258258
)
259259
)
260260
if isinstance(actual_part.file, FileWithBytes):
261-
# 💾 File content as raw bytes, converted to Google GenAI Blob
261+
# 💾 File content as raw bytes, converted to Google Gen AI Blob
262262
return genai_types.Part(
263263
inline_data=genai_types.Blob(
264264
data=actual_part.file.bytes,
@@ -268,41 +268,41 @@ def convert_a2a_part_to_genai(part: Part) -> genai_types.Part:
268268
# Should not be reached if A2A types are used correctly
269269
raise ValueError(f'Unsupported A2A file type within FilePart: {type(actual_part.file)}')
270270
# Should not be reached if A2A types are used correctly
271-
raise ValueError(f'Unsupported A2A part type for GenAI conversion: {type(actual_part)}')
271+
raise ValueError(f'Unsupported A2A part type for Gen AI conversion: {type(actual_part)}')
272272

273273

274274
def convert_genai_parts_to_a2a(parts: list[genai_types.Part]) -> list[Part]:
275275
"""
276-
🔄 Converts a list of Google GenAI `Part` objects to a list of A2A `Part` objects.
276+
🔄 Converts a list of Google Gen AI `Part` objects to a list of A2A `Part` objects.
277277
This is used to process responses from the ADK agent.
278278
Filters out any parts that don't have recognized content.
279279
"""
280280
return [
281281
convert_genai_part_to_a2a(part)
282282
for part in parts
283-
# Ensure the GenAI part has content we can convert
283+
# Ensure the Gen AI part has content we can convert
284284
if (part.text or part.file_data or part.inline_data)
285285
]
286286

287287

288288
def convert_genai_part_to_a2a(part: genai_types.Part) -> Part:
289289
"""
290-
🔄 Converts a single Google GenAI `Part` object to an A2A `Part` object.
290+
🔄 Converts a single Google Gen AI `Part` object to an A2A `Part` object.
291291
Handles text, file data (URI), and inline data (bytes).
292292
"""
293293
if part.text:
294-
# 📄 Convert Google GenAI Text Part to A2A TextPart
294+
# 📄 Convert Google Gen AI Text Part to A2A TextPart
295295
return TextPart(text=part.text)
296296
if part.file_data:
297-
# 🔗 Convert Google GenAI FileData (URI) to A2A FilePart with FileWithUri
297+
# 🔗 Convert Google Gen AI FileData (URI) to A2A FilePart with FileWithUri
298298
return FilePart(
299299
file=FileWithUri(
300300
uri=part.file_data.file_uri,
301301
mime_type=part.file_data.mime_type,
302302
)
303303
)
304304
if part.inline_data:
305-
# 💾 Convert Google GenAI InlineData (Blob) to A2A FilePart with FileWithBytes
305+
# 💾 Convert Google Gen AI InlineData (Blob) to A2A FilePart with FileWithBytes
306306
# Note: A2A `Part` is a discriminated union, so we wrap FilePart in `Part(root=...)`
307307
return Part(
308308
root=FilePart(
@@ -313,4 +313,4 @@ def convert_genai_part_to_a2a(part: genai_types.Part) -> Part:
313313
)
314314
)
315315
# This should ideally not be reached if parts are pre-filtered in the calling function.
316-
raise ValueError(f'Unsupported Google GenAI part type for A2A conversion (empty or unknown): {part}')
316+
raise ValueError(f'Unsupported Google Gen AI part type for A2A conversion (empty or unknown): {part}')

examples/google_adk/spanish_translation_agent/adk_agent_executor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ async def _upsert_session(self, session_id: str):
143143

144144

145145
def convert_a2a_parts_to_genai(parts: list[Part]) -> list[genai_types.Part]:
146-
"""Converts a list of A2A Part objects to a list of Google GenAI Part objects."""
146+
"""Converts a list of A2A Part objects to a list of Google Gen AI Part objects."""
147147
return [convert_a2a_part_to_genai(part) for part in parts]
148148

149149

150150
def convert_a2a_part_to_genai(part: Part) -> genai_types.Part:
151-
"""Converts a single A2A Part object to a Google GenAI Part object."""
151+
"""Converts a single A2A Part object to a Google Gen AI Part object."""
152152
part = part.root
153153
if isinstance(part, TextPart):
154154
return genai_types.Part(text=part.text)
@@ -170,7 +170,7 @@ def convert_a2a_part_to_genai(part: Part) -> genai_types.Part:
170170

171171

172172
def convert_genai_parts_to_a2a(parts: list[genai_types.Part]) -> list[Part]:
173-
"""Converts a list of Google GenAI Part objects to a list of A2A Part objects."""
173+
"""Converts a list of Google Gen AI Part objects to a list of A2A Part objects."""
174174
return [
175175
convert_genai_part_to_a2a(part)
176176
for part in parts
@@ -179,7 +179,7 @@ def convert_genai_parts_to_a2a(parts: list[genai_types.Part]) -> list[Part]:
179179

180180

181181
def convert_genai_part_to_a2a(part: genai_types.Part) -> Part:
182-
"""Converts a single Google GenAI Part object to an A2A Part object."""
182+
"""Converts a single Google Gen AI Part object to an A2A Part object."""
183183
if part.text:
184184
return TextPart(text=part.text)
185185
if part.file_data:

examples/google_adk/translation_orchestrator_agent/adk_agent_executor.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ async def execute(
128128
updater.submit()
129129
updater.start_work()
130130

131-
# Convert the initial user message parts to GenAI format for the orchestrator agent.
131+
# Convert the initial user message parts to Gen AI format for the orchestrator agent.
132132
initial_user_message_parts = convert_a2a_parts_to_genai(context.message.parts)
133133

134134
await self._process_request(
@@ -150,12 +150,12 @@ async def _upsert_session(self, session_id: str):
150150

151151

152152
def convert_a2a_parts_to_genai(parts: list[Part]) -> list[genai_types.Part]:
153-
"""Converts a list of A2A Part objects to a list of Google GenAI Part objects."""
153+
"""Converts a list of A2A Part objects to a list of Google Gen AI Part objects."""
154154
return [convert_a2a_part_to_genai(part) for part in parts]
155155

156156

157157
def convert_a2a_part_to_genai(part: Part) -> genai_types.Part:
158-
"""Converts a single A2A Part object to a Google GenAI Part object."""
158+
"""Converts a single A2A Part object to a Google Gen AI Part object."""
159159
part = part.root
160160
if isinstance(part, TextPart):
161161
return genai_types.Part(text=part.text)
@@ -177,7 +177,7 @@ def convert_a2a_part_to_genai(part: Part) -> genai_types.Part:
177177

178178

179179
def convert_genai_parts_to_a2a(parts: list[genai_types.Part]) -> list[Part]:
180-
"""Converts a list of Google GenAI Part objects to a list of A2A Part objects."""
180+
"""Converts a list of Google Gen AI Part objects to a list of A2A Part objects."""
181181
return [
182182
convert_genai_part_to_a2a(part)
183183
for part in parts
@@ -186,7 +186,7 @@ def convert_genai_parts_to_a2a(parts: list[genai_types.Part]) -> list[Part]:
186186

187187

188188
def convert_genai_part_to_a2a(part: genai_types.Part) -> Part:
189-
"""Converts a single Google GenAI Part object to an A2A Part object."""
189+
"""Converts a single Google Gen AI Part object to an A2A Part object."""
190190
if part.text:
191191
return TextPart(text=part.text)
192192
if part.file_data:

0 commit comments

Comments
 (0)