diff --git a/content/en/llm_observability/instrumentation/api.md b/content/en/llm_observability/instrumentation/api.md index 467e216c2216a..4b04af0725f7a 100644 --- a/content/en/llm_observability/instrumentation/api.md +++ b/content/en/llm_observability/instrumentation/api.md @@ -167,6 +167,8 @@ If the request is successful, the API responds with a 202 network code and an em | id | string | The id of this document. | #### Prompt +{{< tabs >}} +{{% tab "Model" %}} | Field | Type | Description | |----------------------|--------|--------------------------| | id | string | Logical identifier for this prompt template. Should be unique per `ml_app`. | @@ -178,6 +180,30 @@ If the request is successful, the API responds with a 202 network code and an em | context_variable_keys | [string] | Variable keys that contain ground-truth or context content. Used for hallucination detection. | | tags | Dict[key (string), string] | Tags to attach to the prompt run. | +**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 the dynamic parts into a variable. + +{{% /tab %}} +{{% tab "Example" %}} +{{< code-block lang="json" >}} +{ + "id": "translation-prompt", + "chat_template": [ + { + "role": "system", + "content": "You are a translation service. You translate to {{language}}." + }, { + "role": "user", + "content": "{{user_input}}" + } + ], + "variables": { + "language": "french", + "user_input": "" + } +} +{{< /code-block >}} +{{% /tab %}} +{{< /tabs >}} #### Meta | Field | Type | Description |