Get the latest version of an Agent Observability prompt by prompt ID.
This endpoint requires the llm_observability_read permission.
Arguments
Path Parameters
Name
Type
Description
prompt_id [required]
string
The customer-provided identifier of the Agent Observability prompt.
Query Strings
Name
Type
Description
label
string
Deprecated. Optional label of the prompt version to return. Do not use this parameter for new integrations. If omitted, the latest version is returned. If the prompt has no labels, the latest version is returned even when a label is requested. If the prompt has labels but none match the requested label, a 404 response is returned.
Response containing a flattened Agent Observability prompt version for SDK consumption.
Expand All
Field
Type
Description
data [required]
object
Data object for a flattened Agent Observability prompt version returned for SDK consumption.
attributes [required]
object
Attributes of a flattened prompt version returned for SDK consumption. Exactly one of template and chat_template is returned.
chat_template
[object]
Chat template for this prompt version, as a list of role and content messages. Omitted for text templates.
content [required]
string
Content of the message.
role [required]
string
Role of the message (for example system, user, or assistant).
labels
[string]
DEPRECATED: Labels attached to the selected version.
prompt_id
string
Customer-provided identifier of the prompt.
prompt_version_uuid
string
Unique identifier of this prompt version.
template
string
Text template for this prompt version. Omitted for chat templates.
version
string
Version identifier for this prompt version. This is the sequential version number unless a user-supplied version identifier was set, in which case that identifier is used instead.
id [required]
string
Unique identifier of the prompt.
type [required]
enum
Resource type of an Agent Observability prompt.
Allowed enum values: prompt-templates
{"data":{"attributes":{"chat_template":[{"content":"You are a helpful customer support assistant for {{company_name}}.","role":"system"},{"content":"Help {{customer_name}} with this question: {{question}}","role":"user"}],"prompt_id":"customer-support-assistant","prompt_version_uuid":"d83ab666-61cc-5545-a83b-2424bb85467b","version":"2"},"id":"4a1a28ff-8a25-5f0f-946f-f48264d772eb","type":"prompt-templates"}}
"""
Get an Agent Observability prompt returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.agent_observability_apiimportAgentObservabilityApiconfiguration=Configuration()configuration.unstable_operations["get_llm_obs_prompt"]=TruewithApiClient(configuration)asapi_client:api_instance=AgentObservabilityApi(api_client)response=api_instance.get_llm_obs_prompt(prompt_id="prompt_id",)print(response)
# Get an Agent Observability prompt returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.get_llm_obs_prompt".to_sym]=trueendapi_instance=DatadogAPIClient::V2::AgentObservabilityAPI.newpapi_instance.get_llm_obs_prompt("prompt_id")
// Get an Agent Observability prompt returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.GetLLMObsPrompt",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewAgentObservabilityApi(apiClient)resp,r,err:=api.GetLLMObsPrompt(ctx,"prompt_id",*datadogV2.NewGetLLMObsPromptOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `AgentObservabilityApi.GetLLMObsPrompt`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `AgentObservabilityApi.GetLLMObsPrompt`:\n%s\n",responseContent)}
// Get an Agent Observability prompt returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_agent_observability::AgentObservabilityAPI;usedatadog_api_client::datadogV2::api_agent_observability::GetLLMObsPromptOptionalParams;#[tokio::main]asyncfnmain(){letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.GetLLMObsPrompt",true);letapi=AgentObservabilityAPI::with_config(configuration);letresp=api.get_llm_obs_prompt("prompt_id".to_string(),GetLLMObsPromptOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get an Agent Observability prompt returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.getLLMObsPrompt"]=true;constapiInstance=newv2.AgentObservabilityApi(configuration);constparams: v2.AgentObservabilityApiGetLLMObsPromptRequest={promptId:"prompt_id",};apiInstance.getLLMObsPrompt(params).then((data: v2.LLMObsPromptSDKResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));