Skip to main content

prompt_versions

Creates, updates, deletes, gets or lists a prompt_versions resource.

Overview

Nameprompt_versions
TypeResource
Iddatadog.llm_observability.prompt_versions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringUnique identifier of the prompt version. (example: d83ab666-61cc-5545-a83b-2424bb85467b)
attributesobjectAttributes of a specific version of an Agent Observability prompt.
typestringResource type of an Agent Observability prompt version. (prompt-template-versions) (example: prompt-template-versions)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_llmobs_prompt_versionselectprompt_id, versionGet the full template of a single, specific version of an Agent Observability prompt.
list_llmobs_prompt_versionsselectprompt_idList all versions of an Agent Observability prompt, ordered newest to oldest. If the prompt does not exist, is not registered, or is archived, the response contains an empty list.
create_llmobs_prompt_versioninsertprompt_id, dataCreate a new version of an existing Agent Observability prompt.
update_llmobs_prompt_versionupdateprompt_id, version, dataUpdate the description, the feature-flag environments, or both, for a specific version of an Agent Observability prompt.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
prompt_idstringThe customer-provided identifier of the Agent Observability prompt. (example: customer-support-assistant)
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.
versioninteger (int64)The version number of the Agent Observability prompt. (example: 1)

SELECT examples

Get the full template of a single, specific version of an Agent Observability prompt.

SELECT
id,
attributes,
type
FROM datadog.llm_observability.prompt_versions
WHERE prompt_id = '{{ prompt_id }}' -- required
AND version = '{{ version }}' -- required
;

INSERT examples

Create a new version of an existing Agent Observability prompt.

INSERT INTO datadog.llm_observability.prompt_versions (
data,
prompt_id
)
SELECT
'{{ data }}' /* required */,
'{{ prompt_id }}'
RETURNING
data
;

UPDATE examples

Update the description, the feature-flag environments, or both, for a specific version of an Agent Observability prompt.

UPDATE datadog.llm_observability.prompt_versions
SET
data = '{{ data }}'
WHERE
prompt_id = '{{ prompt_id }}' --required
AND version = '{{ version }}' --required
AND data = '{{ data }}' --required
RETURNING
data;