Skip to content

Commit 41877f0

Browse files
authored
Change README instructions to run all samples from root dir (#213)
* AI: make all samples run from root dir * Add poe to dev group
1 parent cf70eaa commit 41877f0

File tree

38 files changed

+163
-141
lines changed

38 files changed

+163
-141
lines changed

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,6 @@ Some examples require extra dependencies. See each sample's directory for specif
8484

8585
## Test
8686

87-
Running the tests requires `poe` to be installed.
87+
To run the tests:
8888

89-
uv tool install poethepoet
90-
91-
Once you have `poe` installed you can run:
92-
93-
poe test
89+
uv run poe test

activity_worker/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ First run the Go workflow worker by running this in the `go_workflow` directory
66

77
go run .
88

9-
Then in another terminal, run the sample from this directory:
9+
Then in another terminal, run the sample from the root directory:
1010

11-
uv run activity_worker.py
11+
uv run activity_worker/activity_worker.py
1212

1313
The Python code will invoke the Go workflow which will execute the Python activity and return.

bedrock/basic/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
A basic Bedrock workflow. Starts a workflow with a prompt, generates a response and ends the workflow.
44

5-
To run, first see `samples-python` [README.md](../../README.md), and `bedrock` [README.md](../README.md) for prerequisites specific to this sample. Once set up, run the following from this directory:
5+
To run, first see `samples-python` [README.md](../../README.md), and `bedrock` [README.md](../README.md) for prerequisites specific to this sample. Once set up, run the following from the root directory:
66

7-
1. Run the worker: `uv run run_worker.py`
7+
1. Run the worker: `uv run bedrock/basic/run_worker.py`
88
2. In another terminal run the client with a prompt:
99

10-
e.g. `uv run send_message.py 'What animals are marsupials?'`
10+
e.g. `uv run bedrock/basic/send_message.py 'What animals are marsupials?'`

bedrock/entity/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
Multi-Turn Chat using an Entity Workflow. The workflow runs forever unless explicitly ended. The workflow continues as new after a configurable number of chat turns to keep the prompt size small and the Temporal event history small. Each continued-as-new workflow receives a summary of the conversation history so far for context.
44

5-
To run, first see `samples-python` [README.md](../../README.md), and `bedrock` [README.md](../README.md) for prerequisites specific to this sample. Once set up, run the following from this directory:
5+
To run, first see `samples-python` [README.md](../../README.md), and `bedrock` [README.md](../README.md) for prerequisites specific to this sample. Once set up, run the following from the root directory:
66

7-
1. Run the worker: `uv run run_worker.py`
7+
1. Run the worker: `uv run bedrock/entity/run_worker.py`
88
2. In another terminal run the client with a prompt.
99

10-
Example: `uv run send_message.py 'What animals are marsupials?'`
10+
Example: `uv run bedrock/entity/send_message.py 'What animals are marsupials?'`
1111

1212
3. View the worker's output for the response.
1313
4. Give followup prompts by signaling the workflow.
1414

15-
Example: `uv run send_message.py 'Do they lay eggs?'`
15+
Example: `uv run bedrock/entity/send_message.py 'Do they lay eggs?'`
1616
5. Get the conversation history summary by querying the workflow.
1717

18-
Example: `uv run get_history.py`
19-
6. To end the chat session, run `uv run end_chat.py`
18+
Example: `uv run bedrock/entity/get_history.py`
19+
6. To end the chat session, run `uv run bedrock/entity/end_chat.py`

bedrock/signals_and_queries/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
Adding signals & queries to the [basic Bedrock sample](../1_basic). Starts a workflow with a prompt, allows follow-up prompts to be given using Temporal signals, and allows the conversation history to be queried using Temporal queries.
44

5-
To run, first see `samples-python` [README.md](../../README.md), and `bedrock` [README.md](../README.md) for prerequisites specific to this sample. Once set up, run the following from this directory:
5+
To run, first see `samples-python` [README.md](../../README.md), and `bedrock` [README.md](../README.md) for prerequisites specific to this sample. Once set up, run the following from the root directory:
66

7-
1. Run the worker: `uv run run_worker.py`
7+
1. Run the worker: `uv run bedrock/signals_and_queries/run_worker.py`
88
2. In another terminal run the client with a prompt.
99

10-
Example: `uv run send_message.py 'What animals are marsupials?'`
10+
Example: `uv run bedrock/signals_and_queries/send_message.py 'What animals are marsupials?'`
1111

1212
3. View the worker's output for the response.
1313
4. Give followup prompts by signaling the workflow.
1414

15-
Example: `uv run send_message.py 'Do they lay eggs?'`
15+
Example: `uv run bedrock/signals_and_queries/send_message.py 'Do they lay eggs?'`
1616
5. Get the conversation history by querying the workflow.
1717

18-
Example: `uv run get_history.py`
18+
Example: `uv run bedrock/signals_and_queries/get_history.py`
1919
6. The workflow will timeout after inactivity.

cloud_export_to_parquet/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ Please make sure your python is 3.9 above. For this sample, run:
88

99
Before you start, please modify workflow input in `create_schedule.py` with your s3 bucket and namespace. Also make sure you've the right AWS permission set up in your environment to allow this workflow read and write to your s3 bucket.
1010

11-
To run, first see [README.md](../README.md) for prerequisites. Then, run the following from this directory to start the worker:
11+
To run, first see [README.md](../README.md) for prerequisites. Then, run the following from the root directory to start the worker:
1212

1313
```bash
14-
uv run run_worker.py
14+
uv run cloud_export_to_parquet/run_worker.py
1515
```
1616

1717
This will start the worker. Then, in another terminal, run the following to execute the schedule:
1818

1919
```bash
20-
uv run create_schedule.py
20+
uv run cloud_export_to_parquet/create_schedule.py
2121
```
2222

2323
The workflow should convert exported file in your input s3 bucket to parquet in your specified location.

context_propagation/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
This sample shows how to use an interceptor to propagate contextual information through workflows and activities. For
44
this example, [contextvars](https://docs.python.org/3/library/contextvars.html) holds the contextual information.
55

6-
To run, first see [README.md](../README.md) for prerequisites. Then, run the following from this directory to start the
6+
To run, first see [README.md](../README.md) for prerequisites. Then, run the following from the root directory to start the
77
worker:
88

9-
uv run worker.py
9+
uv run context_propagation/worker.py
1010

1111
This will start the worker. Then, in another terminal, run the following to execute the workflow:
1212

13-
uv run starter.py
13+
uv run context_propagation/starter.py
1414

1515
The starter terminal should complete with the hello result and the worker terminal should show the logs with the
1616
propagated user ID contextual information flowing through the workflows/activities.

custom_converter/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
This sample shows how to make a custom payload converter for a type not natively supported by Temporal.
44

5-
To run, first see [README.md](../README.md) for prerequisites. Then, run the following from this directory to start the
5+
To run, first see [README.md](../README.md) for prerequisites. Then, run the following from the root directory to start the
66
worker:
77

8-
uv run worker.py
8+
uv run custom_converter/worker.py
99

1010
This will start the worker. Then, in another terminal, run the following to execute the workflow:
1111

12-
uv run starter.py
12+
uv run custom_converter/starter.py
1313

1414
The workflow should complete with the hello result. If the custom converter was not set for the custom input and output
1515
classes, we would get an error on the client side and on the worker side.

custom_decorator/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
This sample shows a custom decorator can help with Temporal code reuse. Specifically, this makes a `@auto_heartbeater`
44
decorator that automatically configures an activity to heartbeat twice as frequently as the heartbeat timeout is set to.
55

6-
To run, first see [README.md](../README.md) for prerequisites. Then, run the following from this directory to start the
6+
To run, first see [README.md](../README.md) for prerequisites. Then, run the following from the root directory to start the
77
worker:
88

9-
uv run worker.py
9+
uv run custom_decorator/worker.py
1010

1111
This will start the worker. Then, in another terminal, run the following to execute the workflow:
1212

13-
uv run starter.py
13+
uv run custom_decorator/starter.py
1414

1515
The workflow will be started, and then after 5 seconds will be sent a signal to cancel its forever-running activity.
1616
The activity has a heartbeat timeout set to 2s, so since it has the `@auto_heartbeater` decorator set, it will heartbeat

dsl/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ For this sample, the optional `dsl` dependency group must be included. To includ
88

99
uv sync --group dsl
1010

11-
To run, first see [README.md](../README.md) for prerequisites. Then, run the following from this directory to start the
11+
To run, first see [README.md](../README.md) for prerequisites. Then, run the following from the root directory to start the
1212
worker:
1313

14-
uv run worker.py
14+
uv run dsl/worker.py
1515

1616
This will start the worker. Then, in another terminal, run the following to execute a workflow of steps defined in
17-
[workflow1.yaml](workflow1.yaml):
17+
[workflow1.yaml](dsl/workflow1.yaml):
1818

19-
uv run starter.py workflow1.yaml
19+
uv run dsl/starter.py dsl/workflow1.yaml
2020

2121
This will run the workflow and show the final variables that the workflow returns. Looking in the worker terminal, each
2222
step executed will be visible.
2323

24-
Similarly we can do the same for the more advanced [workflow2.yaml](workflow2.yaml) file:
24+
Similarly we can do the same for the more advanced [workflow2.yaml](dsl/workflow2.yaml) file:
2525

26-
uv run starter.py workflow2.yaml
26+
uv run dsl/starter.py dsl/workflow2.yaml
2727

2828
This sample gives a guide of how one can write a workflow to interpret arbitrary steps from a user-provided DSL. Many
2929
DSL models are more advanced and are more specific to conform to business logic needs.

0 commit comments

Comments
 (0)