Prompt Management
Get Started with Prompt Management
20 min
this quickstart helps you to create your first prompt and use it in your application 1\) get api key create abv account create abv account create new api credentials in the project settings 2\) create a prompt abv ui use the abv ui to create a new prompt or update an existing one python sdk pip install abvdev add your abv credentials as environment variables env abv api key = "sk abv " abv host = "https //app abv dev" # us region \# abv host = "https //eu app abv dev" # eu region use the python sdk to create a new prompt or update an existing one \# create a text prompt abv create prompt( name="movie critic", type="text", prompt="as a {{criticlevel}} movie critic, do you like {{movie}}?", labels=\["production"], # directly promote to production config={ "model" "gpt 5 2025 08 07", "temperature" 0 7, "supported languages" \["en", "fr"], }, # optionally, add configs (e g model parameters or model tools) or tags ) \# create a chat prompt abv create prompt( name="movie critic chat", type="chat", prompt=\[ { "role" "system", "content" "you are an {{criticlevel}} movie critic" }, { "role" "user", "content" "do you like {{movie}}?" }, ], labels=\["production"], # directly promote to production config={ "model" "gpt 5 2025 08 07", "temperature" 0 7, "supported languages" \["en", "fr"], }, # optionally, add configs (e g model parameters or model tools) or tags ) if you already have a prompt with the same name, the prompt will be added as a new version js/ts sdk npm i @abvdev/client environment variables env abv api key = "sk abv "; abv baseurl = "https //app abv dev"; us region \# abv baseurl = "https //eu app abv dev"; eu region import { abvclient } from "@abvdev/client"; const abv = new abvclient(); alternatively use constructor parameters import { abvclient } from "@abvdev/client"; const abv = new abvclient({ apikey "sk abv ", baseurl "https //app abv dev", // us region // baseurl "https //eu app abv dev", // eu region }); use the js/ts sdk to c reate a new prompt or update an exis ting one // create a text prompt await abv prompt create({ name "movie critic", type "text", prompt "as a {{criticlevel}} critic, do you like {{movie}}?", labels \["production"], // directly promote to production config { model "gpt 4o", temperature 0 7, supported languages \["en", "fr"], }, // optionally, add configs (e g model parameters or model tools) or tags }); // create a chat prompt await abv prompt create({ name "movie critic chat", type "chat", prompt \[ { role "system", content "you are an {{criticlevel}} movie critic" }, { role "user", content "do you like {{movie}}?" }, ], labels \["production"], // directly promote to production config { model "gpt 5 2025 08 07", temperature 0 7, supported languages \["en", "fr"], }, // optionally, add configs (e g model parameters or model tools) or tags }); if you already have a prompt with the same name, the prompt will be added as a new version api use the public ap i i to creat e a new prompt or update an existing one curl https //app abv devapi/public/v2/prompts \\ \ request post \\ \ header 'content type application/json' \\ \ data '{ "type" "chat", "name" "", "prompt" \[ { "type" "chatmessage", "role" "", "content" "" } ], "config" null, "labels" \[ "" ], "tags" \[ "" ], "commitmessage" null }' 3\) use prompt at runtime , you can fetch the latest production version from abv learn more about control (versions/labels) prompt version control docid 1i9dhpq3scwzzexcv3vjj python sdk from abvdev import get client \# initialize abv client abv = get client() text prompt \# get current `production` version of a text prompt prompt = abv get prompt("movie critic") \# insert variables into prompt template compiled prompt = prompt compile(criticlevel="expert", movie="dune 2") \# > "as an expert movie critic, do you like dune 2?" chat prompt \# get current `production` version of a chat prompt chat prompt = abv get prompt("movie critic chat", type="chat") # type arg infers the prompt type (default is 'text') \# insert variables into chat prompt template compiled chat prompt = chat prompt compile(criticlevel="expert", movie="dune 2") \# > \[{"role" "system", "content" "you are an expert movie critic"}, {"role" "user", "content" "do you like dune 2?"}] optional parameters \# get specific version prompt = abv get prompt("movie critic", version=1) \# get specific label prompt = abv get prompt("movie critic", label="staging") \# get latest prompt version the 'latest' label is automatically maintained by abv prompt = abv get prompt("movie critic", label="latest") attributes \# raw prompt including {{variables}} for chat prompts, this is a list of chat messages prompt prompt \# config object prompt config js/ts sdk import { abvclient } from "@abvdev/client"; // iniitialize the abv client const abv = new abvclient(); text prompt // get current `production` version const prompt = await abv prompt get("movie critic"); // insert variables into prompt template const compiledprompt = prompt compile({ criticlevel "expert", movie "dune 2", }); // > "as an expert movie critic, do you like dune 2?" chat prompt // get current `production` version of a chat prompt const chatprompt = await abv prompt get("movie critic chat", { type "chat", }); // type option infers the prompt type (default is 'text') // insert variables into chat prompt template const compiledchatprompt = chatprompt compile({ criticlevel "expert", movie "dune 2", }); // > \[{"role" "system", "content" "you are an expert movie critic"}, {"role" "user", "content" "do you like dune 2?"}] optional parameters // get specific version of a prompt (here version 1) const prompt = await abv prompt get("movie critic", { version 1 }); // get specific label const prompt = await abv prompt get("movie critic", { label "staging", }); // get latest prompt version the 'latest' label is automatically maintained by abv const prompt = await abv prompt get("movie critic", { label "latest", }); attributes // raw prompt including {{variables}} for chat prompts, this is a list of chat messages prompt prompt; // config object prompt config; 4\) link with abv tracing (optional) you can link the prompt to the llm generation span that used the prompt this linkage enables tracking of metrics by prompt version and name directly in the abv ui and see which prompt performed bes t python sdk decorators from abvdev import observe, get client abv = get client() @observe(as type="generation") def nested generation() prompt = abv get prompt("movie critic") abv update current generation( prompt=prompt, ) @observe() def main() nested generation() main() context managers from abvdev import get client abv = get client() prompt = abv get prompt("movie critic") with abv start as current generation( name="movie generation", model="gpt 5 2025 08 07", prompt=prompt ) as generation \# your llm call here generation update(output="llm response") if a guaranteed availability docid\ yeedfgywxhnbfmaan5v52 is used, no link will be created js/ts sdk manual observations import { abvclient } from "@abvdev/client"; import { startobservation } from "@abvdev/tracing"; const prompt = new abvclient() prompt get("my prompt"); startobservation( "llm", { input (await prompt) prompt, }, { astype "generation" }, ); context manager import { abvclient } from "@abvdev/client"; import { startactiveobservation } from "@abvdev/tracing"; const abv = new abvclient(); startactiveobservation( "llm", async (generation) => { const prompt = abv prompt get("my prompt"); generation update({ input (await prompt) prompt }); }, { astype "generation" }, ); observe wrapper import { abvclient } from "@abvdev/client"; import { observe, updateactiveobservation } from "@abvdev/tracing"; const abv = new abvclient(); const callllm = async (input string) => { const prompt = abv prompt get("my prompt"); updateactiveobservation({ prompt }, { astype "generation" }); return await invokellm(input); }; export const observedcallllm = observe(callllm); if a guaranteed availability docid\ yeedfgywxhnbfmaan5v52 is used, no link will be created