env variables. This allows your domain experts to independently iterate on and deploy prompts without needing any technical skills.
This guide will walk through available environments, how to deploy a prompt to a specific environment within the app, and how to export and use these prompts in your application.
Available Environments
Each environment is specific to a project and can be used to automatically fetch the latest deployed prompt version. By default, we offer the below 3 environments:dev: For development-related tasks such as testing, debugging, etc.staging: For staging your prompt changesprod: For managing your production instance
Deploying Prompts
Expected Time: Less than a minute To deploy a prompt, simply navigate toRegistry within Studio. Here, you can select any of your saved prompts and deploy it to a specific env.
Integrating with your application
After creating a desired prompt and deploying it, you’ll need to add it to your codebase to use in development or production. We have two primary suggested flows for being able to export and use your prompts:- SDK-based export (with caching)
- YAML file export
1. SDK-based export
You can fetch your deployed prompts using ourGET Configurations API. This method allows you to dynamically retrieve the latest version of your prompts directly from HoneyHive.
Basic SDK Usage
Here are examples of how to use the API in Python and TypeScript. Theenv and name parameters are optional below.
- Fetching all prompts: If only the
projectis specified, all prompts in the project will be returned. - Fetching
proddeployed version: By settingenvtooperations.env.PROD(Python) orEnv.Prod(JS/TS), the prompt deployed to theprodenvironment will be returned. - Fetching prompts deployed to other environments: Specifying a particular environment will fetch the prompt for that specific environment.
- Fetching a specific prompt: Specifying a name will fetch that exact prompt.
Cached SDK export
To reduce the number of API calls and improve performance, we recommend implementing a caching mechanism. Here are examples using LRU (Least Recently Used) cache in both Python and TypeScript:For typescript, you’ll have to install the package
lru-cache
