프롬프트 ID를 사용하여 Agent Observability 프롬프트의 최신 버전을 가져옵니다.
This endpoint requires the llm_observability_read permission.
인수
경로 파라미터
이름
유형
설명
prompt_id [required]
string
The customer-provided identifier of the Agent Observability prompt.
쿼리 문자열
이름
유형
설명
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
항목
유형
설명
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. Empty config is omitted when configuration authoring is disabled for the organization. Non-empty saved configuration is always returned.
chat_template
[ <oneOf>]
Chat template for this prompt version, as a list of messages and named message placeholders. Omitted for text templates.
Preview: Message placeholders are available in Preview. To request access, contact Datadog Support or your Customer Success Manager.
Object 1
object
A single chat message in a prompt template.
content [required]
string
Content of the message.
role [required]
string
Role of the message (for example system, user, or assistant).
<type=placeholder>
object
A named placeholder that inserts a list of messages when a compatible SDK formats the prompt.
Preview: Message placeholders are available in Preview. To request access, contact Datadog Support or your Customer Success Manager.
name [required]
string
Name used to supply the message list when formatting the prompt.
type [required]
enum
Type of chat-template item.
Allowed enum values: placeholder
config
object
Versioned prompt configuration is in Preview. To request access, contact Datadog Support or your Customer Success Manager. Customer-owned configuration delivered with a prompt version. Datadog stores and returns the object without interpolating it, validating provider-specific keys, or applying it to model calls. Do not include secrets.
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"},{"name":"history","type":"placeholder"},{"content":"Help {{customer_name}} with this question: {{question}}","role":"user"}],"config":{"model":"provider-model","temperature":0.2},"prompt_id":"customer-support-assistant","prompt_version_uuid":"d83ab666-61cc-5545-a83b-2424bb85467b","version":"2"},"id":"4a1a28ff-8a25-5f0f-946f-f48264d772eb","type":"prompt-templates"}}
# Path parameters exportprompt_id="customer-support-assistant" # Use a Personal Access Token or Service Access Token exportDD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
"""
Get an Agent Observability prompt returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.agent_observability_apiimportAgentObservabilityApiconfiguration=Configuration()configuration.access_token=environ["DD_BEARER_TOKEN"]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)
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"python3"example.py"
# Get an Agent Observability prompt returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.access_token=ENV["DD_BEARER_TOKEN"]config.unstable_operations["v2.get_llm_obs_prompt".to_sym]=trueendapi_instance=DatadogAPIClient::V2::AgentObservabilityAPI.newpapi_instance.get_llm_obs_prompt("prompt_id")
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"rb"example.rb"
// 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())ctx=context.WithValue(ctx,datadog.ContextAccessToken,os.Getenv("DD_BEARER_TOKEN"))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)}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"go run"main.go"
// Get an Agent Observability prompt returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.AgentObservabilityApi;importcom.datadog.api.client.v2.model.LLMObsPromptSDKResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));defaultClient.setUnstableOperationEnabled("v2.getLLMObsPrompt",true);AgentObservabilityApiapiInstance=newAgentObservabilityApi(defaultClient);try{LLMObsPromptSDKResponseresult=apiInstance.getLLMObsPrompt("customer-support-assistant");System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling AgentObservabilityApi#getLLMObsPrompt");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"java"Example.java"
// 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({authMethods:{AuthZ:{accessToken: process.env.DD_BEARER_TOKENasstring,},},});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));
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"tsc"example.ts"
맞춤형 데모 요청
Datadog 시작하기
Ask AI
AI-generated responses may be inaccurate. Verify important info.