Prompts
Prompt engineering is the practice of designing inputs to guide large language models (LLMs) to produce desired responses. Each prompt has two key components: a system prompt and a user prompt — both integrated within a single Prompt
object for management and retrieval.
- System Prompt: Provides background context or instructions to influence the model’s overall behavior.
- User Prompt: The specific question or input meant for the model to address in its response.
Using the Quotient SDK, you can manage Prompt
s by creating, retrieving, updating, and deleting them programmatically within your application.
Creating Prompts
To create a new prompt, use the create()
method, specifying a unique name, a system prompt for model behavior, and a user prompt for user interaction.
Retrieving a Specific Prompt
To retrieve a prompt by its ID (and optionally by version), use the get()
method.
The returned Prompt
object includes a messages
property, useful for integration with model provider libraries (e.g., OpenAI)
Listing Prompts
Retrieve all available prompts using the list()
method. Each prompt includes details like id
, name
, system_prompt
, and user_prompt
.
Versioning Prompts
Each prompt starts at version 0 upon creation. Quotient manages prompt versions, linking them by prompt name and unique ID.
Creating a New Prompt Version
To update a prompt’s details and have them recorded in Quotient, use the update()
method. If any attributes (like name
, system_prompt
, or user_prompt
) change, the version is automatically incremented.
Deleting a Prompt
Deleting a prompt removes all its associated versions. Use the delete()
method with the Prompt
object you wish to remove.