For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/api/latest/agent-observability/create-a-new-agent-observability-prompt-version.md. A documentation index is available at /llms.txt.
Language
Datadog site

Create a new Agent Observability prompt version

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/prompts/{prompt_id}/versionshttps://api.us3.datadoghq.com/api/v2/llm-obs/v1/prompts/{prompt_id}/versionshttps://api.us5.datadoghq.com/api/v2/llm-obs/v1/prompts/{prompt_id}/versionshttps://api.datadoghq.eu/api/v2/llm-obs/v1/prompts/{prompt_id}/versionshttps://api.ap1.datadoghq.com/api/v2/llm-obs/v1/prompts/{prompt_id}/versionshttps://api.ap2.datadoghq.com/api/v2/llm-obs/v1/prompts/{prompt_id}/versionshttps://api.uk1.datadoghq.com/api/v2/llm-obs/v1/prompts/{prompt_id}/versionshttps://api.ddog-gov.com/api/v2/llm-obs/v1/prompts/{prompt_id}/versionshttps://api.us2.ddog-gov.com/api/v2/llm-obs/v1/prompts/{prompt_id}/versions

Overview

Create a new version of an existing Agent Observability prompt.

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

Arguments

Path Parameters

Name
Type
Description
prompt_id [required]
string

The customer-provided identifier of the Agent Observability prompt.

Request

Body Data (required)

Create prompt version payload.

Field
Type
Description
data [required]
object

Data object for creating an Agent Observability prompt version.

Response

OK

Response containing a specific version of an Agent Observability prompt.

Field
Type
Description
data [required]
object

Data object for a specific version of an Agent Observability prompt.

Code Example

Create a new Agent Observability prompt version
## Create a version that includes all or selected messages from other prompts

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "template": {
        "messages": [
          {
            "include": {
              "prompt_id": "assistant-introduction",
              "version": 2
            }
          },
          {
            "include": {
              "items": [
                2,
                0,
                0
              ],
              "prompt_id": "response-examples",
              "version": 4
            }
          },
          {
            "content": "Answer {{question}}.",
            "role": "user"
          }
        ]
      }
    },
    "type": "prompt-template-versions"
  }
}
EOF

## Create a version that includes text from another prompt

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "Reuse the exact response policy.",
      "template": "{{>response-policy version=3}}\n\nAnswer {{question}}."
    },
    "type": "prompt-template-versions"
  }
}
EOF

## default

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "model": "provider-model",
        "temperature": 0.4
      },
      "description": "Give concise answers and cite relevant help-center articles.",
      "template": [
        {
          "content": "You are a helpful customer support assistant for {{company_name}}.",
          "role": "system"
        },
        {
          "content": "Help {{customer_name}} with this question: {{question}}",
          "role": "user"
        }
      ]
    },
    "type": "prompt-template-versions"
  }
}
EOF
## Create a version that includes all or selected messages from other prompts

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "template": {
        "messages": [
          {
            "include": {
              "prompt_id": "assistant-introduction",
              "version": 2
            }
          },
          {
            "include": {
              "items": [
                2,
                0,
                0
              ],
              "prompt_id": "response-examples",
              "version": 4
            }
          },
          {
            "content": "Answer {{question}}.",
            "role": "user"
          }
        ]
      }
    },
    "type": "prompt-template-versions"
  }
}
EOF

## Create a version that includes text from another prompt

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "Reuse the exact response policy.",
      "template": "{{>response-policy version=3}}\n\nAnswer {{question}}."
    },
    "type": "prompt-template-versions"
  }
}
EOF

## default

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "model": "provider-model",
        "temperature": 0.4
      },
      "description": "Give concise answers and cite relevant help-center articles.",
      "template": [
        {
          "content": "You are a helpful customer support assistant for {{company_name}}.",
          "role": "system"
        },
        {
          "content": "Help {{customer_name}} with this question: {{question}}",
          "role": "user"
        }
      ]
    },
    "type": "prompt-template-versions"
  }
}
EOF
## Create a version that includes all or selected messages from other prompts

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "template": {
        "messages": [
          {
            "include": {
              "prompt_id": "assistant-introduction",
              "version": 2
            }
          },
          {
            "include": {
              "items": [
                2,
                0,
                0
              ],
              "prompt_id": "response-examples",
              "version": 4
            }
          },
          {
            "content": "Answer {{question}}.",
            "role": "user"
          }
        ]
      }
    },
    "type": "prompt-template-versions"
  }
}
EOF

