Prompty Specification
The Prompty yaml file spec can be found here. Below you can find a brief description of each section and the attributes within it.
Prompty description attributes:
Section titled “Prompty description attributes:”Property | Type | Description | Required |
---|---|---|---|
name | string | Name of the prompty | Yes |
description | string | Description of the prompty | Yes |
version | string | Version number | No |
authors | array | List of prompty authors | No |
tags | tags | Categorization tags | No |
Input/Output Specifications
Section titled “Input/Output Specifications”Inputs
Section titled “Inputs”The inputs
object defines the expected input format for the prompty:
inputs: type: object description: "Input specification"
Outputs
Section titled “Outputs”The outputs
object defines the expected output format:
outputs: type: object description: "Output specification"
Template Engine
Section titled “Template Engine”Currently supports:
jinja2
(default) - Jinja2 template engine for text processing
Model Configuration
Section titled “Model Configuration”The model
section defines how the AI model should be configured and executed.
model: api: chat configuration: # model-specific configuration parameters: # execution parameters response: first
Model API Types
Section titled “Model API Types”chat
(default) - For chat-based interactionscompletion
- For text completion tasks
Response Types
Section titled “Response Types”This determines whether the full (raw) response or just the first response in the choice array is returned.
first
(default) - Returns only the first responseall
- Returns all response choices
Model Providers
Section titled “Model Providers”Azure OpenAI Configuration
Section titled “Azure OpenAI Configuration”configuration: type: azure_openai api_key: ${env:OPENAI_API_KEY} api_version: "2023-05-15" azure_deployment: "my-deployment" azure_endpoint: "https://my-endpoint.openai.azure.com"
OpenAI Configuration
Section titled “OpenAI Configuration”configuration: type: openai name: "gpt-4" organization: "my-org"
MaaS Configuration
Section titled “MaaS Configuration”configuration: type: azure_serverless azure_endpoint: "https://my-endpoint.azureml.ms"
Model Parameters
Section titled “Model Parameters”Common parameters that can be configured for model execution:
Parameter | Type | Description |
---|---|---|
response_format | object | An object specifying the format that the model must output. |
seed | integer | For deterministic sampling. This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed, and you should refer to the system_fingerprint response parameter to monitor changes in the backend. |
max_tokens | integer | The maximum number of tokens that can be generated in the chat completion. |
temperature | number | Sampling temperature (0-1) |
frequency_penalty | number | Penalty for frequent tokens |
presence_penalty | number | Penalty for new tokens |
top_p | number | Nucleus sampling probability |
stop | array | Sequences to stop generation |
Setting to
{ "type": "json_object" }
enables JSON mode, which guarantees the message the model generates is valid JSON.
Sample Prompty
Section titled “Sample Prompty”---name: ExamplePromptdescription: A prompt that uses context to ground an incoming questionauthors: - Seth Juarezmodel: api: chat configuration: type: azure_openai azure_endpoint: ${env:AZURE_OPENAI_ENDPOINT} azure_deployment: <your-deployment> api_version: 2024-07-01-preview parameters: max_tokens: 3000sample: firstName: Seth context: > The Alpine Explorer Tent boasts a detachable divider for privacy, numerous mesh windows and adjustable vents for ventilation, and a waterproof design. It even has a built-in gear loft for storing your outdoor essentials. In short, it's a blend of privacy, comfort, and convenience, making it your second home in the heart of nature! question: What can you tell me about your tents?---
system:You are an AI assistant who helps people find information. As the assistant,you answer questions briefly, succinctly, and in a personable manner usingmarkdown and even add some personal flair with appropriate emojis.
# CustomerYou are helping {{firstName}} to find answers to their questions.Use their name to address them in your responses.
# ContextUse the following context to provide a more personalized response to {{firstName}}:{{context}}
user:{{question}}