Prompt Management
ABV Prompts Data Model
6 min
prompt object example prompt in abv with custom config { "name" "movie critic", "type" "text", "prompt" "as a {{criticlevel}} movie critic, do you like {{movie}}?", "config" { "model" "gpt 4o", "temperature" 0 5, "supported languages" \["en", "fr"] }, "version" 1, "labels" \["production", "staging", "latest"], "tags" \["movies"] } name unique name of the prompt within a abv project type the abv prompts data model /#chat vs text prompts of the prompt content ( text or chat ) default is text prompt the text template with variables (e g this is a prompt with a {{variable}} ) for chat prompts, this is a list of chat messages each with role and content but can also contain abv prompts data model /#prompt object config optional json object to store any parameters (e g model parameters or model tools) version integer to indicate the version of the prompt the version is automatically incremented when creating a new prompt version labels abv prompts data model /#versioning and labels that can be used to fetch specific prompt versions in the sdks when using a prompt without specifying a label, abv will serve the version with the production label latest points to the most recently created version you can create any additional labels, e g for different environments ( staging , production ) or tenants ( tenant 1 , tenant 2 ) tags use tags to categorize prompts, e g to filter them in the ui or sdks all versions of a prompt share the same tags chat vs text prompts abv supports two types of prompts text and chat the key difference is in how the content is structured text prompts text prompts contain a single string with optional variables they are ideal for simple completions or when using models that expect a single text input text prompt example { "name" "movie critic", "type" "text", "prompt" "as a {{criticlevel}} movie critic, do you like {{movie}}?", "version" 1 } when compiled, text prompts return a single string \# returns "as an expert movie critic, do you like dune 2?" chat prompts chat prompts contain an array of messages, each with a role and content they are designed for conversational models and multi turn interactions chat prompt example { "name" "movie critic chat", "type" "chat", "prompt" \[ { "role" "system", "content" "you are a {{criticlevel}} movie critic" }, { "role" "user", "content" "do you like {{movie}}?" } ], "version" 1 } when compiled, chat prompts return an array of message objects \# returns \[ \# {"role" "system", "content" "you are an expert movie critic"}, \# {"role" "user", "content" "do you like dune 2?"} \# ] both prompt types support variable substitution using {{variable}} syntax and can include custom configuration parameters versioning and labels abv prompt prompt version control docid 1i9dhpq3scwzzexcv3vjj automatically creates incremental versions (1, 2, 3 ) each time you update a prompt with the same name, while labels act as pointers to specific versions for deployment management the production label serves as the default version returned by sdks when no specific label is requested, latest automatically points to the most recently created version, and you can create custom labels (like staging , tenant 1 , or prod a ) to manage different environments, tenants, or a/b testing scenarios allowing you to safely deploy, test, and rollback prompts by simply reassigning labels rather than changing code