List all versions of an LLM Observability prompt, ordered newest to oldest. If the prompt does not exist, is not registered, or is archived, the response contains an empty list.
This endpoint requires the llm_observability_read permission.
Arguments
Path Parameters
Name
Type
Description
prompt_id [required]
string
The customer-provided identifier of the LLM Observability prompt.
"""
List versions of an LLM Observability prompt returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.llm_observability_apiimportLLMObservabilityApi# there is a valid "prompt" in the systemPROMPT_DATA_ATTRIBUTES_PROMPT_ID=environ["PROMPT_DATA_ATTRIBUTES_PROMPT_ID"]configuration=Configuration()configuration.unstable_operations["list_llm_obs_prompt_versions"]=TruewithApiClient(configuration)asapi_client:api_instance=LLMObservabilityApi(api_client)response=api_instance.list_llm_obs_prompt_versions(prompt_id=PROMPT_DATA_ATTRIBUTES_PROMPT_ID,)print(response)
# List versions of an LLM Observability prompt returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.list_llm_obs_prompt_versions".to_sym]=trueendapi_instance=DatadogAPIClient::V2::LLMObservabilityAPI.new# there is a valid "prompt" in the systemPROMPT_DATA_ATTRIBUTES_PROMPT_ID=ENV["PROMPT_DATA_ATTRIBUTES_PROMPT_ID"]papi_instance.list_llm_obs_prompt_versions(PROMPT_DATA_ATTRIBUTES_PROMPT_ID)
// List versions of an LLM 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(){// there is a valid "prompt" in the systemPromptDataAttributesPromptID:=os.Getenv("PROMPT_DATA_ATTRIBUTES_PROMPT_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.ListLLMObsPromptVersions",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewLLMObservabilityApi(apiClient)resp,r,err:=api.ListLLMObsPromptVersions(ctx,PromptDataAttributesPromptID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `LLMObservabilityApi.ListLLMObsPromptVersions`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `LLMObservabilityApi.ListLLMObsPromptVersions`:\n%s\n",responseContent)}
// List versions of an LLM Observability prompt returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.LlmObservabilityApi;importcom.datadog.api.client.v2.model.LLMObsPromptVersionsResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.listLLMObsPromptVersions",true);LlmObservabilityApiapiInstance=newLlmObservabilityApi(defaultClient);// there is a valid "prompt" in the systemStringPROMPT_DATA_ATTRIBUTES_PROMPT_ID=System.getenv("PROMPT_DATA_ATTRIBUTES_PROMPT_ID");try{LLMObsPromptVersionsResponseresult=apiInstance.listLLMObsPromptVersions(PROMPT_DATA_ATTRIBUTES_PROMPT_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling LlmObservabilityApi#listLLMObsPromptVersions");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// List versions of an LLM Observability prompt returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI;#[tokio::main]asyncfnmain(){// there is a valid "prompt" in the system
letprompt_data_attributes_prompt_id=std::env::var("PROMPT_DATA_ATTRIBUTES_PROMPT_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.ListLLMObsPromptVersions",true);letapi=LLMObservabilityAPI::with_config(configuration);letresp=api.list_llm_obs_prompt_versions(prompt_data_attributes_prompt_id.clone()).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
/**
* List versions of an LLM Observability prompt returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.listLLMObsPromptVersions"]=true;constapiInstance=newv2.LLMObservabilityApi(configuration);// there is a valid "prompt" in the system
constPROMPT_DATA_ATTRIBUTES_PROMPT_ID=process.env.PROMPT_DATA_ATTRIBUTES_PROMPT_IDasstring;constparams: v2.LLMObservabilityApiListLLMObsPromptVersionsRequest={promptId: PROMPT_DATA_ATTRIBUTES_PROMPT_ID,};apiInstance.listLLMObsPromptVersions(params).then((data: v2.LLMObsPromptVersionsResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));