For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/fr/api/latest/agent-observability/create-an-agent-observability-prompt.md. A documentation index is available at /llms.txt.
Language
Datadog site

Create an Agent Observability prompt

WARNINGNote: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.
POSThttps://api.datadoghq.com/api/v2/llm-obs/v1/promptshttps://api.us3.datadoghq.com/api/v2/llm-obs/v1/promptshttps://api.us5.datadoghq.com/api/v2/llm-obs/v1/promptshttps://api.datadoghq.eu/api/v2/llm-obs/v1/promptshttps://api.ap1.datadoghq.com/api/v2/llm-obs/v1/promptshttps://api.ap2.datadoghq.com/api/v2/llm-obs/v1/promptshttps://api.uk1.datadoghq.com/api/v2/llm-obs/v1/promptshttps://api.ddog-gov.com/api/v2/llm-obs/v1/promptshttps://api.us2.ddog-gov.com/api/v2/llm-obs/v1/prompts

Présentation

Create a new prompt (and its first version) in the Agent Observability prompt registry.

Preview: Prompt composition is available in Preview. To request access, contact Datadog Support or your Customer Success Manager.

This endpoint requires all of the following permissions:

  • llm_observability_read
  • llm_observability_write
  • feature_flag_config_read
  • feature_flag_config_write
  • feature_flag_environment_config_read

Requête

Body Data (required)

Create prompt payload.

Champ
Type
Description
data [required]
object

Data object for creating an Agent Observability prompt.

Réponse

OK

Response returned after creating an Agent Observability prompt.

Champ
Type
Description
data [required]
object

Data object returned after creating an Agent Observability prompt.

Exemple de code

Create an Agent Observability prompt
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/prompts" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "model": "provider-model",
        "response_format": {
          "type": "json_object"
        },
        "temperature": 0.2
      },
      "description": "Answers customer questions using the company knowledge base.",
      "prompt_id": "customer-support-assistant",
      "template": [
        {
          "content": "You are a helpful customer support assistant for {{company_name}}.",
          "role": "system"
        },
        {
          "content": "Help {{customer_name}} with this question: {{question}}",
          "role": "user"
        }
      ],
      "title": "Customer Support Assistant"
    },
    "type": "prompt-templates"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/prompts" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "model": "provider-model",
        "response_format": {
          "type": "json_object"
        },
        "temperature": 0.2
      },
      "description": "Answers customer questions using the company knowledge base.",
      "prompt_id": "customer-support-assistant",
      "template": [
        {
          "content": "You are a helpful customer support assistant for {{company_name}}.",
          "role": "system"
        },
        {
          "content": "Help {{customer_name}} with this question: {{question}}",
          "role": "user"
        }
      ],
      "title": "Customer Support Assistant"
    },
    "type": "prompt-templates"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/prompts" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "model": "provider-model",
        "response_format": {
          "type": "json_object"
        },
        "temperature": 0.2
      },
      "description": "Answers customer questions using the company knowledge base.",
      "prompt_id": "customer-support-assistant",
      "template": [
        {
          "content": "You are a helpful customer support assistant for {{company_name}}.",
          "role": "system"
        },
        {
          "content": "Help {{customer_name}} with this question: {{question}}",
          "role": "user"
        }
      ],
      "title": "Customer Support Assistant"
    },
    "type": "prompt-templates"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/prompts" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "model": "provider-model",
        "response_format": {
          "type": "json_object"
        },
        "temperature": 0.2
      },
      "description": "Answers customer questions using the company knowledge base.",
      "prompt_id": "customer-support-assistant",
      "template": [
        {
          "content": "You are a helpful customer support assistant for {{company_name}}.",
          "role": "system"
        },
        {
          "content": "Help {{customer_name}} with this question: {{question}}",
          "role": "user"
        }
      ],
      "title": "Customer Support Assistant"
    },
    "type": "prompt-templates"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/prompts" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "model": "provider-model",
        "response_format": {
          "type": "json_object"
        },
        "temperature": 0.2
      },
      "description": "Answers customer questions using the company knowledge base.",
      "prompt_id": "customer-support-assistant",
      "template": [
        {
          "content": "You are a helpful customer support assistant for {{company_name}}.",
          "role": "system"
        },
        {
          "content": "Help {{customer_name}} with this question: {{question}}",
          "role": "user"
        }
      ],
      "title": "Customer Support Assistant"
    },
    "type": "prompt-templates"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/prompts" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "model": "provider-model",
        "response_format": {
          "type": "json_object"
        },
        "temperature": 0.2
      },
      "description": "Answers customer questions using the company knowledge base.",
      "prompt_id": "customer-support-assistant",
      "template": [
        {
          "content": "You are a helpful customer support assistant for {{company_name}}.",
          "role": "system"
        },
        {
          "content": "Help {{customer_name}} with this question: {{question}}",
          "role": "user"
        }
      ],
      "title": "Customer Support Assistant"
    },
    "type": "prompt-templates"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/prompts" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "model": "provider-model",
        "response_format": {
          "type": "json_object"
        },
        "temperature": 0.2
      },
      "description": "Answers customer questions using the company knowledge base.",
      "prompt_id": "customer-support-assistant",
      "template": [
        {
          "content": "You are a helpful customer support assistant for {{company_name}}.",
          "role": "system"
        },
        {
          "content": "Help {{customer_name}} with this question: {{question}}",
          "role": "user"
        }
      ],
      "title": "Customer Support Assistant"
    },
    "type": "prompt-templates"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/prompts" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "model": "provider-model",
        "response_format": {
          "type": "json_object"
        },
        "temperature": 0.2
      },
      "description": "Answers customer questions using the company knowledge base.",
      "prompt_id": "customer-support-assistant",
      "template": [
        {
          "content": "You are a helpful customer support assistant for {{company_name}}.",
          "role": "system"
        },
        {
          "content": "Help {{customer_name}} with this question: {{question}}",
          "role": "user"
        }
      ],
      "title": "Customer Support Assistant"
    },
    "type": "prompt-templates"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/prompts" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "model": "provider-model",
        "response_format": {
          "type": "json_object"
        },
        "temperature": 0.2
      },
      "description": "Answers customer questions using the company knowledge base.",
      "prompt_id": "customer-support-assistant",
      "template": [
        {
          "content": "You are a helpful customer support assistant for {{company_name}}.",
          "role": "system"
        },
        {
          "content": "Help {{customer_name}} with this question: {{question}}",
          "role": "user"
        }
      ],
      "title": "Customer Support Assistant"
    },
    "type": "prompt-templates"
  }
}
EOF