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
35 changes: 9 additions & 26 deletions deepagents_plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,10 @@ one side.
uv sync --group deepagents
```

> The Deep Agents plugin ships as the `temporalio[deepagents]` extra. It
> is merged to `sdk-python` `main` but the current PyPI release (1.31.0)
> predates the merge and does not carry the extra, so the `deepagents`
> group above does not include it yet. Until a release ships the extra
> (> 1.31.0), install it from main:
>
> ```bash
> uv pip install "temporalio[deepagents] @ git+https://github.com/temporalio/sdk-python.git"
> ```
>
> This builds the SDK from source (including its Rust core), so expect a
> few minutes on first install. Once a release with the extra is on PyPI
> this step goes away: `temporalio[deepagents]` joins the `deepagents`
> group and a plain `uv sync --group deepagents` is all you need.
> The group installs the `temporalio[deepagents]` extra (released in
> `temporalio` 1.32.0) plus the Anthropic provider package. Requires
> Python >= 3.11 — on older interpreters the group resolves to nothing
> and the samples are skipped.

2. Configure a model provider. The samples use
`anthropic:claude-sonnet-4-5`, which needs an Anthropic API key:
Expand All @@ -74,39 +64,32 @@ one side.

## Running a Sample

> **Use `uv run --no-sync`.** Because the plugin is installed out-of-band
> from sdk-python main (see Prerequisites) and is not yet in any dependency
> group, a bare `uv run` or `uv sync` re-syncs the environment to the lockfile
> first and uninstalls it. `--no-sync` runs against the environment as-is.
> (Once a released `temporalio[deepagents]` joins the `deepagents` group, the
> flag becomes unnecessary.)

Most samples have two scripts. Start the Worker first, then the Workflow starter
in a separate terminal:

```bash
# Terminal 1: start the Worker
uv run --no-sync deepagents_plugin/<sample>/run_worker.py
uv run deepagents_plugin/<sample>/run_worker.py

# Terminal 2: start the Workflow
uv run --no-sync deepagents_plugin/<sample>/run_workflow.py
uv run deepagents_plugin/<sample>/run_workflow.py
```

For example, to run the hello world sample:

```bash
# Terminal 1
uv run --no-sync deepagents_plugin/hello_world/run_worker.py
uv run deepagents_plugin/hello_world/run_worker.py

# Terminal 2
uv run --no-sync deepagents_plugin/hello_world/run_workflow.py
uv run deepagents_plugin/hello_world/run_workflow.py
```

The `langsmith_tracing` sample instead bundles the worker and starter into a
single driver:

```bash
uv run --no-sync deepagents_plugin/langsmith_tracing/main.py
uv run deepagents_plugin/langsmith_tracing/main.py
```

## Key Features Demonstrated
Expand Down
8 changes: 3 additions & 5 deletions deepagents_plugin/continue_as_new/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,17 @@ checkpointer would do I/O from workflow code and is not replay-safe.
## Running the Sample

Prerequisites: Python >= 3.11 with the [suite setup](../README.md#prerequisites)
applied (interim plugin install), an `ANTHROPIC_API_KEY` in your
applied, an `ANTHROPIC_API_KEY` in your
environment, and a running Temporal dev server (`temporal server start-dev`).

> The experimental plugin is not in the `deepagents` group — install it as shown
> in the [suite README](../README.md#prerequisites) and run with `--no-sync`, or
> a bare `uv run`/`uv sync` re-syncs the environment and uninstalls it.

```bash
# Terminal 1
uv run --no-sync deepagents_plugin/continue_as_new/run_worker.py
uv run deepagents_plugin/continue_as_new/run_worker.py

# Terminal 2
uv run --no-sync deepagents_plugin/continue_as_new/run_workflow.py
uv run deepagents_plugin/continue_as_new/run_workflow.py
```

## Files
Expand Down
8 changes: 3 additions & 5 deletions deepagents_plugin/filesystem_backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,17 @@ directly.
## Running the Sample

Prerequisites: Python >= 3.11 with the [suite setup](../README.md#prerequisites)
applied (interim plugin install), an `ANTHROPIC_API_KEY` in your
applied, an `ANTHROPIC_API_KEY` in your
environment, and a running Temporal dev server (`temporal server start-dev`).

> The experimental plugin is not in the `deepagents` group — install it as shown
> in the [suite README](../README.md#prerequisites) and run with `--no-sync`, or
> a bare `uv run`/`uv sync` re-syncs the environment and uninstalls it.

```bash
# Terminal 1
uv run --no-sync deepagents_plugin/filesystem_backend/run_worker.py
uv run deepagents_plugin/filesystem_backend/run_worker.py

