From 7f3ce70f055d5f4115afa6e1f69252789a91c499 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 2 Jun 2026 09:41:08 +0000 Subject: [PATCH] Regenerate client from commit db3d509 of spec repo --- .generator/schemas/v2/openapi.yaml | 446 +++++++++++++++++- .../DeleteLLMObsAnnotations.rb | 21 + .../UpsertLLMObsAnnotations.rb | 32 ++ features/scenarios_model_mapping.rb | 8 + features/v2/llm_observability.feature | 54 +++ features/v2/undo.json | 23 + lib/datadog_api_client/configuration.rb | 2 + lib/datadog_api_client/inflector.rb | 19 + .../v2/api/llm_observability_api.rb | 162 ++++++- ...bs_annotated_interactions_data_response.rb | 2 +- .../models/llm_obs_annotation_assessment.rb | 27 ++ .../v2/models/llm_obs_annotation_error.rb | 154 ++++++ .../v2/models/llm_obs_annotation_item.rb | 9 +- .../models/llm_obs_annotation_label_value.rb | 169 +++++++ .../llm_obs_annotation_label_value_value.rb | 65 +++ ...obs_annotations_data_attributes_request.rb | 129 +++++ ...bs_annotations_data_attributes_response.rb | 137 ++++++ .../llm_obs_annotations_data_request.rb | 144 ++++++ .../llm_obs_annotations_data_response.rb | 165 +++++++ .../v2/models/llm_obs_annotations_request.rb | 123 +++++ .../v2/models/llm_obs_annotations_response.rb | 123 +++++ .../v2/models/llm_obs_annotations_type.rb | 26 + .../models/llm_obs_delete_annotation_error.rb | 144 ++++++ ...ete_annotations_data_attributes_request.rb | 129 +++++ ...te_annotations_data_attributes_response.rb | 125 +++++ ...llm_obs_delete_annotations_data_request.rb | 144 ++++++ ...lm_obs_delete_annotations_data_response.rb | 144 ++++++ .../llm_obs_delete_annotations_request.rb | 123 +++++ .../llm_obs_delete_annotations_response.rb | 124 +++++ .../models/llm_obs_upsert_annotation_item.rb | 152 ++++++ 30 files changed, 3112 insertions(+), 13 deletions(-) create mode 100644 examples/v2/llm-observability/DeleteLLMObsAnnotations.rb create mode 100644 examples/v2/llm-observability/UpsertLLMObsAnnotations.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_annotation_assessment.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_annotation_error.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_annotation_label_value.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_annotation_label_value_value.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_annotations_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_annotations_data_attributes_response.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_annotations_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_annotations_data_response.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_annotations_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_annotations_response.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_annotations_type.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_delete_annotation_error.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_delete_annotations_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_delete_annotations_data_attributes_response.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_delete_annotations_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_delete_annotations_data_response.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_delete_annotations_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_delete_annotations_response.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_upsert_annotation_item.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b4cbd81ddfad..957b1e2c81a1 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -44290,7 +44290,7 @@ components: attributes: $ref: "#/components/schemas/LLMObsAnnotatedInteractionsDataAttributesResponse" id: - description: The queue ID. + description: The annotation queue ID. example: "00000000-0000-0000-0000-000000000001" type: string type: @@ -44316,6 +44316,35 @@ components: type: string x-enum-varnames: - ANNOTATED_INTERACTIONS + LLMObsAnnotationAssessment: + description: Assessment result for a label value. + enum: + - pass + - fail + example: "pass" + type: string + x-enum-varnames: + - PASS + - FAIL + LLMObsAnnotationError: + description: A partial error for a single annotation that could not be processed. + properties: + annotation_id: + description: ID of the annotation that failed, if applicable. + example: "00000000-0000-0000-0000-000000000000" + type: string + error: + description: Error message. + example: "interaction not found" + type: string + interaction_id: + description: ID of the interaction that failed. + example: "00000000-0000-0000-0000-000000000001" + type: string + required: + - interaction_id + - error + type: object LLMObsAnnotationItem: description: A single annotation on an interaction. properties: @@ -44337,11 +44366,15 @@ components: example: "interaction-456" type: string label_values: - additionalProperties: {} - description: The label values for this annotation. + description: |- + Label values for this annotation. Each entry references a label schema by ID + and provides the corresponding value. example: - quality: "good" - type: object + - label_schema_id: "abc-123" + value: "good" + items: + $ref: "#/components/schemas/LLMObsAnnotationLabelValue" + type: array modified_at: description: Timestamp when the annotation was last modified. example: "2024-01-15T10:30:00Z" @@ -44360,6 +44393,44 @@ components: - modified_by - modified_at type: object + LLMObsAnnotationLabelValue: + description: |- + A single label value entry in an annotation. + The `value` type must match the label schema type: + - `score`: a number within the schema `min`/`max` range (integer if `is_integer` is `true`). + - `categorical`: a string that is one of the schema `values`. + - `boolean`: `true` or `false`. + - `text`: any non-empty string. + properties: + assessment: + $ref: "#/components/schemas/LLMObsAnnotationAssessment" + label_schema_id: + description: ID of the label schema this value corresponds to. + example: "abc-123" + type: string + reasoning: + description: Free text reasoning for this label value. + example: "The response was accurate and well-structured." + type: string + value: + $ref: "#/components/schemas/LLMObsAnnotationLabelValueValue" + required: + - label_schema_id + - value + type: object + LLMObsAnnotationLabelValueStringArray: + description: For categorical-type labels allowing multiple selections. + items: + type: string + type: array + LLMObsAnnotationLabelValueValue: + description: The value for this label. Must comply with the label schema type constraints. + example: 0.0 + oneOf: + - $ref: "#/components/schemas/AnyValueNumber" + - $ref: "#/components/schemas/AnyValueString" + - $ref: "#/components/schemas/LLMObsAnnotationLabelValueStringArray" + - $ref: "#/components/schemas/AnyValueBoolean" LLMObsAnnotationQueueDataAttributesRequest: description: Attributes for creating an LLM Observability annotation queue. properties: @@ -44687,6 +44758,85 @@ components: required: - label_schemas type: object + LLMObsAnnotationsDataAttributesRequest: + description: Attributes for creating or updating annotations. + properties: + annotations: + description: List of annotations to create or update. Must contain at least one item. + items: + $ref: "#/components/schemas/LLMObsUpsertAnnotationItem" + minItems: 1 + type: array + required: + - annotations + type: object + LLMObsAnnotationsDataAttributesResponse: + description: Attributes of the annotations response. + properties: + annotations: + description: Successfully created or updated annotations. + items: + $ref: "#/components/schemas/LLMObsAnnotationItem" + type: array + errors: + description: Partial errors for annotations that could not be processed. + items: + $ref: "#/components/schemas/LLMObsAnnotationError" + type: array + required: + - annotations + type: object + LLMObsAnnotationsDataRequest: + description: Data object for creating or updating annotations. + properties: + attributes: + $ref: "#/components/schemas/LLMObsAnnotationsDataAttributesRequest" + type: + $ref: "#/components/schemas/LLMObsAnnotationsType" + required: + - type + - attributes + type: object + LLMObsAnnotationsDataResponse: + description: Data object for the annotations response. + properties: + attributes: + $ref: "#/components/schemas/LLMObsAnnotationsDataAttributesResponse" + id: + description: The annotation queue ID. + example: "00000000-0000-0000-0000-000000000001" + type: string + type: + $ref: "#/components/schemas/LLMObsAnnotationsType" + required: + - id + - type + - attributes + type: object + LLMObsAnnotationsRequest: + description: Request to create or update annotations on interactions in an annotation queue. + properties: + data: + $ref: "#/components/schemas/LLMObsAnnotationsDataRequest" + required: + - data + type: object + LLMObsAnnotationsResponse: + description: Response containing the created or updated annotations. + properties: + data: + $ref: "#/components/schemas/LLMObsAnnotationsDataResponse" + required: + - data + type: object + LLMObsAnnotationsType: + description: Resource type for LLM Observability annotations. + enum: + - annotations + example: annotations + type: string + x-enum-varnames: + - ANNOTATIONS LLMObsAnthropicEffort: description: The effort level for Anthropic inference. enum: @@ -46127,6 +46277,21 @@ components: required: - data type: object + LLMObsDeleteAnnotationError: + description: A partial error for a single annotation that could not be deleted. + properties: + annotation_id: + description: ID of the annotation that could not be deleted. + example: "00000000-0000-0000-0000-000000000000" + type: string + error: + description: Error message. + example: "annotation not found" + type: string + required: + - annotation_id + - error + type: object LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest: description: Attributes for deleting interactions from an annotation queue. properties: @@ -46162,6 +46327,72 @@ components: required: - data type: object + LLMObsDeleteAnnotationsDataAttributesRequest: + description: Attributes for deleting annotations. + properties: + annotation_ids: + description: IDs of the annotations to delete. Must contain at least one item. + example: + - "00000000-0000-0000-0000-000000000000" + - "00000000-0000-0000-0000-000000000001" + items: + type: string + minItems: 1 + type: array + required: + - annotation_ids + type: object + LLMObsDeleteAnnotationsDataAttributesResponse: + description: Attributes of the annotation deletion response. + properties: + errors: + description: Errors for annotations that could not be deleted. + items: + $ref: "#/components/schemas/LLMObsDeleteAnnotationError" + type: array + required: + - errors + type: object + LLMObsDeleteAnnotationsDataRequest: + description: Data object for deleting annotations. + properties: + attributes: + $ref: "#/components/schemas/LLMObsDeleteAnnotationsDataAttributesRequest" + type: + $ref: "#/components/schemas/LLMObsAnnotationsType" + required: + - type + - attributes + type: object + LLMObsDeleteAnnotationsDataResponse: + description: Data object for the annotation deletion response. + properties: + attributes: + $ref: "#/components/schemas/LLMObsDeleteAnnotationsDataAttributesResponse" + type: + $ref: "#/components/schemas/LLMObsAnnotationsType" + required: + - type + - attributes + type: object + LLMObsDeleteAnnotationsRequest: + description: Request to delete annotations from an annotation queue. + properties: + data: + $ref: "#/components/schemas/LLMObsDeleteAnnotationsDataRequest" + required: + - data + type: object + LLMObsDeleteAnnotationsResponse: + description: |- + Response for a batch annotation deletion. Partial errors are listed in the + response if any annotations could not be deleted. + properties: + data: + $ref: "#/components/schemas/LLMObsDeleteAnnotationsDataResponse" + required: + - data + type: object LLMObsDeleteDatasetRecordsDataAttributesRequest: description: Attributes for deleting records from an LLM Observability dataset. properties: @@ -48732,6 +48963,32 @@ components: - TRACE - EXPERIMENT_TRACE - SESSION + LLMObsUpsertAnnotationItem: + description: |- + A single annotation to create or update. The annotation is matched by + `interaction_id` and the requesting user's identity. + properties: + interaction_id: + description: ID of the interaction to annotate. + example: "00000000-0000-0000-0000-000000000001" + type: string + label_values: + description: |- + Label values for this annotation. Each entry references a label schema by ID + and provides the corresponding value validated against the schema type constraints. + example: + - label_schema_id: "abc-123" + value: "good" + - label_schema_id: "ef56gh78" + value: "positive" + items: + $ref: "#/components/schemas/LLMObsAnnotationLabelValue" + minItems: 1 + type: array + required: + - interaction_id + - label_values + type: object LLMObsVertexAIMetadata: description: Vertex AI-specific metadata for an integration account or inference request. properties: @@ -129162,7 +129419,9 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/llm-obs/v1/annotated-interactions: get: - description: Returns annotated interactions across all annotation queues for the given content IDs. Results include queue metadata (ID and name) for each interaction. + description: |- + Returns annotated interactions across all annotation queues for the given content IDs. + Results include queue metadata (ID and name) for each interaction. operationId: GetLLMObsAnnotatedInteractionsByTraceIDs parameters: - description: One or more content IDs to retrieve annotated interactions for. At least one is required. @@ -129207,7 +129466,8 @@ paths: id: annotation-789 interaction_id: interaction-456 label_values: - quality: good + - label_schema_id: abc-123 + value: good modified_at: "0001-01-01T00:00:00Z" modified_by: "00000000-0000-0000-0000-000000000002" content_id: trace-abc-123 @@ -129270,7 +129530,8 @@ paths: name: projectId schema: type: string - - description: Filter annotation queues by queue IDs (comma-separated). Cannot be used together with `projectId`. + - description: >- + Filter annotation queues by queue IDs (comma-separated). Cannot be used together with `projectId`. in: query name: queueIds schema: @@ -129600,6 +129861,175 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotations: + post: + description: |- + Create or update annotations on interactions in a queue. Each annotation is matched + by `interaction_id` and the requesting user's identity. + 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. + operationId: UpsertLLMObsAnnotations + parameters: + - $ref: "#/components/parameters/LLMObsAnnotationQueueIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + 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 + schema: + $ref: "#/components/schemas/LLMObsAnnotationsRequest" + description: Payload for creating or updating annotations. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + annotations: + - 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 + label_values: + - label_schema_id: abc-123 + value: good + modified_at: "2024-01-15T10:30:00Z" + modified_by: 00000000-0000-0000-0000-000000000002 + id: 00000000-0000-0000-0000-000000000001 + type: annotations + schema: + $ref: "#/components/schemas/LLMObsAnnotationsResponse" + description: OK — annotations created or updated. Per-item errors are listed in `errors`. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found — the queue does not exist. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create or update annotations + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotations/delete: + post: + description: Delete one or more annotations from an annotation queue. + operationId: DeleteLLMObsAnnotations + parameters: + - $ref: "#/components/parameters/LLMObsAnnotationQueueIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + annotation_ids: + - 00000000-0000-0000-0000-000000000000 + type: annotations + schema: + $ref: "#/components/schemas/LLMObsDeleteAnnotationsRequest" + description: Delete annotations payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + errors: [] + type: annotations + partial_failure: + summary: Some annotation IDs were not found + value: + data: + attributes: + errors: + - annotation_id: 00000000-0000-0000-0000-000000000001 + error: annotation not found + type: annotations + schema: + $ref: "#/components/schemas/LLMObsDeleteAnnotationsResponse" + description: >- + OK — annotations deleted. Errors for annotations that could not be deleted are listed in `errors`. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found — the queue does not exist. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete annotations + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/llm-obs/v1/annotation-queues/{queue_id}/interactions: post: description: |- diff --git a/examples/v2/llm-observability/DeleteLLMObsAnnotations.rb b/examples/v2/llm-observability/DeleteLLMObsAnnotations.rb new file mode 100644 index 000000000000..e1e7acf1b6b6 --- /dev/null +++ b/examples/v2/llm-observability/DeleteLLMObsAnnotations.rb @@ -0,0 +1,21 @@ +# Delete annotations returns "OK — annotations deleted. Errors for annotations that could not be deleted are listed in +# `errors`." response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_llm_obs_annotations".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +body = DatadogAPIClient::V2::LLMObsDeleteAnnotationsRequest.new({ + data: DatadogAPIClient::V2::LLMObsDeleteAnnotationsDataRequest.new({ + attributes: DatadogAPIClient::V2::LLMObsDeleteAnnotationsDataAttributesRequest.new({ + annotation_ids: [ + "00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000001", + ], + }), + type: DatadogAPIClient::V2::LLMObsAnnotationsType::ANNOTATIONS, + }), +}) +p api_instance.delete_llm_obs_annotations("queue_id", body) diff --git a/examples/v2/llm-observability/UpsertLLMObsAnnotations.rb b/examples/v2/llm-observability/UpsertLLMObsAnnotations.rb new file mode 100644 index 000000000000..464c9e65a666 --- /dev/null +++ b/examples/v2/llm-observability/UpsertLLMObsAnnotations.rb @@ -0,0 +1,32 @@ +# Create or update annotations returns "OK — annotations created or updated. Per-item errors are listed in `errors`." +# response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.upsert_llm_obs_annotations".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +body = DatadogAPIClient::V2::LLMObsAnnotationsRequest.new({ + data: DatadogAPIClient::V2::LLMObsAnnotationsDataRequest.new({ + attributes: DatadogAPIClient::V2::LLMObsAnnotationsDataAttributesRequest.new({ + annotations: [ + DatadogAPIClient::V2::LLMObsUpsertAnnotationItem.new({ + interaction_id: "00000000-0000-0000-0000-000000000001", + label_values: [ + DatadogAPIClient::V2::LLMObsAnnotationLabelValue.new({ + label_schema_id: "abc-123", + value: "good", + }), + DatadogAPIClient::V2::LLMObsAnnotationLabelValue.new({ + label_schema_id: "ef56gh78", + value: "positive", + }), + ], + }), + ], + }), + type: DatadogAPIClient::V2::LLMObsAnnotationsType::ANNOTATIONS, + }), +}) +p api_instance.upsert_llm_obs_annotations("queue_id", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 5f9a7353fd42..d1e63535216f 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -944,6 +944,14 @@ "v2.GetLLMObsAnnotatedInteractions" => { "queue_id" => "String", }, + "v2.UpsertLLMObsAnnotations" => { + "queue_id" => "String", + "body" => "LLMObsAnnotationsRequest", + }, + "v2.DeleteLLMObsAnnotations" => { + "queue_id" => "String", + "body" => "LLMObsDeleteAnnotationsRequest", + }, "v2.CreateLLMObsAnnotationQueueInteractions" => { "queue_id" => "String", "body" => "LLMObsAnnotationQueueInteractionsRequest", diff --git a/features/v2/llm_observability.feature b/features/v2/llm_observability.feature index ea384fa8ed44..c99408b08911 100644 --- a/features/v2/llm_observability.feature +++ b/features/v2/llm_observability.feature @@ -315,6 +315,33 @@ Feature: LLM Observability When the request is sent Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/ml-observability + Scenario: Create or update annotations returns "Bad Request" response + 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"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Create or update annotations returns "Not Found — the queue does not exist." response + 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"}} + When the request is sent + Then the response status is 404 Not Found — the queue does not exist. + + @generated @skip @team:DataDog/ml-observability + Scenario: Create or update annotations returns "OK — annotations created or updated. Per-item errors are listed in `errors`." response + 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"}} + When the request is sent + Then the response status is 200 OK — annotations created or updated. Per-item errors are listed in `errors`. + @generated @skip @team:DataDog/ml-observability Scenario: Delete LLM Observability data returns "Accepted" response Given operation "DeleteLLMObsData" enabled @@ -487,6 +514,33 @@ Feature: LLM Observability When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/ml-observability + Scenario: Delete annotations returns "Bad Request" response + Given operation "DeleteLLMObsAnnotations" enabled + And new "DeleteLLMObsAnnotations" request + And request contains "queue_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"annotation_ids": ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001"]}, "type": "annotations"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Delete annotations returns "Not Found — the queue does not exist." response + Given operation "DeleteLLMObsAnnotations" enabled + And new "DeleteLLMObsAnnotations" request + And request contains "queue_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"annotation_ids": ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001"]}, "type": "annotations"}} + When the request is sent + Then the response status is 404 Not Found — the queue does not exist. + + @generated @skip @team:DataDog/ml-observability + Scenario: Delete annotations returns "OK — annotations deleted. Errors for annotations that could not be deleted are listed in `errors`." response + Given operation "DeleteLLMObsAnnotations" enabled + And new "DeleteLLMObsAnnotations" request + And request contains "queue_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"annotation_ids": ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001"]}, "type": "annotations"}} + When the request is sent + Then the response status is 200 OK — annotations deleted. Errors for annotations that could not be deleted are listed in `errors`. + @generated @skip @team:DataDog/ml-observability Scenario: Export an LLM Observability dataset returns "Bad Request" response Given operation "ExportLLMObsDataset" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index 3e68f5928426..ce33aaac7d91 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3962,6 +3962,29 @@ "type": "safe" } }, + "UpsertLLMObsAnnotations": { + "tag": "LLM Observability", + "undo": { + "operationId": "DeleteLLMObsAnnotations", + "parameters": [ + { + "name": "queue_id", + "source": "path.queue_id" + }, + { + "name": "body", + "template": "{\"data\": {\"type\": \"annotations\", \"attributes\": {\"annotation_ids\": [\"{{ data.attributes.annotations[0].id }}\"]}}}" + } + ], + "type": "unsafe" + } + }, + "DeleteLLMObsAnnotations": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, "CreateLLMObsAnnotationQueueInteractions": { "tag": "LLM Observability", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index eeeec9db856f..fa60a1c5153c 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -220,6 +220,7 @@ def initialize "v2.create_llm_obs_project": false, "v2.delete_llm_obs_annotation_queue": false, "v2.delete_llm_obs_annotation_queue_interactions": false, + "v2.delete_llm_obs_annotations": false, "v2.delete_llm_obs_custom_eval_config": false, "v2.delete_llm_obs_data": false, "v2.delete_llm_obs_dataset_records": false, @@ -256,6 +257,7 @@ def initialize "v2.update_llm_obs_experiment": false, "v2.update_llm_obs_project": false, "v2.upload_llm_obs_dataset_records_file": false, + "v2.upsert_llm_obs_annotations": false, "v2.create_annotation": false, "v2.delete_annotation": false, "v2.get_page_annotations": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 4c22cc490df5..ef31f708c7bc 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3852,7 +3852,11 @@ def overrides "v2.llm_obs_annotated_interactions_data_response" => "LLMObsAnnotatedInteractionsDataResponse", "v2.llm_obs_annotated_interactions_response" => "LLMObsAnnotatedInteractionsResponse", "v2.llm_obs_annotated_interactions_type" => "LLMObsAnnotatedInteractionsType", + "v2.llm_obs_annotation_assessment" => "LLMObsAnnotationAssessment", + "v2.llm_obs_annotation_error" => "LLMObsAnnotationError", "v2.llm_obs_annotation_item" => "LLMObsAnnotationItem", + "v2.llm_obs_annotation_label_value" => "LLMObsAnnotationLabelValue", + "v2.llm_obs_annotation_label_value_value" => "LLMObsAnnotationLabelValueValue", "v2.llm_obs_annotation_queue_data_attributes_request" => "LLMObsAnnotationQueueDataAttributesRequest", "v2.llm_obs_annotation_queue_data_attributes_response" => "LLMObsAnnotationQueueDataAttributesResponse", "v2.llm_obs_annotation_queue_data_request" => "LLMObsAnnotationQueueDataRequest", @@ -3880,6 +3884,13 @@ def overrides "v2.llm_obs_annotation_queue_update_data_request" => "LLMObsAnnotationQueueUpdateDataRequest", "v2.llm_obs_annotation_queue_update_request" => "LLMObsAnnotationQueueUpdateRequest", "v2.llm_obs_annotation_schema" => "LLMObsAnnotationSchema", + "v2.llm_obs_annotations_data_attributes_request" => "LLMObsAnnotationsDataAttributesRequest", + "v2.llm_obs_annotations_data_attributes_response" => "LLMObsAnnotationsDataAttributesResponse", + "v2.llm_obs_annotations_data_request" => "LLMObsAnnotationsDataRequest", + "v2.llm_obs_annotations_data_response" => "LLMObsAnnotationsDataResponse", + "v2.llm_obs_annotations_request" => "LLMObsAnnotationsRequest", + "v2.llm_obs_annotations_response" => "LLMObsAnnotationsResponse", + "v2.llm_obs_annotations_type" => "LLMObsAnnotationsType", "v2.llm_obs_anthropic_effort" => "LLMObsAnthropicEffort", "v2.llm_obs_anthropic_metadata" => "LLMObsAnthropicMetadata", "v2.llm_obs_anthropic_thinking_config" => "LLMObsAnthropicThinkingConfig", @@ -3970,9 +3981,16 @@ def overrides "v2.llm_obs_dataset_version_data_attributes" => "LLMObsDatasetVersionDataAttributes", "v2.llm_obs_dataset_versions_response" => "LLMObsDatasetVersionsResponse", "v2.llm_obs_dataset_version_type" => "LLMObsDatasetVersionType", + "v2.llm_obs_delete_annotation_error" => "LLMObsDeleteAnnotationError", "v2.llm_obs_delete_annotation_queue_interactions_data_attributes_request" => "LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest", "v2.llm_obs_delete_annotation_queue_interactions_data_request" => "LLMObsDeleteAnnotationQueueInteractionsDataRequest", "v2.llm_obs_delete_annotation_queue_interactions_request" => "LLMObsDeleteAnnotationQueueInteractionsRequest", + "v2.llm_obs_delete_annotations_data_attributes_request" => "LLMObsDeleteAnnotationsDataAttributesRequest", + "v2.llm_obs_delete_annotations_data_attributes_response" => "LLMObsDeleteAnnotationsDataAttributesResponse", + "v2.llm_obs_delete_annotations_data_request" => "LLMObsDeleteAnnotationsDataRequest", + "v2.llm_obs_delete_annotations_data_response" => "LLMObsDeleteAnnotationsDataResponse", + "v2.llm_obs_delete_annotations_request" => "LLMObsDeleteAnnotationsRequest", + "v2.llm_obs_delete_annotations_response" => "LLMObsDeleteAnnotationsResponse", "v2.llm_obs_delete_dataset_records_data_attributes_request" => "LLMObsDeleteDatasetRecordsDataAttributesRequest", "v2.llm_obs_delete_dataset_records_data_request" => "LLMObsDeleteDatasetRecordsDataRequest", "v2.llm_obs_delete_dataset_records_request" => "LLMObsDeleteDatasetRecordsRequest", @@ -4110,6 +4128,7 @@ def overrides "v2.llm_obs_trace_interaction_item" => "LLMObsTraceInteractionItem", "v2.llm_obs_trace_interaction_response_item" => "LLMObsTraceInteractionResponseItem", "v2.llm_obs_trace_interaction_type" => "LLMObsTraceInteractionType", + "v2.llm_obs_upsert_annotation_item" => "LLMObsUpsertAnnotationItem", "v2.llm_obs_vertex_ai_metadata" => "LLMObsVertexAIMetadata", "v2.log" => "Log", "v2.log_attributes" => "LogAttributes", diff --git a/lib/datadog_api_client/v2/api/llm_observability_api.rb b/lib/datadog_api_client/v2/api/llm_observability_api.rb index 4e8a60da520b..64068b5f8dcf 100644 --- a/lib/datadog_api_client/v2/api/llm_observability_api.rb +++ b/lib/datadog_api_client/v2/api/llm_observability_api.rb @@ -1050,6 +1050,84 @@ def delete_llm_obs_annotation_queue_interactions_with_http_info(queue_id, body, return data, status_code, headers end + # Delete annotations. + # + # @see #delete_llm_obs_annotations_with_http_info + def delete_llm_obs_annotations(queue_id, body, opts = {}) + data, _status_code, _headers = delete_llm_obs_annotations_with_http_info(queue_id, body, opts) + data + end + + # Delete annotations. + # + # Delete one or more annotations from an annotation queue. + # + # @param queue_id [String] The ID of the LLM Observability annotation queue. + # @param body [LLMObsDeleteAnnotationsRequest] Delete annotations payload. + # @param opts [Hash] the optional parameters + # @return [Array<(LLMObsDeleteAnnotationsResponse, Integer, Hash)>] LLMObsDeleteAnnotationsResponse data, response status code and response headers + def delete_llm_obs_annotations_with_http_info(queue_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_llm_obs_annotations".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_llm_obs_annotations") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_llm_obs_annotations")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.delete_llm_obs_annotations ...' + end + # verify the required parameter 'queue_id' is set + if @api_client.config.client_side_validation && queue_id.nil? + fail ArgumentError, "Missing the required parameter 'queue_id' when calling LLMObservabilityAPI.delete_llm_obs_annotations" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling LLMObservabilityAPI.delete_llm_obs_annotations" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotations/delete'.sub('{queue_id}', CGI.escape(queue_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'LLMObsDeleteAnnotationsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_llm_obs_annotations, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#delete_llm_obs_annotations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete a custom evaluator configuration. # # @see #delete_llm_obs_custom_eval_config_with_http_info @@ -1669,7 +1747,8 @@ def get_llm_obs_annotated_interactions_by_trace_i_ds(content_ids, opts = {}) # Get annotated interactions by content IDs. # - # Returns annotated interactions across all annotation queues for the given content IDs. Results include queue metadata (ID and name) for each interaction. + # Returns annotated interactions across all annotation queues for the given content IDs. + # Results include queue metadata (ID and name) for each interaction. # # @param content_ids [Array] One or more content IDs to retrieve annotated interactions for. At least one is required. # @param opts [Hash] the optional parameters @@ -3861,5 +3940,86 @@ def upload_llm_obs_dataset_records_file_with_http_info(project_id, dataset_id, o end return data, status_code, headers end + + # Create or update annotations. + # + # @see #upsert_llm_obs_annotations_with_http_info + def upsert_llm_obs_annotations(queue_id, body, opts = {}) + data, _status_code, _headers = upsert_llm_obs_annotations_with_http_info(queue_id, body, opts) + data + end + + # Create or update annotations. + # + # Create or update annotations on interactions in a queue. Each annotation is matched + # by `interaction_id` and the requesting user's identity. + # 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. + # + # @param queue_id [String] The ID of the LLM Observability annotation queue. + # @param body [LLMObsAnnotationsRequest] Payload for creating or updating annotations. + # @param opts [Hash] the optional parameters + # @return [Array<(LLMObsAnnotationsResponse, Integer, Hash)>] LLMObsAnnotationsResponse data, response status code and response headers + def upsert_llm_obs_annotations_with_http_info(queue_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.upsert_llm_obs_annotations".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.upsert_llm_obs_annotations") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.upsert_llm_obs_annotations")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.upsert_llm_obs_annotations ...' + end + # verify the required parameter 'queue_id' is set + if @api_client.config.client_side_validation && queue_id.nil? + fail ArgumentError, "Missing the required parameter 'queue_id' when calling LLMObservabilityAPI.upsert_llm_obs_annotations" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling LLMObservabilityAPI.upsert_llm_obs_annotations" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotations'.sub('{queue_id}', CGI.escape(queue_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'LLMObsAnnotationsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :upsert_llm_obs_annotations, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#upsert_llm_obs_annotations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/datadog_api_client/v2/models/llm_obs_annotated_interactions_data_response.rb b/lib/datadog_api_client/v2/models/llm_obs_annotated_interactions_data_response.rb index 812fe2e5276c..034627353a18 100644 --- a/lib/datadog_api_client/v2/models/llm_obs_annotated_interactions_data_response.rb +++ b/lib/datadog_api_client/v2/models/llm_obs_annotated_interactions_data_response.rb @@ -24,7 +24,7 @@ class LLMObsAnnotatedInteractionsDataResponse # Attributes containing the list of annotated interactions. attr_reader :attributes - # The queue ID. + # The annotation queue ID. attr_reader :id # Resource type for annotated interactions. diff --git a/lib/datadog_api_client/v2/models/llm_obs_annotation_assessment.rb b/lib/datadog_api_client/v2/models/llm_obs_annotation_assessment.rb new file mode 100644 index 000000000000..5b75db6f7ac8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_annotation_assessment.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Assessment result for a label value. + class LLMObsAnnotationAssessment + include BaseEnumModel + + PASS = "pass".freeze + FAIL = "fail".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_annotation_error.rb b/lib/datadog_api_client/v2/models/llm_obs_annotation_error.rb new file mode 100644 index 000000000000..83ded993cae8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_annotation_error.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A partial error for a single annotation that could not be processed. + class LLMObsAnnotationError + include BaseGenericModel + + # ID of the annotation that failed, if applicable. + attr_accessor :annotation_id + + # Error message. + attr_reader :error + + # ID of the interaction that failed. + attr_reader :interaction_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'annotation_id' => :'annotation_id', + :'error' => :'error', + :'interaction_id' => :'interaction_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'annotation_id' => :'String', + :'error' => :'String', + :'interaction_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsAnnotationError` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'annotation_id') + self.annotation_id = attributes[:'annotation_id'] + end + + if attributes.key?(:'error') + self.error = attributes[:'error'] + end + + if attributes.key?(:'interaction_id') + self.interaction_id = attributes[:'interaction_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @error.nil? + return false if @interaction_id.nil? + true + end + + # Custom attribute writer method with validation + # @param error [Object] Object to be assigned + # @!visibility private + def error=(error) + if error.nil? + fail ArgumentError, 'invalid value for "error", error cannot be nil.' + end + @error = error + end + + # Custom attribute writer method with validation + # @param interaction_id [Object] Object to be assigned + # @!visibility private + def interaction_id=(interaction_id) + if interaction_id.nil? + fail ArgumentError, 'invalid value for "interaction_id", interaction_id cannot be nil.' + end + @interaction_id = interaction_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + annotation_id == o.annotation_id && + error == o.error && + interaction_id == o.interaction_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [annotation_id, error, interaction_id, additional_properties].hash + end + end +end 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 5c62191051dd..92425b702183 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 @@ -33,7 +33,8 @@ class LLMObsAnnotationItem # Identifier of the interaction this annotation belongs to. attr_reader :interaction_id - # The label values for this annotation. + # Label values for this annotation. Each entry references a label schema by ID + # and provides the corresponding value. attr_reader :label_values # Timestamp when the annotation was last modified. @@ -66,7 +67,7 @@ def self.openapi_types :'created_by' => :'String', :'id' => :'String', :'interaction_id' => :'String', - :'label_values' => :'Hash', + :'label_values' => :'Array', :'modified_at' => :'Time', :'modified_by' => :'String' } @@ -107,7 +108,9 @@ def initialize(attributes = {}) end if attributes.key?(:'label_values') - self.label_values = attributes[:'label_values'] + if (value = attributes[:'label_values']).is_a?(Array) + self.label_values = value + end end if attributes.key?(:'modified_at') diff --git a/lib/datadog_api_client/v2/models/llm_obs_annotation_label_value.rb b/lib/datadog_api_client/v2/models/llm_obs_annotation_label_value.rb new file mode 100644 index 000000000000..142402b0d691 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_annotation_label_value.rb @@ -0,0 +1,169 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A single label value entry in an annotation. + # The `value` type must match the label schema type: + # - `score`: a number within the schema `min`/`max` range (integer if `is_integer` is `true`). + # - `categorical`: a string that is one of the schema `values`. + # - `boolean`: `true` or `false`. + # - `text`: any non-empty string. + class LLMObsAnnotationLabelValue + include BaseGenericModel + + # Assessment result for a label value. + attr_accessor :assessment + + # ID of the label schema this value corresponds to. + attr_reader :label_schema_id + + # Free text reasoning for this label value. + attr_accessor :reasoning + + # The value for this label. Must comply with the label schema type constraints. + attr_reader :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assessment' => :'assessment', + :'label_schema_id' => :'label_schema_id', + :'reasoning' => :'reasoning', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assessment' => :'LLMObsAnnotationAssessment', + :'label_schema_id' => :'String', + :'reasoning' => :'String', + :'value' => :'LLMObsAnnotationLabelValueValue' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsAnnotationLabelValue` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'assessment') + self.assessment = attributes[:'assessment'] + end + + if attributes.key?(:'label_schema_id') + self.label_schema_id = attributes[:'label_schema_id'] + end + + if attributes.key?(:'reasoning') + self.reasoning = attributes[:'reasoning'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @label_schema_id.nil? + return false if @value.nil? + true + end + + # Custom attribute writer method with validation + # @param label_schema_id [Object] Object to be assigned + # @!visibility private + def label_schema_id=(label_schema_id) + if label_schema_id.nil? + fail ArgumentError, 'invalid value for "label_schema_id", label_schema_id cannot be nil.' + end + @label_schema_id = label_schema_id + end + + # Custom attribute writer method with validation + # @param value [Object] Object to be assigned + # @!visibility private + def value=(value) + if value.nil? + fail ArgumentError, 'invalid value for "value", value cannot be nil.' + end + @value = value + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + assessment == o.assessment && + label_schema_id == o.label_schema_id && + reasoning == o.reasoning && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assessment, label_schema_id, reasoning, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_annotation_label_value_value.rb b/lib/datadog_api_client/v2/models/llm_obs_annotation_label_value_value.rb new file mode 100644 index 000000000000..e649b954b45c --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_annotation_label_value_value.rb @@ -0,0 +1,65 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The value for this label. Must comply with the label schema type constraints. + module LLMObsAnnotationLabelValueValue + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Float', + :'String', + :'Array', + :'Boolean' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_annotations_data_attributes_request.rb b/lib/datadog_api_client/v2/models/llm_obs_annotations_data_attributes_request.rb new file mode 100644 index 000000000000..87d47f649457 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_annotations_data_attributes_request.rb @@ -0,0 +1,129 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating or updating annotations. + class LLMObsAnnotationsDataAttributesRequest + include BaseGenericModel + + # List of annotations to create or update. Must contain at least one item. + attr_reader :annotations + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'annotations' => :'annotations' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'annotations' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsAnnotationsDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'annotations') + if (value = attributes[:'annotations']).is_a?(Array) + self.annotations = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @annotations.nil? + return false if @annotations.length < 1 + true + end + + # Custom attribute writer method with validation + # @param annotations [Object] Object to be assigned + # @!visibility private + def annotations=(annotations) + if annotations.nil? + fail ArgumentError, 'invalid value for "annotations", annotations cannot be nil.' + end + if annotations.length < 1 + fail ArgumentError, 'invalid value for "annotations", number of items must be greater than or equal to 1.' + end + @annotations = annotations + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + annotations == o.annotations && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [annotations, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_annotations_data_attributes_response.rb b/lib/datadog_api_client/v2/models/llm_obs_annotations_data_attributes_response.rb new file mode 100644 index 000000000000..096792fbf406 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_annotations_data_attributes_response.rb @@ -0,0 +1,137 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the annotations response. + class LLMObsAnnotationsDataAttributesResponse + include BaseGenericModel + + # Successfully created or updated annotations. + attr_reader :annotations + + # Partial errors for annotations that could not be processed. + attr_accessor :errors + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'annotations' => :'annotations', + :'errors' => :'errors' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'annotations' => :'Array', + :'errors' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsAnnotationsDataAttributesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'annotations') + if (value = attributes[:'annotations']).is_a?(Array) + self.annotations = value + end + end + + if attributes.key?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @annotations.nil? + true + end + + # Custom attribute writer method with validation + # @param annotations [Object] Object to be assigned + # @!visibility private + def annotations=(annotations) + if annotations.nil? + fail ArgumentError, 'invalid value for "annotations", annotations cannot be nil.' + end + @annotations = annotations + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + annotations == o.annotations && + errors == o.errors && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [annotations, errors, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_annotations_data_request.rb b/lib/datadog_api_client/v2/models/llm_obs_annotations_data_request.rb new file mode 100644 index 000000000000..a9b36d2e1124 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_annotations_data_request.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for creating or updating annotations. + class LLMObsAnnotationsDataRequest + include BaseGenericModel + + # Attributes for creating or updating annotations. + attr_reader :attributes + + # Resource type for LLM Observability annotations. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'LLMObsAnnotationsDataAttributesRequest', + :'type' => :'LLMObsAnnotationsType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsAnnotationsDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_annotations_data_response.rb b/lib/datadog_api_client/v2/models/llm_obs_annotations_data_response.rb new file mode 100644 index 000000000000..3dbdf6b6f0bf --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_annotations_data_response.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for the annotations response. + class LLMObsAnnotationsDataResponse + include BaseGenericModel + + # Attributes of the annotations response. + attr_reader :attributes + + # The annotation queue ID. + attr_reader :id + + # Resource type for LLM Observability annotations. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'LLMObsAnnotationsDataAttributesResponse', + :'id' => :'String', + :'type' => :'LLMObsAnnotationsType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsAnnotationsDataResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_annotations_request.rb b/lib/datadog_api_client/v2/models/llm_obs_annotations_request.rb new file mode 100644 index 000000000000..d10545627397 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_annotations_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to create or update annotations on interactions in an annotation queue. + class LLMObsAnnotationsRequest + include BaseGenericModel + + # Data object for creating or updating annotations. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'LLMObsAnnotationsDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsAnnotationsRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_annotations_response.rb b/lib/datadog_api_client/v2/models/llm_obs_annotations_response.rb new file mode 100644 index 000000000000..d17641cee46f --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_annotations_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing the created or updated annotations. + class LLMObsAnnotationsResponse + include BaseGenericModel + + # Data object for the annotations response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'LLMObsAnnotationsDataResponse' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsAnnotationsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_annotations_type.rb b/lib/datadog_api_client/v2/models/llm_obs_annotations_type.rb new file mode 100644 index 000000000000..38775c2d1b2e --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_annotations_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Resource type for LLM Observability annotations. + class LLMObsAnnotationsType + include BaseEnumModel + + ANNOTATIONS = "annotations".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_delete_annotation_error.rb b/lib/datadog_api_client/v2/models/llm_obs_delete_annotation_error.rb new file mode 100644 index 000000000000..eaa81b55851f --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_delete_annotation_error.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A partial error for a single annotation that could not be deleted. + class LLMObsDeleteAnnotationError + include BaseGenericModel + + # ID of the annotation that could not be deleted. + attr_reader :annotation_id + + # Error message. + attr_reader :error + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'annotation_id' => :'annotation_id', + :'error' => :'error' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'annotation_id' => :'String', + :'error' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDeleteAnnotationError` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'annotation_id') + self.annotation_id = attributes[:'annotation_id'] + end + + if attributes.key?(:'error') + self.error = attributes[:'error'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @annotation_id.nil? + return false if @error.nil? + true + end + + # Custom attribute writer method with validation + # @param annotation_id [Object] Object to be assigned + # @!visibility private + def annotation_id=(annotation_id) + if annotation_id.nil? + fail ArgumentError, 'invalid value for "annotation_id", annotation_id cannot be nil.' + end + @annotation_id = annotation_id + end + + # Custom attribute writer method with validation + # @param error [Object] Object to be assigned + # @!visibility private + def error=(error) + if error.nil? + fail ArgumentError, 'invalid value for "error", error cannot be nil.' + end + @error = error + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + annotation_id == o.annotation_id && + error == o.error && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [annotation_id, error, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_delete_annotations_data_attributes_request.rb b/lib/datadog_api_client/v2/models/llm_obs_delete_annotations_data_attributes_request.rb new file mode 100644 index 000000000000..b1d397b4e877 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_delete_annotations_data_attributes_request.rb @@ -0,0 +1,129 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for deleting annotations. + class LLMObsDeleteAnnotationsDataAttributesRequest + include BaseGenericModel + + # IDs of the annotations to delete. Must contain at least one item. + attr_reader :annotation_ids + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'annotation_ids' => :'annotation_ids' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'annotation_ids' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDeleteAnnotationsDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'annotation_ids') + if (value = attributes[:'annotation_ids']).is_a?(Array) + self.annotation_ids = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @annotation_ids.nil? + return false if @annotation_ids.length < 1 + true + end + + # Custom attribute writer method with validation + # @param annotation_ids [Object] Object to be assigned + # @!visibility private + def annotation_ids=(annotation_ids) + if annotation_ids.nil? + fail ArgumentError, 'invalid value for "annotation_ids", annotation_ids cannot be nil.' + end + if annotation_ids.length < 1 + fail ArgumentError, 'invalid value for "annotation_ids", number of items must be greater than or equal to 1.' + end + @annotation_ids = annotation_ids + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + annotation_ids == o.annotation_ids && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [annotation_ids, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_delete_annotations_data_attributes_response.rb b/lib/datadog_api_client/v2/models/llm_obs_delete_annotations_data_attributes_response.rb new file mode 100644 index 000000000000..36649d56d3f5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_delete_annotations_data_attributes_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the annotation deletion response. + class LLMObsDeleteAnnotationsDataAttributesResponse + include BaseGenericModel + + # Errors for annotations that could not be deleted. + attr_reader :errors + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'errors' => :'errors' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'errors' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDeleteAnnotationsDataAttributesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @errors.nil? + true + end + + # Custom attribute writer method with validation + # @param errors [Object] Object to be assigned + # @!visibility private + def errors=(errors) + if errors.nil? + fail ArgumentError, 'invalid value for "errors", errors cannot be nil.' + end + @errors = errors + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + errors == o.errors && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [errors, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_delete_annotations_data_request.rb b/lib/datadog_api_client/v2/models/llm_obs_delete_annotations_data_request.rb new file mode 100644 index 000000000000..fd4690ef396e --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_delete_annotations_data_request.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for deleting annotations. + class LLMObsDeleteAnnotationsDataRequest + include BaseGenericModel + + # Attributes for deleting annotations. + attr_reader :attributes + + # Resource type for LLM Observability annotations. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'LLMObsDeleteAnnotationsDataAttributesRequest', + :'type' => :'LLMObsAnnotationsType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDeleteAnnotationsDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_delete_annotations_data_response.rb b/lib/datadog_api_client/v2/models/llm_obs_delete_annotations_data_response.rb new file mode 100644 index 000000000000..41aafcd35528 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_delete_annotations_data_response.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for the annotation deletion response. + class LLMObsDeleteAnnotationsDataResponse + include BaseGenericModel + + # Attributes of the annotation deletion response. + attr_reader :attributes + + # Resource type for LLM Observability annotations. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'LLMObsDeleteAnnotationsDataAttributesResponse', + :'type' => :'LLMObsAnnotationsType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDeleteAnnotationsDataResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_delete_annotations_request.rb b/lib/datadog_api_client/v2/models/llm_obs_delete_annotations_request.rb new file mode 100644 index 000000000000..29bd8097a01f --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_delete_annotations_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to delete annotations from an annotation queue. + class LLMObsDeleteAnnotationsRequest + include BaseGenericModel + + # Data object for deleting annotations. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'LLMObsDeleteAnnotationsDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDeleteAnnotationsRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_delete_annotations_response.rb b/lib/datadog_api_client/v2/models/llm_obs_delete_annotations_response.rb new file mode 100644 index 000000000000..1e9693ef9600 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_delete_annotations_response.rb @@ -0,0 +1,124 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for a batch annotation deletion. Partial errors are listed in the + # response if any annotations could not be deleted. + class LLMObsDeleteAnnotationsResponse + include BaseGenericModel + + # Data object for the annotation deletion response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'LLMObsDeleteAnnotationsDataResponse' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDeleteAnnotationsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, 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 new file mode 100644 index 000000000000..7208985bcaf2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_upsert_annotation_item.rb @@ -0,0 +1,152 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A single annotation to create or update. The annotation is matched by + # `interaction_id` and the requesting user's identity. + class LLMObsUpsertAnnotationItem + include BaseGenericModel + + # ID of the interaction to annotate. + attr_reader :interaction_id + + # Label values for this annotation. Each entry references a label schema by ID + # and provides the corresponding value validated against the schema type constraints. + attr_reader :label_values + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'interaction_id' => :'interaction_id', + :'label_values' => :'label_values' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'interaction_id' => :'String', + :'label_values' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsUpsertAnnotationItem` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'interaction_id') + self.interaction_id = attributes[:'interaction_id'] + end + + if attributes.key?(:'label_values') + if (value = attributes[:'label_values']).is_a?(Array) + self.label_values = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @interaction_id.nil? + return false if @label_values.nil? + return false if @label_values.length < 1 + true + end + + # Custom attribute writer method with validation + # @param interaction_id [Object] Object to be assigned + # @!visibility private + def interaction_id=(interaction_id) + if interaction_id.nil? + fail ArgumentError, 'invalid value for "interaction_id", interaction_id cannot be nil.' + end + @interaction_id = interaction_id + end + + # Custom attribute writer method with validation + # @param label_values [Object] Object to be assigned + # @!visibility private + def label_values=(label_values) + if label_values.nil? + fail ArgumentError, 'invalid value for "label_values", label_values cannot be nil.' + end + if label_values.length < 1 + fail ArgumentError, 'invalid value for "label_values", number of items must be greater than or equal to 1.' + end + @label_values = label_values + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + interaction_id == o.interaction_id && + label_values == o.label_values && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [interaction_id, label_values, additional_properties].hash + end + end +end