Skip to content

Commit d0e5307

Browse files
committed
add example for http api prompt variables
1 parent a868b02 commit d0e5307

File tree

1 file changed

+20
-0
lines changed
  • content/en/llm_observability/instrumentation

1 file changed

+20
-0
lines changed

content/en/llm_observability/instrumentation/api.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,26 @@ If the request is successful, the API responds with a 202 network code and an em
178178
| context_variable_keys | [string] | Variable keys that contain ground-truth or context content. Used for hallucination detection. |
179179
| tags | Dict[key (string), string] | Tags to attach to the prompt run. |
180180

181+
**Note**: LLM Observability registers new versions of templates when the template or chat_template value is updated. If the input is expected to change between invocations, extract those dynamic parts into a variable.
182+
183+
{{< code-block lang="json" >}}
184+
{
185+
"id": "translation-prompt",
186+
"chat_template": [
187+
{
188+
"role": "system",
189+
"content": "You are a translation service. You translate to {{language}}."
190+
}, {
191+
"role": "user",
192+
"content": "{{user_input}}"
193+
}
194+
],
195+
"variables": {
196+
"language": "french",
197+
"user_input": "<USER_INPUT_TEXT>"
198+
}
199+
}
200+
{{< /code-block >}}
181201

182202
#### Meta
183203
| Field | Type | Description |

0 commit comments

Comments
 (0)