# Terminal 2
uv run --no-sync deepagents_plugin/filesystem_backend/run_workflow.py
uv run deepagents_plugin/filesystem_backend/run_workflow.py
```

By default the starter creates a temporary scratch directory; set
Expand Down
8 changes: 3 additions & 5 deletions deepagents_plugin/hello_world/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@ Temporal-managed retries and timeouts.
## Running the Sample

Prerequisites: Python >= 3.11 with the [suite setup](../README.md#prerequisites)
applied (interim plugin install), an `ANTHROPIC_API_KEY` in your
applied, an `ANTHROPIC_API_KEY` in your
environment, and a running Temporal dev server (`temporal server start-dev`).

> The experimental plugin is not in the `deepagents` group — install it as shown
> in the [suite README](../README.md#prerequisites) and run with `--no-sync`, or
> a bare `uv run`/`uv sync` re-syncs the environment and uninstalls it.

```bash
# Terminal 1
uv run --no-sync deepagents_plugin/hello_world/run_worker.py
uv run deepagents_plugin/hello_world/run_worker.py

# Terminal 2
uv run --no-sync deepagents_plugin/hello_world/run_workflow.py
uv run deepagents_plugin/hello_world/run_workflow.py
```

## Files
Expand Down
8 changes: 3 additions & 5 deletions deepagents_plugin/human_in_the_loop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,17 @@ request another guarded tool call.
## Running the Sample

Prerequisites: Python >= 3.11 with the [suite setup](../README.md#prerequisites)
applied (interim plugin install), an `ANTHROPIC_API_KEY` in your
applied, an `ANTHROPIC_API_KEY` in your
environment, and a running Temporal dev server (`temporal server start-dev`).

> The experimental plugin is not in the `deepagents` group — install it as shown
> in the [suite README](../README.md#prerequisites) and run with `--no-sync`, or
> a bare `uv run`/`uv sync` re-syncs the environment and uninstalls it.

```bash
# Terminal 1
uv run --no-sync deepagents_plugin/human_in_the_loop/run_worker.py
uv run deepagents_plugin/human_in_the_loop/run_worker.py

# Terminal 2
uv run --no-sync deepagents_plugin/human_in_the_loop/run_workflow.py
uv run deepagents_plugin/human_in_the_loop/run_workflow.py
```

The starter polls the query until the agent pauses, prints the approval prompt,
Expand Down
9 changes: 3 additions & 6 deletions deepagents_plugin/langsmith_tracing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ API keys).
## Running the Sample

Prerequisites: Python >= 3.11 with the [suite setup](../README.md#prerequisites)
applied (interim plugin install), a running Temporal dev server
applied, a running Temporal dev server
(`temporal server start-dev`), and these environment variables:

```bash
Expand All @@ -27,13 +27,10 @@ export LANGSMITH_API_KEY=... # or LANGCHAIN_API_KEY
export LANGSMITH_TRACING=true
```

The experimental plugin is not in the `deepagents` group — install it as shown
in the [suite README](../README.md#prerequisites) and run with `--no-sync`, or a
bare `uv run`/`uv sync` re-syncs the environment and uninstalls it. Then run the
single-process driver:
Then run the single-process driver:

```bash
uv run --no-sync deepagents_plugin/langsmith_tracing/main.py
uv run deepagents_plugin/langsmith_tracing/main.py
```

Traces appear in your LangSmith project.
Expand Down
8 changes: 3 additions & 5 deletions deepagents_plugin/react_agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,17 @@ turn and every tool call is a durable activity.
## Running the Sample

Prerequisites: Python >= 3.11 with the [suite setup](../README.md#prerequisites)
applied (interim plugin install), an `ANTHROPIC_API_KEY` in your
applied, an `ANTHROPIC_API_KEY` in your
environment, and a running Temporal dev server (`temporal server start-dev`).

> The experimental plugin is not in the `deepagents` group — install it as shown
> in the [suite README](../README.md#prerequisites) and run with `--no-sync`, or
> a bare `uv run`/`uv sync` re-syncs the environment and uninstalls it.

```bash
# Terminal 1
uv run --no-sync deepagents_plugin/react_agent/run_worker.py
uv run deepagents_plugin/react_agent/run_worker.py

