Skip to content

Commit 629aec7

Browse files
Use dotenv
1 parent 88a6119 commit 629aec7

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

examples/poet_chat/.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Your Fishjam envs, which you can get at https://fishjam.io/app
2+
FISHJAM_ID="your-fishjam-id"
3+
FISHJAM_MANAGEMENT_TOKEN="your-management-token"
4+
5+
# An API key for the OpenAI Realtime API. You can generate one at https://platform.openai.com/api-keys
6+
OPENAI_API_KEY="your-api-key"

examples/poet_chat/README.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,11 @@ Once you have `uv` installed, fetch the dependencies with
1717
uv sync
1818
```
1919

20-
To run the app, you will need 3 environment variables:
20+
To run the app, first copy [`.env.example`](./.env.example) to `.env` and populate your environment variables.
2121

22-
- `FISHJAM_ID`: Your Fishjam ID, which you can get on the [Fishjam website](https://fishjam.io/app)
23-
- `FISHJAM_MANAGEMENT_TOKEN`: Your Fishjam management token, which you can get on the [Fishjam website](https://fishjam.io/app)
24-
- `OPENAI_API_KEY`: An API key for the OpenAI Realtime API. You can generate one on the [OpenAI website](https://platform.openai.com/api-keys).
25-
26-
Once you have these variables, you can run the demo with
22+
Once you have populated `.env`, you can run the demo with
2723

2824
```bash
29-
FISHJAM_ID=<your-fishjam-id> \
30-
FISHJAM_MANAGEMENT_TOKEN=<your-management-token> \
31-
OPENAI_API_KEY=<your-api-token> \
3225
uv run ./main.py
3326
```
3427

examples/poet_chat/poet_chat/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import os
22
from pathlib import Path
33

4+
import dotenv
5+
46
from fishjam import AgentOptions, AgentOutputOptions, FishjamClient
57

8+
dotenv.load_dotenv()
9+
610
FISHJAM_ID = os.environ["FISHJAM_ID"]
711
FISHJAM_TOKEN = os.environ["FISHJAM_MANAGEMENT_TOKEN"]
812
FISHJAM_URL = os.getenv("FISHJAM_URL")

0 commit comments

Comments
 (0)