Skip to content

Commit df3ff43

Browse files
authored
Merge branch 'main' into jscpd-fixes
2 parents 0891528 + c6436ee commit df3ff43

File tree

23 files changed

+434
-219
lines changed

23 files changed

+434
-219
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
excinfo
2+
GVsb
3+
notif
4+
otherurl

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ __pycache__
88
.venv
99
coverage.xml
1010
.nox
11+
spec.json

.ruff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
line-length = 80 # Google Style Guide §3.2: 80 columns
1010
indent-width = 4 # Google Style Guide §3.4: 4 spaces
1111

12-
target-version = "py310" # Minimum Python version
12+
target-version = "py313" # Minimum Python version
1313

1414
[lint]
1515
ignore = [

development.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Development
2+
3+
## Type generation from spec
4+
5+
<!-- TODO replace spec.json with the public url so we always get the latest version-->
6+
7+
```bash
8+
uv run datamodel-codegen --input ./spec.json --input-file-type jsonschema --output ./src/a2a/types.py --target-python-version 3.10 --output-model-type pydantic_v2.BaseModel --disable-timestamp --use-schema-description --use-union-operator --use-field-description --use-default --use-default-kwarg --use-one-literal-as-default --class-name A2A --use-standard-collections
9+
```

examples/google_adk/birthday_planner/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This agent helps plan birthday parties. It has access to a Calendar Agent that i
66

77
## Prerequisites
88

9-
- Python 3.9 or higher
9+
- Python 3.13 or higher
1010
- [UV](https://docs.astral.sh/uv/)
1111
- A Gemini API Key
1212

examples/google_adk/birthday_planner/__main__.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,13 @@
66
import click
77
import uvicorn
88

9-
from adk_agent_executor import ADKAgentExecutor
9+
from adk_agent_executor import ADKAgentExecutor # type: ignore[import-untyped]
1010
from dotenv import load_dotenv
1111

1212
from a2a.server.apps import A2AStarletteApplication
1313
from a2a.server.request_handlers import DefaultRequestHandler
1414
from a2a.server.tasks import InMemoryTaskStore
15-
from a2a.types import (
16-
AgentAuthentication,
17-
AgentCapabilities,
18-
AgentCard,
19-
AgentSkill,
20-
)
15+
from a2a.types import AgentCapabilities, AgentCard, AgentSkill
2116

2217

2318
load_dotenv()
@@ -69,7 +64,6 @@ def main(host: str, port: int, calendar_agent: str):
6964
defaultOutputModes=['text'],
7065
capabilities=AgentCapabilities(streaming=True),
7166
skills=[skill],
72-
authentication=AgentAuthentication(schemes=['public']),
7367
)
7468
request_handler = DefaultRequestHandler(
7569
agent_executor=agent_executor, task_store=InMemoryTaskStore()

examples/google_adk/calendar_agent/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This example shows how to create an A2A Server that uses an ADK-based Agent that
44

55
## Prerequisites
66

7-
- Python 3.9 or higher
7+
- Python 3.13 or higher
88
- [UV](https://docs.astral.sh/uv/)
99
- A Gemini API Key
1010
- A [Google OAuth Client](https://developers.google.com/identity/openid-connect/openid-connect#getcredentials)

examples/google_adk/calendar_agent/__main__.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@
44
import click
55
import uvicorn
66

7-
from adk_agent import create_agent
8-
from adk_agent_executor import ADKAgentExecutor
7+
from adk_agent import create_agent # type: ignore[import-not-found]
8+
from adk_agent_executor import ADKAgentExecutor # type: ignore[import-untyped]
99
from dotenv import load_dotenv
10-
from google.adk.artifacts import InMemoryArtifactService
11-
from google.adk.memory.in_memory_memory_service import InMemoryMemoryService
12-
from google.adk.runners import Runner
13-
from google.adk.sessions import InMemorySessionService
10+
from google.adk.artifacts import (
11+
InMemoryArtifactService, # type: ignore[import-untyped]
12+
)
13+
from google.adk.memory.in_memory_memory_service import (
14+
InMemoryMemoryService, # type: ignore[import-untyped]
15+
)
16+
from google.adk.runners import Runner # type: ignore[import-untyped]
17+
from google.adk.sessions import (
18+
InMemorySessionService, # type: ignore[import-untyped]
19+
)
1420
from starlette.applications import Starlette
1521
from starlette.requests import Request
1622
from starlette.responses import PlainTextResponse
@@ -19,12 +25,7 @@
1925
from a2a.server.apps import A2AStarletteApplication
2026
from a2a.server.request_handlers import DefaultRequestHandler
2127
from a2a.server.tasks import InMemoryTaskStore
22-
from a2a.types import (
23-
AgentAuthentication,
24-
AgentCapabilities,
25-
AgentCard,
26-
AgentSkill,
27-
)
28+
from a2a.types import AgentCapabilities, AgentCard, AgentSkill
2829

2930

3031
load_dotenv()
@@ -63,7 +64,6 @@ def main(host: str, port: int):
6364
defaultOutputModes=['text'],
6465
capabilities=AgentCapabilities(streaming=True),
6566
skills=[skill],
66-
authentication=AgentAuthentication(schemes=['public']),
6767
)
6868

6969
adk_agent = create_agent(
@@ -81,7 +81,7 @@ def main(host: str, port: int):
8181

8282
async def handle_auth(request: Request) -> PlainTextResponse:
8383
await agent_executor.on_auth_callback(
84-
request.query_params.get('state'), str(request.url)
84+
str(request.query_params.get('state')), str(request.url)
8585
)
8686
return PlainTextResponse('Authentication successful.')
8787

examples/google_adk/calendar_agent/adk_agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import datetime
22

3-
from google.adk.agents import LlmAgent
4-
from google.adk.tools.google_api_tool import calendar_tool_set
3+
from google.adk.agents import LlmAgent # type: ignore[import-untyped]
4+
from google.adk.tools.google_api_tool import calendar_tool_set # type: ignore[import-untyped]
55

66

77
def create_agent(client_id, client_secret) -> LlmAgent:

examples/helloworld/__main__.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
from agent_executor import HelloWorldAgentExecutor
1+
from agent_executor import (
2+
HelloWorldAgentExecutor, # type: ignore[import-untyped]
3+
)
24

35
from a2a.server.apps import A2AStarletteApplication
46
from a2a.server.request_handlers import DefaultRequestHandler
57
from a2a.server.tasks import InMemoryTaskStore
6-
from a2a.types import (
7-
AgentAuthentication,
8-
AgentCapabilities,
9-
AgentCard,
10-
AgentSkill,
11-
)
8+
from a2a.types import AgentCapabilities, AgentCard, AgentSkill
129

1310

1411
if __name__ == '__main__':
@@ -29,7 +26,6 @@
2926
defaultOutputModes=['text'],
3027
capabilities=AgentCapabilities(streaming=True),
3128
skills=[skill],
32-
authentication=AgentAuthentication(schemes=['public']),
3329
)
3430

3531
request_handler = DefaultRequestHandler(

0 commit comments

Comments
 (0)