For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/ja/api/latest/agent-observability/create-or-update-annotations.md. A documentation index is available at /llms.txt.
Language
Datadog site

アノテーションの作成または更新

警告Note: 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/annotation-queues/{queue_id}/annotationshttps://api.us3.datadoghq.com/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotationshttps://api.us5.datadoghq.com/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotationshttps://api.datadoghq.eu/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotationshttps://api.ap1.datadoghq.com/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotationshttps://api.ap2.datadoghq.com/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotationshttps://api.uk1.datadoghq.com/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotationshttps://api.ddog-gov.com/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotationshttps://api.us2.ddog-gov.com/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotations

概要

キュー内のインタラクションに対するアノテーションを作成または更新します。各アノテーションは、 「interaction_id」およびリクエストしたユーザーの識別情報によって照合されます。 レスポンス内の結果とエラーは、「interaction_id」によってリクエスト項目に紐付けられます。 個別アイテムのエラーは、バッチの残りの処理をブロックすることなく、「errors」フィールドで返されます。 すべてのアイテムがキューのアクセスルールによって拒否されたリクエストは、「403」を返します。

引数

パスパラメーター

名前
タイプ
説明
queue_id [required]
string

The ID of the Agent Observability annotation queue.

リクエスト

Body Data (required)

アノテーションを作成または更新するためのペイロード。

フィールド
タイプ
説明
data [required]
object

アノテーションキュー内のインタラクションに対するアノテーションの作成または更新リクエスト。

応答

OK — annotations created or updated. For mixed batches, denied items and other per-item errors are listed in errors.

Response containing the created or updated annotations.

フィールド
タイプ
説明
data [required]
object

Data object for the annotations response.

コード例

アノテーションの作成または更新
# Path parameters
export queue_id="00000000-0000-0000-0000-000000000001"

# 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/annotation-queues/${queue_id}/annotations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "annotations": [
        {
          "interaction_id": "00000000-0000-0000-0000-000000000001",
          "label_values": [
            {
              "label_schema_id": "abc-123",
              "value": "good"
            },
            {
              "label_schema_id": "ef56gh78",
              "value": "positive"
            }
          ]
        }
      ]
    },
    "type": "annotations"
  }
}
EOF
# Path parameters
export queue_id="00000000-0000-0000-0000-000000000001"

# 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/annotation-queues/${queue_id}/annotations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "annotations": [
        {
          "interaction_id": "00000000-0000-0000-0000-000000000001",
          "label_values": [
            {
              "label_schema_id": "abc-123",
              "value": "good"
            },
            {
              "label_schema_id": "ef56gh78",
              "value": "positive"
            }
          ]
        }
      ]
    },
    "type": "annotations"
  }
}
EOF
# Path parameters
export queue_id="00000000-0000-0000-0000-000000000001"

# 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/annotation-queues/${queue_id}/annotations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "annotations": [
        {
          "interaction_id": "00000000-0000-0000-0000-000000000001",
          "label_values": [
            {
              "label_schema_id": "abc-123",
              "value": "good"
            },
            {
              "label_schema_id": "ef56gh78",
              "value": "positive"
            }
          ]
        }
      ]
    },
    "type": "annotations"
  }
}
EOF
# Path parameters
export queue_id="00000000-0000-0000-0000-000000000001"

# 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/annotation-queues/${queue_id}/annotations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "annotations": [
        {
          "interaction_id": "00000000-0000-0000-0000-000000000001",
          "label_values": [
            {
              "label_schema_id": "abc-123",
              "value": "good"
            },
            {
              "label_schema_id": "ef56gh78",
              "value": "positive"
            }
          ]
        }
      ]
    },
    "type": "annotations"
  }
}
EOF
# Path parameters
export queue_id="00000000-0000-0000-0000-000000000001"

# 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/annotation-queues/${queue_id}/annotations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "annotations": [
        {
          "interaction_id": "00000000-0000-0000-0000-000000000001",
          "label_values": [
            {
              "label_schema_id": "abc-123",
              "value": "good"
            },
            {
              "label_schema_id": "ef56gh78",
              "value": "positive"
            }
          ]
        }
      ]
    },
    "type": "annotations"
  }
}
EOF
# Path parameters
export queue_id="00000000-0000-0000-0000-000000000001"

# 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/annotation-queues/${queue_id}/annotations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "annotations": [
        {
          "interaction_id": "00000000-0000-0000-0000-000000000001",
          "label_values": [
            {
              "label_schema_id": "abc-123",
              "value": "good"
            },
            {
              "label_schema_id": "ef56gh78",
              "value": "positive"
            }
          ]
        }
      ]
    },
    "type": "annotations"
  }
}
EOF
# Path parameters
export queue_id="00000000-0000-0000-0000-000000000001"

# 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/annotation-queues/${queue_id}/annotations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "annotations": [
        {
          "interaction_id": "00000000-0000-0000-0000-000000000001",
          "label_values": [
            {
              "label_schema_id": "abc-123",
              "value": "good"
            },
            {
              "label_schema_id": "ef56gh78",
              "value": "positive"
            }
          ]
        }
      ]
    },
    "type": "annotations"
  }
}
EOF
# Path parameters
export queue_id="00000000-0000-0000-0000-000000000001"

# 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/annotation-queues/${queue_id}/annotations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "annotations": [
        {
          "interaction_id": "00000000-0000-0000-0000-000000000001",
          "label_values": [
            {
              "label_schema_id": "abc-123",
              "value": "good"
            },
            {
              "label_schema_id": "ef56gh78",
              "value": "positive"
            }
          ]
        }
      ]
    },
    "type": "annotations"
  }
}
EOF
# Path parameters
export queue_id="00000000-0000-0000-0000-000000000001"

# 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/annotation-queues/${queue_id}/annotations" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "annotations": [
        {
          "interaction_id": "00000000-0000-0000-0000-000000000001",
          "label_values": [
            {
              "label_schema_id": "abc-123",
              "value": "good"
            },
            {
              "label_schema_id": "ef56gh78",
              "value": "positive"
            }
          ]
        }
      ]
    },
    "type": "annotations"
  }
}
EOF