## Create a version that includes text from another prompt

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "Reuse the exact response policy.",
      "template": "{{>response-policy version=3}}\n\nAnswer {{question}}."
    },
    "type": "prompt-template-versions"
  }
}
EOF

## default

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "model": "provider-model",
        "temperature": 0.4
      },
      "description": "Give concise answers and cite relevant help-center articles.",
      "template": [
        {
          "content": "You are a helpful customer support assistant for {{company_name}}.",
          "role": "system"
        },
        {
          "content": "Help {{customer_name}} with this question: {{question}}",
          "role": "user"
        }
      ]
    },
    "type": "prompt-template-versions"
  }
}
EOF
## Create a version that includes all or selected messages from other prompts

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "template": {
        "messages": [
          {
            "include": {
              "prompt_id": "assistant-introduction",
              "version": 2
            }
          },
          {
            "include": {
              "items": [
                2,
                0,
                0
              ],
              "prompt_id": "response-examples",
              "version": 4
            }
          },
          {
            "content": "Answer {{question}}.",
            "role": "user"
          }
        ]
      }
    },
    "type": "prompt-template-versions"
  }
}
EOF

## Create a version that includes text from another prompt

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "Reuse the exact response policy.",
      "template": "{{>response-policy version=3}}\n\nAnswer {{question}}."
    },
    "type": "prompt-template-versions"
  }
}
EOF

## default

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "model": "provider-model",
        "temperature": 0.4
      },
      "description": "Give concise answers and cite relevant help-center articles.",
      "template": [
        {
          "content": "You are a helpful customer support assistant for {{company_name}}.",
          "role": "system"
        },
        {
          "content": "Help {{customer_name}} with this question: {{question}}",
          "role": "user"
        }
      ]
    },
    "type": "prompt-template-versions"
  }
}
EOF
## Create a version that includes all or selected messages from other prompts

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "template": {
        "messages": [
          {
            "include": {
              "prompt_id": "assistant-introduction",
              "version": 2
            }
          },
          {
            "include": {
              "items": [
                2,
                0,
                0
              ],
              "prompt_id": "response-examples",
              "version": 4
            }
          },
          {
            "content": "Answer {{question}}.",
            "role": "user"
          }
        ]
      }
    },
    "type": "prompt-template-versions"
  }
}
EOF

## Create a version that includes text from another prompt

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "Reuse the exact response policy.",
      "template": "{{>response-policy version=3}}\n\nAnswer {{question}}."
    },
    "type": "prompt-template-versions"
  }
}
EOF

## default

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "model": "provider-model",
        "temperature": 0.4
      },
      "description": "Give concise answers and cite relevant help-center articles.",
      "template": [
        {
          "content": "You are a helpful customer support assistant for {{company_name}}.",
          "role": "system"
        },
        {
          "content": "Help {{customer_name}} with this question: {{question}}",
          "role": "user"
        }
      ]
    },
    "type": "prompt-template-versions"
  }
}
EOF
## Create a version that includes all or selected messages from other prompts

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "template": {
        "messages": [
          {
            "include": {
              "prompt_id": "assistant-introduction",
              "version": 2
            }
          },
          {
            "include": {
              "items": [
                2,
                0,
                0
              ],
              "prompt_id": "response-examples",
              "version": 4
            }
          },
          {
            "content": "Answer {{question}}.",
            "role": "user"
          }
        ]
      }
    },
    "type": "prompt-template-versions"
  }
}
EOF

## Create a version that includes text from another prompt

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "Reuse the exact response policy.",
      "template": "{{>response-policy version=3}}\n\nAnswer {{question}}."
    },
    "type": "prompt-template-versions"
  }
}
EOF

