Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d356c0b
feat: Update to support python 3.12
pstephengoogle May 22, 2025
fd0ec5a
Change to 3.10 and provided detailed description about event queue usage
pstephengoogle May 22, 2025
6bd1d44
fix merge conflict
pstephengoogle May 22, 2025
b7964cf
Fix typo
pstephengoogle May 22, 2025
22a6230
Add gRPC based support in the SDK.
pstephengoogle Jun 4, 2025
f81a002
Update pyproject.toml
pstephengoogle Jun 4, 2025
cd752b9
feat: Update to support python 3.12
pstephengoogle May 22, 2025
850ef3c
Change to 3.10 and provided detailed description about event queue usage
pstephengoogle May 22, 2025
85472d9
fix merge conflict
pstephengoogle May 22, 2025
3526a2a
Fix typo
pstephengoogle May 22, 2025
d7e3bce
Add gRPC based support in the SDK.
pstephengoogle Jun 4, 2025
a068140
Update pyproject.toml
pstephengoogle Jun 4, 2025
27b1339
Add spelling fixes/excludes
holtskinner Jun 4, 2025
fccf31e
Merge branch 'main' into updates
holtskinner Jun 4, 2025
693bfc6
Add grpc directory to jscpd ignore
holtskinner Jun 4, 2025
e94a9fc
spelling/linting
holtskinner Jun 4, 2025
feaa218
Exclude grpc/ directory
holtskinner Jun 4, 2025
52117a7
Update JSCPD to ignore `/src/a2a/grpc/**`
holtskinner Jun 4, 2025
50539f4
Add google.api dependencies
pstephengoogle Jun 5, 2025
7cdef10
Merge branch 'updates' of https://github.com/google/a2a-python into u…
pstephengoogle Jun 5, 2025
29ec4d4
Fix lint/typing errors
pstephengoogle Jun 6, 2025
4d72700
Fix more lint errors
pstephengoogle Jun 6, 2025
a427f15
Yet more lint/mypy fixes
pstephengoogle Jun 6, 2025
83fdeaf
Update Linter and nox formatter to exclude grpc/ directory
holtskinner Jun 6, 2025
a19fddb
Fix formatting
holtskinner Jun 6, 2025
7bd25ab
Ignore Docstring error in `proto_utils.py`
holtskinner Jun 6, 2025
c83f329
Lint fixes (ruff `unsafe-fixes`)
holtskinner Jun 6, 2025
feff2d7
Fix ruff errors
pstephengoogle Jun 6, 2025
a44ab73
Additional ruff/mypy fixes
pstephengoogle Jun 6, 2025
434b7fa
Update .ruff.toml to exclude a few rules for a few files
pstephengoogle Jun 6, 2025
2e0c176
More ruff rules
pstephengoogle Jun 6, 2025
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
Prev Previous commit
Next Next commit
Fix ruff errors
  • Loading branch information
pstephengoogle committed Jun 6, 2025
commit feff2d744f3dcd449006b75c99c7516aec9c57d1
7 changes: 5 additions & 2 deletions src/a2a/server/request_handlers/grpc_handler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ruff: noqa: N802
import contextlib
import logging

Expand Down Expand Up @@ -55,7 +56,7 @@ def __init__(
self,
agent_card: AgentCard,
request_handler: RequestHandler,
context_builder: CallContextBuilder = DefaultCallContextBuilder(),
context_builder: CallContextBuilder | None = None
):
"""Initializes the GrpcHandler.

Expand All @@ -66,7 +67,7 @@ def __init__(
"""
self.agent_card = agent_card
self.request_handler = request_handler
self.context_builder = context_builder
self.context_builder = context_builder or DefaultCallContextBuilder()

async def SendMessage(
self,
Expand Down Expand Up @@ -295,11 +296,13 @@ async def GetAgentCard(
request: a2a_pb2.GetAgentCardRequest,
context: grpc.aio.ServicerContext,
) -> a2a_pb2.AgentCard:
"""Get the agent card for the agent served."""
return proto_utils.ToProto.agent_card(self.agent_card)

async def abort_context(
self, error: ServerError, context: grpc.ServicerContext
) -> None:
"""Sets the grpc errors appropriately in the context."""
match error.error:
case types.JSONParseError():
await context.abort(
Expand Down