
Prerequisites: You need an API key set as the environment variable
TRACELOOP_API_KEY.
Generate one in Settings →1
Create a new prompt
Click New Prompt to create a new prompt. Give it a name, which will be used to retrieve it in your code later.
2
Define it in the Prompt Registry
Set the system and/or user prompt. You can use variables in your prompt by
following the Jinja format of
{{ variable_name }}.
The values of these variables will be passed in when you retrieve the prompt in your code.For more information see the Registry Documentation.This screen is also a prompt playground. Give the prompt a try by clicking
Test at the bottom.
3
Deploy the prompt to your developement environement
Click Deploy to Dev to deploy the prompt to your development environment.
4
Use the prompt in your code
get_prompt function.
For example, if you’ve created a prompt with the key joke_generator and a single variable persona:The returned variable
prompt_args is compatible with the API used by the
foundation models SDKs (OpenAI, Anthropic, etc.) which means you can directly
plug in the response to the appropriate API call.