## default

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "model": "provider-model",
        "temperature": 0.4
      },
      "description": "Give concise answers and cite relevant help-center articles.",
      "template": [
        {
          "content": "You are a helpful customer support assistant for {{company_name}}.",
          "role": "system"
        },
        {
          "content": "Help {{customer_name}} with this question: {{question}}",
          "role": "user"
        }
      ]
    },
    "type": "prompt-template-versions"
  }
}
EOF
## Create a version that includes all or selected messages from other prompts

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "template": {
        "messages": [
          {
            "include": {
              "prompt_id": "assistant-introduction",
              "version": 2
            }
          },
          {
            "include": {
              "items": [
                2,
                0,
                0
              ],
              "prompt_id": "response-examples",
              "version": 4
            }
          },
          {
            "content": "Answer {{question}}.",
            "role": "user"
          }
        ]
      }
    },
    "type": "prompt-template-versions"
  }
}
EOF

## Create a version that includes text from another prompt

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "Reuse the exact response policy.",
      "template": "{{>response-policy version=3}}\n\nAnswer {{question}}."
    },
    "type": "prompt-template-versions"
  }
}
EOF

## default

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "model": "provider-model",
        "temperature": 0.4
      },
      "description": "Give concise answers and cite relevant help-center articles.",
      "template": [
        {
          "content": "You are a helpful customer support assistant for {{company_name}}.",
          "role": "system"
        },
        {
          "content": "Help {{customer_name}} with this question: {{question}}",
          "role": "user"
        }
      ]
    },
    "type": "prompt-template-versions"
  }
}
EOF
## Create a version that includes all or selected messages from other prompts

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "template": {
        "messages": [
          {
            "include": {
              "prompt_id": "assistant-introduction",
              "version": 2
            }
          },
          {
            "include": {
              "items": [
                2,
                0,
                0
              ],
              "prompt_id": "response-examples",
              "version": 4
            }
          },
          {
            "content": "Answer {{question}}.",
            "role": "user"
          }
        ]
      }
    },
    "type": "prompt-template-versions"
  }
}
EOF

## Create a version that includes text from another prompt

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "Reuse the exact response policy.",
      "template": "{{>response-policy version=3}}\n\nAnswer {{question}}."
    },
    "type": "prompt-template-versions"
  }
}
EOF

## default

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "model": "provider-model",
        "temperature": 0.4
      },
      "description": "Give concise answers and cite relevant help-center articles.",
      "template": [
        {
          "content": "You are a helpful customer support assistant for {{company_name}}.",
          "role": "system"
        },
        {
          "content": "Help {{customer_name}} with this question: {{question}}",
          "role": "user"
        }
      ]
    },
    "type": "prompt-template-versions"
  }
}
EOF
## Create a version that includes all or selected messages from other prompts

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "template": {
        "messages": [
          {
            "include": {
              "prompt_id": "assistant-introduction",
              "version": 2
            }
          },
          {
            "include": {
              "items": [
                2,
                0,
                0
              ],
              "prompt_id": "response-examples",
              "version": 4
            }
          },
          {
            "content": "Answer {{question}}.",
            "role": "user"
          }
        ]
      }
    },
    "type": "prompt-template-versions"
  }
}
EOF

## Create a version that includes text from another prompt

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "Reuse the exact response policy.",
      "template": "{{>response-policy version=3}}\n\nAnswer {{question}}."
    },
    "type": "prompt-template-versions"
  }
}
EOF

## default

# Path parameters
export prompt_id="customer-support-assistant"

# 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/${prompt_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "model": "provider-model",
        "temperature": 0.4
      },
      "description": "Give concise answers and cite relevant help-center articles.",
      "template": [
        {
          "content": "You are a helpful customer support assistant for {{company_name}}.",
          "role": "system"
        },
        {
          "content": "Help {{customer_name}} with this question: {{question}}",
          "role": "user"
        }
      ]
    },
    "type": "prompt-template-versions"
  }
}
EOF