检索提示
查看如何使用 Portkey 的提示模板与 OpenAI(或任何其他提供者)SDK
使用 Render 端点/方法
Render 端点/方法curl -X POST "https://api.portkey.ai/v1/prompts/$PROMPT_ID/render" \
-H "Content-Type: application/json" \
-H "x-portkey-api-key: $PORTKEY_API_KEY" \
-d '{
"variables": {"movie":"Dune 2"}
}'{
"success": true,
"data": {
"model": "gpt-4",
"n": 1,
"top_p": 1,
"max_tokens": 256,
"temperature": 0,
"presence_penalty": 0,
"frequency_penalty": 0,
"messages": [
{
"role": "system",
"content": "You're a helpful assistant."
},
{
"role": "user",
"content": "Who directed Dune 2?"
}
]
}
}更新提示参数同时检索提示
使用 render 输出进行新请求
render 输出进行新请求Last updated