Code Example: How to create a prompt template
This folder contains the code for the Guides » Gateway » Create a prompt template page in the documentation.
Running the Example
- Set the
OPENAI_API_KEYenvironment variable:
export OPENAI_API_KEY="sk-..." # Replace with your OpenAI API key
- Launch the TensorZero Gateway and a local Postgres database:
docker compose up
- Run the example:
Install the Python dependencies. We recommend using uv:
uv sync
Run the example:
uv run openai_sdk.py