diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e09a2b56b0b6..681999b60bb7 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -77999,6 +77999,13 @@ components: LLMObsAnnotationItem: description: A single annotation on an interaction. properties: + annotator: + description: |- + Caller-supplied name or identifier for the external person or automated system that produced the labels. + The value is stored and returned as provided. It is not a Datadog user ID or login, and it is not + resolved against Datadog users. + example: "Alex Contractor" + type: string created_at: description: Timestamp when the annotation was created. example: "2024-01-15T10:30:00Z" @@ -78044,6 +78051,13 @@ components: LLMObsAnnotationItemResponse: description: A single annotation on an interaction, as returned by the API. properties: + annotator: + description: |- + Caller-supplied name or identifier for the external person or automated system that produced the labels. + The value is stored and returned as provided. It is not a Datadog user ID or login, and it is not + resolved against Datadog users. + example: "Alex Contractor" + type: string created_at: description: Timestamp when the annotation was created. example: "2024-01-15T10:30:00Z" @@ -84929,6 +84943,18 @@ components: A single annotation to create or update. The annotation is matched by `interaction_id` and the requesting user's identity. properties: + annotator: + description: |- + Caller-supplied name or identifier for the external person or automated system that produced the labels. + The value is an opaque string with no required format. Use a stable, recognizable value for the same + producer across annotations. + The value is stored and returned as provided. It is not a Datadog user ID or login, and it is not + resolved against Datadog users. + Omit this field or set it to `null` to preserve existing attribution. Set it to an empty string to clear + attribution. + example: "Alex Contractor" + nullable: true + type: string interaction_id: description: ID of the interaction to annotate. example: "00000000-0000-0000-0000-000000000001" @@ -208224,6 +208250,8 @@ paths: description: |- Create or update annotations on interactions in a queue. Each annotation is matched by `interaction_id` and the requesting user's identity. + Use the optional `annotator` field to name an external person or automated system that produced the labels + without changing the authenticated creator, modifier, permissions, or per-user matching behavior. Results and errors in the response are linked to request items by `interaction_id`. Errors for individual items are returned in the `errors` field without blocking the rest of the batch. Requests where every item is denied by queue access rules return `403`. @@ -208239,7 +208267,8 @@ paths: data: attributes: annotations: - - interaction_id: 00000000-0000-0000-0000-000000000001 + - annotator: "Alex Contractor" + interaction_id: 00000000-0000-0000-0000-000000000001 label_values: - label_schema_id: abc-123 value: good @@ -208260,7 +208289,8 @@ paths: data: attributes: annotations: - - created_at: "2024-01-15T10:30:00Z" + - annotator: "Alex Contractor" + created_at: "2024-01-15T10:30:00Z" created_by: 00000000-0000-0000-0000-000000000002 id: 00000000-0000-0000-0000-000000000000 interaction_id: 00000000-0000-0000-0000-000000000001 @@ -208277,7 +208307,8 @@ paths: data: attributes: annotations: - - created_at: "2024-01-15T10:30:00Z" + - annotator: "Alex Contractor" + created_at: "2024-01-15T10:30:00Z" created_by: 00000000-0000-0000-0000-000000000002 id: 00000000-0000-0000-0000-000000000000 interaction_id: 00000000-0000-0000-0000-000000000001 diff --git a/examples/v2/agent-observability/UpsertLLMObsAnnotations.rb b/examples/v2/agent-observability/UpsertLLMObsAnnotations.rb index fddae305fd12..334d7a44c1b7 100644 --- a/examples/v2/agent-observability/UpsertLLMObsAnnotations.rb +++ b/examples/v2/agent-observability/UpsertLLMObsAnnotations.rb @@ -13,6 +13,7 @@ attributes: DatadogAPIClient::V2::LLMObsAnnotationsDataAttributesRequest.new({ annotations: [ DatadogAPIClient::V2::LLMObsUpsertAnnotationItem.new({ + annotator: "Alex Contractor", interaction_id: "00000000-0000-0000-0000-000000000001", label_values: [ DatadogAPIClient::V2::LLMObsAnnotationLabelValue.new({ diff --git a/features/v2/agent_observability.feature b/features/v2/agent_observability.feature index 7fb0f6b37b60..8bfc812c5eeb 100644 --- a/features/v2/agent_observability.feature +++ b/features/v2/agent_observability.feature @@ -395,7 +395,7 @@ Feature: Agent Observability Given operation "UpsertLLMObsAnnotations" enabled And new "UpsertLLMObsAnnotations" request And request contains "queue_id" parameter from "REPLACE.ME" - And body with value {"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"}} + And body with value {"data": {"attributes": {"annotations": [{"annotator": "Alex Contractor", "interaction_id": "00000000-0000-0000-0000-000000000001", "label_values": [{"label_schema_id": "abc-123", "value": "good"}, {"label_schema_id": "ef56gh78", "value": "positive"}]}]}, "type": "annotations"}} When the request is sent Then the response status is 400 Bad Request @@ -404,7 +404,7 @@ Feature: Agent Observability Given operation "UpsertLLMObsAnnotations" enabled And new "UpsertLLMObsAnnotations" request And request contains "queue_id" parameter from "REPLACE.ME" - And body with value {"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"}} + And body with value {"data": {"attributes": {"annotations": [{"annotator": "Alex Contractor", "interaction_id": "00000000-0000-0000-0000-000000000001", "label_values": [{"label_schema_id": "abc-123", "value": "good"}, {"label_schema_id": "ef56gh78", "value": "positive"}]}]}, "type": "annotations"}} When the request is sent Then the response status is 404 Not Found — the queue does not exist. @@ -413,7 +413,7 @@ Feature: Agent Observability Given operation "UpsertLLMObsAnnotations" enabled And new "UpsertLLMObsAnnotations" request And request contains "queue_id" parameter from "REPLACE.ME" - And body with value {"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"}} + And body with value {"data": {"attributes": {"annotations": [{"annotator": "Alex Contractor", "interaction_id": "00000000-0000-0000-0000-000000000001", "label_values": [{"label_schema_id": "abc-123", "value": "good"}, {"label_schema_id": "ef56gh78", "value": "positive"}]}]}, "type": "annotations"}} When the request is sent Then the response status is 200 OK — annotations created or updated. For mixed batches, denied items and other per-item errors are listed in `errors`. diff --git a/lib/datadog_api_client/v2/api/agent_observability_api.rb b/lib/datadog_api_client/v2/api/agent_observability_api.rb index 9cb4de3d263c..9cf6370d34c8 100644 --- a/lib/datadog_api_client/v2/api/agent_observability_api.rb +++ b/lib/datadog_api_client/v2/api/agent_observability_api.rb @@ -5619,6 +5619,8 @@ def upsert_llm_obs_annotations(queue_id, body, opts = {}) # # Create or update annotations on interactions in a queue. Each annotation is matched # by `interaction_id` and the requesting user's identity. + # Use the optional `annotator` field to name an external person or automated system that produced the labels + # without changing the authenticated creator, modifier, permissions, or per-user matching behavior. # Results and errors in the response are linked to request items by `interaction_id`. # Errors for individual items are returned in the `errors` field without blocking the rest of the batch. # Requests where every item is denied by queue access rules return `403`. diff --git a/lib/datadog_api_client/v2/models/llm_obs_annotation_item.rb b/lib/datadog_api_client/v2/models/llm_obs_annotation_item.rb index 2fd97f39cd79..a365dc31016a 100644 --- a/lib/datadog_api_client/v2/models/llm_obs_annotation_item.rb +++ b/lib/datadog_api_client/v2/models/llm_obs_annotation_item.rb @@ -21,6 +21,11 @@ module DatadogAPIClient::V2 class LLMObsAnnotationItem include BaseGenericModel + # Caller-supplied name or identifier for the external person or automated system that produced the labels. + # The value is stored and returned as provided. It is not a Datadog user ID or login, and it is not + # resolved against Datadog users. + attr_accessor :annotator + # Timestamp when the annotation was created. attr_reader :created_at @@ -48,6 +53,7 @@ class LLMObsAnnotationItem # @!visibility private def self.attribute_map { + :'annotator' => :'annotator', :'created_at' => :'created_at', :'created_by' => :'created_by', :'id' => :'id', @@ -62,6 +68,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'annotator' => :'String', :'created_at' => :'Time', :'created_by' => :'String', :'id' => :'String', @@ -90,6 +97,10 @@ def initialize(attributes = {}) end } + if attributes.key?(:'annotator') + self.annotator = attributes[:'annotator'] + end + if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] end @@ -229,6 +240,7 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && + annotator == o.annotator && created_at == o.created_at && created_by == o.created_by && id == o.id && @@ -243,7 +255,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [created_at, created_by, id, interaction_id, label_values, modified_at, modified_by, additional_properties].hash + [annotator, created_at, created_by, id, interaction_id, label_values, modified_at, modified_by, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/llm_obs_annotation_item_response.rb b/lib/datadog_api_client/v2/models/llm_obs_annotation_item_response.rb index 356e55d40f77..2917a7c1d76b 100644 --- a/lib/datadog_api_client/v2/models/llm_obs_annotation_item_response.rb +++ b/lib/datadog_api_client/v2/models/llm_obs_annotation_item_response.rb @@ -21,6 +21,11 @@ module DatadogAPIClient::V2 class LLMObsAnnotationItemResponse include BaseGenericModel + # Caller-supplied name or identifier for the external person or automated system that produced the labels. + # The value is stored and returned as provided. It is not a Datadog user ID or login, and it is not + # resolved against Datadog users. + attr_accessor :annotator + # Timestamp when the annotation was created. attr_reader :created_at @@ -49,6 +54,7 @@ class LLMObsAnnotationItemResponse # @!visibility private def self.attribute_map { + :'annotator' => :'annotator', :'created_at' => :'created_at', :'created_by' => :'created_by', :'id' => :'id', @@ -63,6 +69,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'annotator' => :'String', :'created_at' => :'Time', :'created_by' => :'String', :'id' => :'String', @@ -91,6 +98,10 @@ def initialize(attributes = {}) end } + if attributes.key?(:'annotator') + self.annotator = attributes[:'annotator'] + end + if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] end @@ -232,6 +243,7 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && + annotator == o.annotator && created_at == o.created_at && created_by == o.created_by && id == o.id && @@ -246,7 +258,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [created_at, created_by, id, interaction_id, label_values, modified_at, modified_by, additional_properties].hash + [annotator, created_at, created_by, id, interaction_id, label_values, modified_at, modified_by, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/llm_obs_upsert_annotation_item.rb b/lib/datadog_api_client/v2/models/llm_obs_upsert_annotation_item.rb index 7208985bcaf2..d167a3f72663 100644 --- a/lib/datadog_api_client/v2/models/llm_obs_upsert_annotation_item.rb +++ b/lib/datadog_api_client/v2/models/llm_obs_upsert_annotation_item.rb @@ -22,6 +22,15 @@ module DatadogAPIClient::V2 class LLMObsUpsertAnnotationItem include BaseGenericModel + # Caller-supplied name or identifier for the external person or automated system that produced the labels. + # The value is an opaque string with no required format. Use a stable, recognizable value for the same + # producer across annotations. + # The value is stored and returned as provided. It is not a Datadog user ID or login, and it is not + # resolved against Datadog users. + # Omit this field or set it to `null` to preserve existing attribution. Set it to an empty string to clear + # attribution. + attr_accessor :annotator + # ID of the interaction to annotate. attr_reader :interaction_id @@ -35,6 +44,7 @@ class LLMObsUpsertAnnotationItem # @!visibility private def self.attribute_map { + :'annotator' => :'annotator', :'interaction_id' => :'interaction_id', :'label_values' => :'label_values' } @@ -44,11 +54,20 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'annotator' => :'String', :'interaction_id' => :'String', :'label_values' => :'Array' } end + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'annotator', + ]) + end + # Initializes the object # @param attributes [Hash] Model attributes in the form of hash # @!visibility private @@ -67,6 +86,10 @@ def initialize(attributes = {}) end } + if attributes.key?(:'annotator') + self.annotator = attributes[:'annotator'] + end + if attributes.key?(:'interaction_id') self.interaction_id = attributes[:'interaction_id'] end @@ -137,6 +160,7 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && + annotator == o.annotator && interaction_id == o.interaction_id && label_values == o.label_values && additional_properties == o.additional_properties @@ -146,7 +170,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [interaction_id, label_values, additional_properties].hash + [annotator, interaction_id, label_values, additional_properties].hash end end end