Prompt Hub
Manage prompts centrally, fetch versions, and use variables for dynamic prompts
The Prompt-Hub allows you to manage prompts, fetch specific versions of the prompt, and compile prompts with variables.
Key Features
- Prompt Management: Create, edit, and track different versions of your prompts.
- Versioning: Supports major, minor, and patch updates for clear version management.
- Dynamic Variables: Use
{{variableName}}
placeholders that are dynamically replaced at runtime. - Statistics: View download stats and version history directly in the UI.
Get Started
List of Prompts
Get a quick overview of all prompts created.
- Navigate to the Prompt Hub in OpenLIT.
- Explore the available prompts listed.
Create or Edit a Prompt
Build new prompts or edit existing ones with ease.
- Click on + New to create a new prompt
- In the prompt editor, add the prompt name, Meta Properties and use placeholders like
{{variableName}}
to represent dynamic data that will be substituted when the prompt is compiled. - Specify major, minor, or patch updates for versioning as you create or modify prompts.
View Prompt Details
Once the prompt is creaetd, You can see information about the prompt along with details on all past versions.
Retrieve the Prompt
Create an API Key
To authenticate your requests, you need an API key. Here’s how you can create one:
- Go to the OpenLIT.
- Navigate to the API Keys page.
- Click on Create API Key.
- Enter a name for your API key.
- Save the API key displayed. Ensure you store it securely as it will be used for authentication in the SDK.
Get prompt using the SDK
Here’s how you can fetch and compile a prompt in Python:
SDK Parameters
Below are the parameters for use with the SDK, formatted to indicate whether each is required or optional:
Parameter | Description |
---|---|
url | Sets the OpenLIT URL. Defaults to the OPENLIT_URL environment variable. |
api_key | Sets the OpenLIT API Key. Can also be provided via the OPENLIT_API_KEY environment variable. |
name | Sets the name to fetch a unique prompt. Use this or prompt_id . |
prompt_id | Sets the ID to fetch a unique prompt. Use this or name . Optional |
version | Set to True to get the prompt with variable substitution.. Optional |
shouldCompile | Boolean value that compiles the prompt using the provided variables. Optional |
variables | Sets the variables for prompt compilation. Optional |
meta_properties | Sets the meta-properties for storing in the prompt’s access history metadata. Optional |
Was this page helpful?