Structure
A typical PromptSpec file includes the following sections.
Metadata
Includes the version, name, and description of the prompt.
Model & Endpoint Configuration
Define the AI Model, API endpoint and necessary headers for model interaction.
If no, URL is set, PromptSpec’s SDK will use the prompt’s model string to figure out the URL based on our supported list of models.
You can set this to point to an Azure deployment of OpenAI models or point to a model that PromptSpec SDK does not know about yet.
Parameters
Specify input parameters, their types, and requirements. This follows the same structure as the function call’s parameters.
Prompt Definition
Structured content of the prompt, including model information, messages, and optional function calls. This is the same data that would make the payload for the API request to the model’s provider.
Test Cases
Define scenarios to test the prompt, ensuring the expected output aligns with various input configurations.
Tests help run the prompts without having to fill in parameter values each time. You can define a collection of tests which can be recognised by the SDK for testing the prompts.
- Name: Test case’s name for you to easily identity
- Parameters: Variables that are required to run the prompt and any optional params that the prompt accepts.
- Additional Messages: These are added to the list of messages, parsed for parameters & expressions before making request to the AI model.
- Assert: Currently PromptSpec SDKs support regular expression assertions of the returned data from the AI’s response.