Skip to content

Get Prompt

url and api_key (or apiKey) default to the SHIELD360_URL and SHIELD360_API_KEY environment variables if you don’t pass them explicitly.

import shield360
response = shield360.get_prompt(
name="prompt_name",
should_compile=True,
variables={
"name": "John",
},
)
print(response)
Terminal window
{
err: null,
res: {
promptId: '88c4cbcd-87f9-4957-a37b-b41066e17471',
name: 'prompt_name',
version: '3.3.3',
tags: [ 'user', 'greeting' ],
metaProperties: { model: 'gpt4' },
prompt: 'Hello {{name}}, how are you today?',
compiledPrompt: 'Hello John, how are you today?'
}
}

url, api_key, name, prompt_id, version, should_compile, variables, and meta_properties are all available parameters, matching the request body above.