Skip to content

Commit df36ec1

Browse files
brianstrauchclaude
andcommitted
Align AI samples on env-configurable address, path runs, modern typing
- Google ADK scripts read TEMPORAL_ADDRESS with a localhost:7233 default, as the Strands and LangGraph samples already do. - Google ADK docs invoke scripts by path (`uv run <dir>/run_worker.py`) rather than `uv run python -m <module>`, matching the other suites. - Strands samples use `str | None` instead of `Optional[str]`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 8aef024 commit df36ec1

21 files changed

Lines changed: 74 additions & 34 deletions

google_adk_agents/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ To run any scenario, start its worker in one terminal and its workflow starter
5252
in another:
5353

5454
```bash
55-
uv run python -m google_adk_agents.<scenario>.run_worker
56-
uv run python -m google_adk_agents.<scenario>.run_<name>_workflow
55+
uv run google_adk_agents/<scenario>/run_worker.py
56+
uv run google_adk_agents/<scenario>/run_<name>_workflow.py
5757
```

google_adk_agents/agent_patterns/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ Before running, review the [prerequisites in the suite README](../README.md)
1515
Start the worker in one terminal:
1616

1717
```bash
18-
uv run python -m google_adk_agents.agent_patterns.run_worker
18+
uv run google_adk_agents/agent_patterns/run_worker.py
1919
```
2020

2121
Then start the workflow in another terminal:
2222

2323
```bash
24-
uv run python -m google_adk_agents.agent_patterns.run_multi_agent_workflow
24+
uv run google_adk_agents/agent_patterns/run_multi_agent_workflow.py
2525
```
2626

2727
## What to expect

google_adk_agents/agent_patterns/run_multi_agent_workflow.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
import os
23

34
from temporalio.client import Client
45
from temporalio.contrib.google_adk_agents import GoogleAdkPlugin
@@ -9,7 +10,10 @@
910

1011

1112
async def main():
12-
client = await Client.connect("localhost:7233", plugins=[GoogleAdkPlugin()])
13+
client = await Client.connect(
14+
os.environ.get("TEMPORAL_ADDRESS", "localhost:7233"),
15+
plugins=[GoogleAdkPlugin()],
16+
)
1317

1418
result = await client.execute_workflow(
1519
MultiAgentWorkflow.run,

google_adk_agents/agent_patterns/run_worker.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import asyncio
4+
import os
45

56
from temporalio.client import Client
67
from temporalio.contrib.google_adk_agents import GoogleAdkPlugin
@@ -14,7 +15,9 @@
1415
async def main():
1516
plugin = GoogleAdkPlugin()
1617

17-
client = await Client.connect("localhost:7233", plugins=[plugin])
18+
client = await Client.connect(
19+
os.environ.get("TEMPORAL_ADDRESS", "localhost:7233"), plugins=[plugin]
20+
)
1821

1922
worker = Worker(
2023
client,

google_adk_agents/basic/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Before running, review the [prerequisites in the suite README](../README.md)
1717
Start the worker in one terminal:
1818

1919
```bash
20-
uv run python -m google_adk_agents.basic.run_worker
20+
uv run google_adk_agents/basic/run_worker.py
2121
```
2222

2323
Then start the workflow in another terminal:
2424

2525
```bash
26-
uv run python -m google_adk_agents.basic.run_hello_world_workflow
26+
uv run google_adk_agents/basic/run_hello_world_workflow.py
2727
```
2828

2929
## What to expect

google_adk_agents/basic/run_hello_world_workflow.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
import os
23

34
from temporalio.client import Client
45
from temporalio.contrib.google_adk_agents import GoogleAdkPlugin
@@ -10,7 +11,10 @@
1011

1112
async def main():
1213
# @@@SNIPSTART google-adk-agents-basic-starter
13-
client = await Client.connect("localhost:7233", plugins=[GoogleAdkPlugin()])
14+
client = await Client.connect(
15+
os.environ.get("TEMPORAL_ADDRESS", "localhost:7233"),
16+
plugins=[GoogleAdkPlugin()],
17+
)
1418

1519
result = await client.execute_workflow(
1620
HelloWorldAgentWorkflow.run,

google_adk_agents/basic/run_worker.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import asyncio
4+
import os
45

56
from temporalio.client import Client
67
from temporalio.contrib.google_adk_agents import GoogleAdkPlugin
@@ -15,7 +16,9 @@ async def main():
1516
# @@@SNIPSTART google-adk-agents-basic-worker
1617
plugin = GoogleAdkPlugin()
1718

18-
client = await Client.connect("localhost:7233", plugins=[plugin])
19+
client = await Client.connect(
20+
os.environ.get("TEMPORAL_ADDRESS", "localhost:7233"), plugins=[plugin]
21+
)
1922

2023
worker = Worker(
2124
client,

google_adk_agents/chatbot/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Before running, review the [prerequisites in the suite README](../README.md)
2121
Start the worker in one terminal:
2222

2323
```bash
24-
uv run python -m google_adk_agents.chatbot.run_worker
24+
uv run google_adk_agents/chatbot/run_worker.py
2525
```
2626

2727
Then start the interactive client in another terminal:
2828

2929
```bash
30-
uv run python -m google_adk_agents.chatbot.run_chatbot_workflow
30+
uv run google_adk_agents/chatbot/run_chatbot_workflow.py
3131
```
3232

3333
## What to expect

google_adk_agents/chatbot/run_chatbot_workflow.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
import os
23

34
from temporalio.client import Client
45
from temporalio.contrib.google_adk_agents import GoogleAdkPlugin
@@ -10,7 +11,10 @@
1011

1112
async def main():
1213
# @@@SNIPSTART google-adk-agents-chatbot-starter
13-
client = await Client.connect("localhost:7233", plugins=[GoogleAdkPlugin()])
14+
client = await Client.connect(
15+
os.environ.get("TEMPORAL_ADDRESS", "localhost:7233"),
16+
plugins=[GoogleAdkPlugin()],
17+
)
1418

1519
handle = await client.start_workflow(
1620
ChatbotAgentWorkflow.run,

google_adk_agents/chatbot/run_worker.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import asyncio
4+
import os
45

56
from temporalio.client import Client
67
from temporalio.contrib.google_adk_agents import GoogleAdkPlugin
@@ -15,7 +16,9 @@ async def main():
1516
# @@@SNIPSTART google-adk-agents-chatbot-worker
1617
plugin = GoogleAdkPlugin()
1718

18-
client = await Client.connect("localhost:7233", plugins=[plugin])
19+
client = await Client.connect(
20+
os.environ.get("TEMPORAL_ADDRESS", "localhost:7233"), plugins=[plugin]
21+
)
1922

2023
worker = Worker(
2124
client,

0 commit comments

Comments
 (0)