|
1 | | -# Restack AI - Audio transcript and translation example |
2 | | - |
3 | | -This example showcases how to transcribe an mp3 audio and then later translate the generated text to a target language, all done in a single workflow defined with Restack AI. |
| 1 | +# Restack AI - Audio translation example |
4 | 2 |
|
| 3 | +This example showcases how to transcribe an mp3 audio and then translate the generated text to a target language, all done in a single workflow defined with Restack AI. |
5 | 4 |
|
6 | 5 | ## Prerequisites |
7 | 6 |
|
| 7 | +- Docker (for running Restack) |
8 | 8 | - Python 3.10 or higher |
9 | 9 | - Poetry (for dependency management) |
10 | | -- Docker (for running the Restack services) |
11 | 10 |
|
12 | | -## Usage |
| 11 | +## Start Restack |
| 12 | + |
| 13 | +To start the Restack, use the following Docker command: |
| 14 | + |
| 15 | +```bash |
| 16 | +docker run -d --pull always --name restack -p 5233:5233 -p 6233:6233 -p 7233:7233 ghcr.io/restackio/restack:main |
| 17 | +``` |
| 18 | + |
| 19 | +## Start python shell |
13 | 20 |
|
14 | | -1. Run Restack local engine with Docker: |
| 21 | +```bash |
| 22 | +poetry env use 3.10 && poetry shell |
| 23 | +``` |
15 | 24 |
|
16 | | - ```bash |
17 | | - docker run -d --pull always --name restack -p 5233:5233 -p 6233:6233 -p 7233:7233 ghcr.io/restackio/restack:main |
18 | | - ``` |
| 25 | +## Install dependencies |
19 | 26 |
|
20 | | -2. Open the web UI to see the workflows: |
| 27 | +```bash |
| 28 | +poetry install |
| 29 | +``` |
21 | 30 |
|
22 | | - ```bash |
23 | | - http://localhost:5233 |
24 | | - ``` |
| 31 | +```bash |
| 32 | +poetry env info # Optional: copy the interpreter path to use in your IDE (e.g. Cursor, VSCode, etc.) |
| 33 | +``` |
25 | 34 |
|
26 | | -3. Clone this repository: |
| 35 | +```bash |
| 36 | +poetry run dev |
| 37 | +``` |
27 | 38 |
|
28 | | - ```bash |
29 | | - git clone https://github.com/restackio/examples-python |
30 | | - cd examples-python/examples/get-started |
31 | | - ``` |
32 | | - |
33 | | -4. Create .env file with: STRIPE_SECRET_KEY and OPENAI_API_KEY |
| 39 | +## Run workflows |
34 | 40 |
|
35 | | -4. Install dependencies using Poetry: |
| 41 | +### from UI |
36 | 42 |
|
37 | | - ```bash |
38 | | - poetry env use 3.12 |
39 | | - ``` |
| 43 | +You can run workflows from the UI by clicking the "Run" button. |
40 | 44 |
|
41 | | - ```bash |
42 | | - poetry shell |
43 | | - ``` |
| 45 | + |
44 | 46 |
|
45 | | - ```bash |
46 | | - poetry install |
47 | | - ``` |
| 47 | +### from API |
48 | 48 |
|
49 | | - ```bash |
50 | | - poetry env info # Optional: copy the interpreter path to use in your IDE (e.g. Cursor, VSCode, etc.) |
51 | | - ``` |
| 49 | +You can run workflows from the API by using the generated endpoint: |
52 | 50 |
|
53 | | -5. Run the services: |
| 51 | +`POST http://localhost:6233/api/workflows/TranscribeTranslateWorkflow` |
54 | 52 |
|
55 | | - ```bash |
56 | | - poetry run services |
57 | | - ``` |
| 53 | +### from any client |
58 | 54 |
|
59 | | - This will start the Restack service with the defined workflows and functions. |
| 55 | +You can run workflows with any client connected to Restack, for example: |
60 | 56 |
|
61 | | -6. In a new terminal, schedule the workflow: |
| 57 | +```bash |
| 58 | +poetry run schedule |
| 59 | +``` |
62 | 60 |
|
63 | | - ```bash |
64 | | - poetry shell |
65 | | - ``` |
| 61 | +executes `schedule_workflow.py` which will connect to Restack and execute the `TranscribeTranslateWorkflow` workflow. |
66 | 62 |
|
67 | | - ```bash |
68 | | - poetry run schedule |
69 | | - ``` |
| 63 | +## Deploy on Restack Cloud |
70 | 64 |
|
71 | | - This will schedule the `TranscribeTranslateWorkflow` and print the result. |
| 65 | +To deploy the application on Restack, you can create an account at [https://console.restack.io](https://console.restack.io) |
0 commit comments