Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 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
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ dependencies = [
"httpx>=0.28.1",
"httpx-sse>=0.4.0",
"pydantic>=2.11.3",
"protobuf>=5.29.5",
"google-api-core>=1.26.0",
]

classifiers = [
Expand All @@ -29,9 +27,12 @@ classifiers = [
]

[project.optional-dependencies]
http-server = ["fastapi>=0.115.2", "sse-starlette", "starlette"]
proto = ["protobuf>=5.29.5"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure protobuf really needs to be a separate dependency group from grpc

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can remove the extra altogether if you want to be explicit for the REST and gRPC servers. My goal was removing protobuf dependencies especially for JSON-RPC servers + clients.

If you prefer can do:

jsonrpc-server = ["fastapi>=0.115.2", "sse-starlette", "starlette"]
http-server = ["a2a-sdk[jsonrpc-server]", "protobuf>=5.29.5"]
grpc = ["grpcio>=1.60", "grpcio-tools>=1.60", "grpcio_reflection>=1.7.0", "google-api-core>=1.26.0", "protobuf>=5.29.5"]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http-server is a bit confusing naming of the extra now that JSON-RPC is split out but needed for backward compatibility

jsonrpc-server = ["fastapi>=0.115.2", "sse-starlette", "starlette"]
rest-server = ["fastapi>=0.115.2", "sse-starlette", "starlette", "a2a-sdk[proto]"]
http-server = ["a2a-sdk[jsonrpc-server]", "a2a-sdk[rest-server]"]
encryption = ["cryptography>=43.0.0"]
grpc = ["grpcio>=1.60", "grpcio-tools>=1.60", "grpcio_reflection>=1.7.0"]
grpc = ["grpcio>=1.60", "grpcio-tools>=1.60", "grpcio_reflection>=1.7.0", "google-api-core>=1.26.0", "a2a-sdk[proto]"]
telemetry = ["opentelemetry-api>=1.33.0", "opentelemetry-sdk>=1.33.0"]
postgresql = ["sqlalchemy[asyncio,postgresql-asyncpg]>=2.0.0"]
mysql = ["sqlalchemy[asyncio,aiomysql]>=2.0.0"]
Expand Down
8 changes: 7 additions & 1 deletion src/a2a/utils/proto_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@

from typing import Any

from google.protobuf import json_format, struct_pb2

try:
from google.protobuf import json_format, struct_pb2
except ImportError as e:
raise ImportError(
'proto-utils requires protobuf. Install with "pip install a2a-sdk[proto]"'
) from e

from a2a import types
from a2a.grpc import a2a_pb2
Expand Down
Loading