# Terminal 2
uv run --no-sync deepagents_plugin/react_agent/run_workflow.py
uv run deepagents_plugin/react_agent/run_workflow.py
```

## Files
Expand Down
8 changes: 3 additions & 5 deletions deepagents_plugin/streaming/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,17 @@ they arrive.
## Running the Sample

Prerequisites: Python >= 3.11 with the [suite setup](../README.md#prerequisites)
applied (interim plugin install), an `ANTHROPIC_API_KEY` in your
applied, an `ANTHROPIC_API_KEY` in your
environment, and a running Temporal dev server (`temporal server start-dev`).

> The experimental plugin is not in the `deepagents` group — install it as shown
> in the [suite README](../README.md#prerequisites) and run with `--no-sync`, or
> a bare `uv run`/`uv sync` re-syncs the environment and uninstalls it.

```bash
# Terminal 1
uv run --no-sync deepagents_plugin/streaming/run_worker.py
uv run deepagents_plugin/streaming/run_worker.py

# Terminal 2
uv run --no-sync deepagents_plugin/streaming/run_workflow.py
uv run deepagents_plugin/streaming/run_workflow.py
```

## Files
Expand Down
8 changes: 3 additions & 5 deletions deepagents_plugin/subagents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,17 @@ researcher's LLM calls run as durable activities.
## Running the Sample

Prerequisites: Python >= 3.11 with the [suite setup](../README.md#prerequisites)
applied (interim plugin install), an `ANTHROPIC_API_KEY` in your
applied, an `ANTHROPIC_API_KEY` in your
environment, and a running Temporal dev server (`temporal server start-dev`).

> The experimental plugin is not in the `deepagents` group — install it as shown
> in the [suite README](../README.md#prerequisites) and run with `--no-sync`, or
> a bare `uv run`/`uv sync` re-syncs the environment and uninstalls it.

```bash
# Terminal 1
uv run --no-sync deepagents_plugin/subagents/run_worker.py
uv run deepagents_plugin/subagents/run_worker.py

# Terminal 2
uv run --no-sync deepagents_plugin/subagents/run_workflow.py
uv run deepagents_plugin/subagents/run_workflow.py
```

## Files
Expand Down
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@ dev = [
]
bedrock = ["boto3>=1.34.92,<2"]
deepagents = [
"deepagents>=0.6.12,<0.7 ; python_version >= '3.11'",
"langchain>=1.3.11,<2 ; python_version >= '3.11'",
"langchain-core>=1.4.8,<2 ; python_version >= '3.11'",
"temporalio[deepagents,langsmith]>=1.32.0 ; python_version >= '3.11'",
"langchain-anthropic>=1.4.7,<2 ; python_version >= '3.11'",
"temporalio[langsmith]>=1.32.0 ; python_version >= '3.11'",
]
dsl = ["pyyaml>=6.0.1,<7", "types-pyyaml>=6.0.12,<7", "dacite>=1.8.1,<2"]
encryption = ["cryptography>=38.0.1,<39", "aiohttp>=3.13.3,<4"]
Expand Down
21 changes: 9 additions & 12 deletions tests/deepagents_plugin/conftest.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
"""Collection guard for the Deep Agents plugin tests.

The plugin ships as the `temporalio[deepagents]` extra and requires
Python >= 3.11. It is merged to sdk-python main but the current PyPI
release (1.31.0) predates the merge, so the `deepagents` dependency group
cannot install it yet and the canonical `poe test` run
(`uv run --all-groups pytest`) does not have it. These test modules import
`temporalio.contrib.deepagents` at module load, which would raise
`ImportError` during collection whenever the plugin is absent (any
interpreter) or the interpreter is < 3.11 — failing the whole session.
The plugin ships as the `temporalio[deepagents]` extra (temporalio >=
1.32.0), which the `deepagents` dependency group installs on Python >= 3.11.
These test modules import `temporalio.contrib.deepagents` at module load,
which would raise `ImportError` during collection whenever the plugin's
runtime deps are absent — an interpreter below 3.11 (where the group
resolves to nothing) or an environment synced without the group — failing
the whole session.

A module-level `pytest.mark.skipif` cannot help here: the mark is only read
*after* the module is imported, so the import error fires first. `collect_ignore`
is evaluated before any test module is imported, so it skips these files
cleanly when the plugin is unavailable while still running them once it is
installed on 3.11+ (interim: from sdk-python main per the suite README;
after the release that ships the extra: via the `deepagents` group, at which
point this guard becomes a no-op and the suite runs in CI).
cleanly when the plugin is unavailable while still running them on any
3.11+ environment synced with the group — the canonical CI run included.

The guard performs a real (guarded) import rather than `find_spec`: the
subpackage can exist on disk while its runtime deps do not — e.g. a
Expand Down
Loading
Loading