Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
* @temporalio/sdk
/langgraph_plugin/ @temporalio/sdk @temporalio/ai-sdk

# SDK & Nexus own the README, pyproject.toml, and uv.lock
/README.md @temporalio/sdk @temporalio/nexus
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ This is a collection of samples showing how to use the [Python SDK](https://gith
Prerequisites:

* [uv](https://docs.astral.sh/uv/)
* [Temporal CLI installed](https://docs.temporal.io/cli#install)
* [Local Temporal server running](https://docs.temporal.io/cli/server#start-dev)
* [Temporal CLI](https://docs.temporal.io/cli) with a local dev server running:
```
temporal server start-dev
```

The SDK requires Python >= 3.10. You can install Python using uv. For example,

Expand Down
6 changes: 5 additions & 1 deletion bedrock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ Demonstrates how Temporal and Amazon Bedrock can be used to quickly build bullet

1. An AWS account with Bedrock enabled.
2. A machine that has access to Bedrock.
3. A local Temporal server running on the same machine. See [Temporal's dev server docs](https://docs.temporal.io/cli#start-dev-server) for more information.
3. A local Temporal server running on the same machine, started with the [Temporal CLI](https://docs.temporal.io/cli):

```
temporal server start-dev
```

These examples use Amazon's Python SDK (Boto3). To configure Boto3 to use your AWS credentials, follow the instructions in [the Boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html).

Expand Down
2 changes: 1 addition & 1 deletion external_storage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on demand for the Temporal Web UI.
## Prerequisites

* [uv](https://docs.astral.sh/uv/)
* [Temporal CLI](https://docs.temporal.io/cli#install) with a local dev server running:
* [Temporal CLI](https://docs.temporal.io/cli) with a local dev server running:
```
temporal server start-dev
```
Expand Down
9 changes: 6 additions & 3 deletions google_adk_agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ model turn is durable and observable.

## Prerequisites

- Temporal server [running locally](https://docs.temporal.io/cli/server#start-dev)
- [Temporal CLI](https://docs.temporal.io/cli) with a local dev server running:
```
temporal server start-dev
```
- Dependencies installed via `uv sync --group google-adk`
- Google API key set as an environment variable:
`export GOOGLE_API_KEY=your_key_here`
Expand All @@ -49,6 +52,6 @@ To run any scenario, start its worker in one terminal and its workflow starter
in another:

```bash
uv run python -m google_adk_agents.<scenario>.run_worker
uv run python -m google_adk_agents.<scenario>.run_<name>_workflow
uv run google_adk_agents/<scenario>/run_worker.py
uv run google_adk_agents/<scenario>/run_<name>_workflow.py
```
4 changes: 2 additions & 2 deletions google_adk_agents/agent_patterns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ Before running, review the [prerequisites in the suite README](../README.md)
Start the worker in one terminal:

```bash
uv run python -m google_adk_agents.agent_patterns.run_worker
uv run google_adk_agents/agent_patterns/run_worker.py
```

Then start the workflow in another terminal:

```bash
uv run python -m google_adk_agents.agent_patterns.run_multi_agent_workflow
uv run google_adk_agents/agent_patterns/run_multi_agent_workflow.py
```

## What to expect
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio
import os

from temporalio.client import Client
from temporalio.contrib.google_adk_agents import GoogleAdkPlugin
Expand All @@ -9,7 +10,10 @@


async def main():
client = await Client.connect("localhost:7233", plugins=[GoogleAdkPlugin()])
client = await Client.connect(
os.environ.get("TEMPORAL_ADDRESS", "localhost:7233"),
plugins=[GoogleAdkPlugin()],
)

result = await client.execute_workflow(
MultiAgentWorkflow.run,
Expand Down
5 changes: 4 additions & 1 deletion google_adk_agents/agent_patterns/run_worker.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import asyncio
import os

from temporalio.client import Client
from temporalio.contrib.google_adk_agents import GoogleAdkPlugin
Expand All @@ -14,7 +15,9 @@
async def main():
plugin = GoogleAdkPlugin()

client = await Client.connect("localhost:7233", plugins=[plugin])
client = await Client.connect(
os.environ.get("TEMPORAL_ADDRESS", "localhost:7233"), plugins=[plugin]
)

worker = Worker(
client,
Expand Down
4 changes: 2 additions & 2 deletions google_adk_agents/basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Before running, review the [prerequisites in the suite README](../README.md)
Start the worker in one terminal:

```bash
uv run python -m google_adk_agents.basic.run_worker
uv run google_adk_agents/basic/run_worker.py
```

Then start the workflow in another terminal:

```bash
uv run python -m google_adk_agents.basic.run_hello_world_workflow
uv run google_adk_agents/basic/run_hello_world_workflow.py
```

## What to expect
Expand Down
6 changes: 5 additions & 1 deletion google_adk_agents/basic/run_hello_world_workflow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio
import os

from temporalio.client import Client
from temporalio.contrib.google_adk_agents import GoogleAdkPlugin
Expand All @@ -10,7 +11,10 @@

async def main():
# @@@SNIPSTART google-adk-agents-basic-starter
client = await Client.connect("localhost:7233", plugins=[GoogleAdkPlugin()])
client = await Client.connect(
os.environ.get("TEMPORAL_ADDRESS", "localhost:7233"),
plugins=[GoogleAdkPlugin()],
)

result = await client.execute_workflow(
HelloWorldAgentWorkflow.run,
Expand Down
5 changes: 4 additions & 1 deletion google_adk_agents/basic/run_worker.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import asyncio
import os

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

client = await Client.connect("localhost:7233", plugins=[plugin])
client = await Client.connect(
os.environ.get("TEMPORAL_ADDRESS", "localhost:7233"), plugins=[plugin]
)

worker = Worker(
client,
Expand Down
4 changes: 2 additions & 2 deletions google_adk_agents/chatbot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ Before running, review the [prerequisites in the suite README](../README.md)
Start the worker in one terminal:

```bash
uv run python -m google_adk_agents.chatbot.run_worker
uv run google_adk_agents/chatbot/run_worker.py
```

Then start the interactive client in another terminal:

```bash
uv run python -m google_adk_agents.chatbot.run_chatbot_workflow
uv run google_adk_agents/chatbot/run_chatbot_workflow.py
```

## What to expect
Expand Down
6 changes: 5 additions & 1 deletion google_adk_agents/chatbot/run_chatbot_workflow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio
import os

from temporalio.client import Client
from temporalio.contrib.google_adk_agents import GoogleAdkPlugin
Expand All @@ -10,7 +11,10 @@

async def main():
# @@@SNIPSTART google-adk-agents-chatbot-starter
client = await Client.connect("localhost:7233", plugins=[GoogleAdkPlugin()])
client = await Client.connect(
os.environ.get("TEMPORAL_ADDRESS", "localhost:7233"),
plugins=[GoogleAdkPlugin()],
)

handle = await client.start_workflow(
ChatbotAgentWorkflow.run,
Expand Down
5 changes: 4 additions & 1 deletion google_adk_agents/chatbot/run_worker.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import asyncio
import os

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

client = await Client.connect("localhost:7233", plugins=[plugin])
client = await Client.connect(
os.environ.get("TEMPORAL_ADDRESS", "localhost:7233"), plugins=[plugin]
)

worker = Worker(
client,
Expand Down
4 changes: 2 additions & 2 deletions google_adk_agents/mcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ server, `uv sync --group google-adk`, and `export GOOGLE_API_KEY=...`).
Start the worker in one terminal:

```bash
uv run python -m google_adk_agents.mcp.run_worker
uv run google_adk_agents/mcp/run_worker.py
```

Then start the workflow in another terminal:

```bash
uv run python -m google_adk_agents.mcp.run_echo_workflow
uv run google_adk_agents/mcp/run_echo_workflow.py
```

The worker spawns `echo_mcp_server.py` itself; you don't need to start it
Expand Down
6 changes: 5 additions & 1 deletion google_adk_agents/mcp/run_echo_workflow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio
import os

from temporalio.client import Client
from temporalio.contrib.google_adk_agents import GoogleAdkPlugin
Expand All @@ -7,7 +8,10 @@


async def main():
client = await Client.connect("localhost:7233", plugins=[GoogleAdkPlugin()])
client = await Client.connect(
os.environ.get("TEMPORAL_ADDRESS", "localhost:7233"),
plugins=[GoogleAdkPlugin()],
)

result = await client.execute_workflow(
EchoMcpWorkflow.run,
Expand Down
5 changes: 4 additions & 1 deletion google_adk_agents/mcp/run_worker.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import asyncio
import os

from temporalio.client import Client
from temporalio.contrib.google_adk_agents import (
Expand All @@ -19,7 +20,9 @@ async def main():
toolset_providers=[TemporalMcpToolSetProvider("echo", echo_toolset)]
)

client = await Client.connect("localhost:7233", plugins=[plugin])
client = await Client.connect(
os.environ.get("TEMPORAL_ADDRESS", "localhost:7233"), plugins=[plugin]
)

worker = Worker(
client,
Expand Down
4 changes: 2 additions & 2 deletions google_adk_agents/streaming/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ Before running, review the [prerequisites in the suite README](../README.md)
Start the worker in one terminal:

```bash
uv run python -m google_adk_agents.streaming.run_worker
uv run google_adk_agents/streaming/run_worker.py
```

Then start the workflow in another terminal:

```bash
uv run python -m google_adk_agents.streaming.run_streaming_workflow
uv run google_adk_agents/streaming/run_streaming_workflow.py
```

## What to expect
Expand Down
6 changes: 5 additions & 1 deletion google_adk_agents/streaming/run_streaming_workflow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio
import os
from datetime import timedelta

from google.adk.models.llm_response import LlmResponse
Expand All @@ -14,7 +15,10 @@


async def main():
client = await Client.connect("localhost:7233", plugins=[GoogleAdkPlugin()])
client = await Client.connect(
os.environ.get("TEMPORAL_ADDRESS", "localhost:7233"),
plugins=[GoogleAdkPlugin()],
)

handle = await client.start_workflow(
StreamingAgentWorkflow.run,
Expand Down
5 changes: 4 additions & 1 deletion google_adk_agents/streaming/run_worker.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import asyncio
import os

from temporalio.client import Client
from temporalio.contrib.google_adk_agents import GoogleAdkPlugin
Expand All @@ -14,7 +15,9 @@
async def main():
plugin = GoogleAdkPlugin()

client = await Client.connect("localhost:7233", plugins=[plugin])
client = await Client.connect(
os.environ.get("TEMPORAL_ADDRESS", "localhost:7233"), plugins=[plugin]
)

worker = Worker(
client,
Expand Down
4 changes: 2 additions & 2 deletions google_adk_agents/tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Before running, review the [prerequisites in the suite README](../README.md)
Start the worker in one terminal:

```bash
uv run python -m google_adk_agents.tools.run_worker
uv run google_adk_agents/tools/run_worker.py
```

Then start the workflow in another terminal:

```bash
uv run python -m google_adk_agents.tools.run_weather_workflow
uv run google_adk_agents/tools/run_weather_workflow.py
```

## What to expect
Expand Down
6 changes: 5 additions & 1 deletion google_adk_agents/tools/run_weather_workflow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio
import os

from temporalio.client import Client
from temporalio.contrib.google_adk_agents import GoogleAdkPlugin
Expand All @@ -7,7 +8,10 @@


async def main():
client = await Client.connect("localhost:7233", plugins=[GoogleAdkPlugin()])
client = await Client.connect(
os.environ.get("TEMPORAL_ADDRESS", "localhost:7233"),
plugins=[GoogleAdkPlugin()],
)

result = await client.execute_workflow(
WeatherAgentWorkflow.run,
Expand Down
5 changes: 4 additions & 1 deletion google_adk_agents/tools/run_worker.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import asyncio
import os

from temporalio.client import Client
from temporalio.contrib.google_adk_agents import GoogleAdkPlugin
Expand All @@ -14,7 +15,9 @@ async def main():
# @@@SNIPSTART google-adk-agents-tools-worker
plugin = GoogleAdkPlugin()

client = await Client.connect("localhost:7233", plugins=[plugin])
client = await Client.connect(
os.environ.get("TEMPORAL_ADDRESS", "localhost:7233"), plugins=[plugin]
)

worker = Worker(
client,
Expand Down
2 changes: 1 addition & 1 deletion langgraph_plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Samples are organized by API style:
uv sync --group langgraph
```

2. Start a [Temporal dev server](https://docs.temporal.io/cli#start-dev-server):
2. Start a local dev server with the [Temporal CLI](https://docs.temporal.io/cli):

```bash
temporal server start-dev
Expand Down
2 changes: 1 addition & 1 deletion langgraph_plugin/graph_api/streaming/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Streaming (Graph API)

Streams a LangGraph run to an external client while the workflow is still running, using Temporal's durable, offset-addressed [`WorkflowStream`](https://docs.temporal.io/). The graph writes a short story about a topic and emits both fine-grained tokens and node-completion progress on separate topics.
Streams a LangGraph run to an external client while the workflow is still running, using Temporal's durable, offset-addressed [`WorkflowStream`](https://github.com/temporalio/sdk-python/tree/main/temporalio/contrib/workflow_streams). The graph writes a short story about a topic and emits both fine-grained tokens and node-completion progress on separate topics.

## What This Sample Demonstrates

Expand Down
Loading
Loading