From 6c5485a70479580236894a490c6de81221cad9e3 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 18 Aug 2026 15:02:05 +0000 Subject: [PATCH] Regenerate client from commit 435b018 of spec repo --- .generator/schemas/v2/openapi.yaml | 204 ++++++++++++++++++ docs/datadog_api_client.v2.model.rst | 56 +++++ .../v2/llm-observability/DeleteLLMObsData.py | 32 +++ src/datadog_api_client/configuration.py | 1 + .../v2/api/llm_observability_api.py | 39 ++++ .../v2/model/llm_obs_data_deletion_request.py | 40 ++++ ...lm_obs_data_deletion_request_attributes.py | 55 +++++ .../llm_obs_data_deletion_request_data.py | 50 +++++ .../llm_obs_data_deletion_request_type.py | 35 +++ .../model/llm_obs_data_deletion_response.py | 40 ++++ ...m_obs_data_deletion_response_attributes.py | 80 +++++++ .../llm_obs_data_deletion_response_data.py | 60 ++++++ .../llm_obs_data_deletion_response_type.py | 35 +++ src/datadog_api_client/v2/models/__init__.py | 16 ++ tests/v2/features/llm_observability.feature | 16 ++ tests/v2/features/undo.json | 8 + 16 files changed, 767 insertions(+) create mode 100644 examples/v2/llm-observability/DeleteLLMObsData.py create mode 100644 src/datadog_api_client/v2/model/llm_obs_data_deletion_request.py create mode 100644 src/datadog_api_client/v2/model/llm_obs_data_deletion_request_attributes.py create mode 100644 src/datadog_api_client/v2/model/llm_obs_data_deletion_request_data.py create mode 100644 src/datadog_api_client/v2/model/llm_obs_data_deletion_request_type.py create mode 100644 src/datadog_api_client/v2/model/llm_obs_data_deletion_response.py create mode 100644 src/datadog_api_client/v2/model/llm_obs_data_deletion_response_attributes.py create mode 100644 src/datadog_api_client/v2/model/llm_obs_data_deletion_response_data.py create mode 100644 src/datadog_api_client/v2/model/llm_obs_data_deletion_response_type.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2f39666f08..db0bdfdf15 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -56412,6 +56412,139 @@ components: example: "my-gcp-project" type: string type: object + LLMObsDataDeletionRequest: + description: Request to delete LLM Observability data. + properties: + data: + $ref: "#/components/schemas/LLMObsDataDeletionRequestData" + required: + - data + type: object + LLMObsDataDeletionRequestAttributes: + description: Attributes for an LLM Observability data deletion request. + properties: + delay: + description: Optional delay in seconds before the deletion is executed. + example: 0 + format: int64 + type: integer + from: + description: Start of the deletion time range in milliseconds since Unix epoch. + example: 1705314600000 + format: int64 + type: integer + query: + additionalProperties: + type: string + description: Query filters selecting the data to delete. Must include a `query` key with an `@trace_id` filter. + example: + query: "@trace_id:abc123def456" + type: object + to: + description: End of the deletion time range in milliseconds since Unix epoch. + example: 1705315200000 + format: int64 + type: integer + required: + - query + - from + - to + type: object + LLMObsDataDeletionRequestData: + description: Data object for an LLM Observability data deletion request. + properties: + attributes: + $ref: "#/components/schemas/LLMObsDataDeletionRequestAttributes" + type: + $ref: "#/components/schemas/LLMObsDataDeletionRequestType" + required: + - type + - attributes + type: object + LLMObsDataDeletionRequestType: + description: Resource type for an LLM Observability data deletion request. + enum: + - create_deletion_req + example: create_deletion_req + type: string + x-enum-varnames: + - CREATE_DELETION_REQ + LLMObsDataDeletionResponse: + description: Response containing details of a submitted LLM Observability data deletion request. + properties: + data: + $ref: "#/components/schemas/LLMObsDataDeletionResponseData" + required: + - data + type: object + LLMObsDataDeletionResponseAttributes: + description: Attributes of a submitted LLM Observability data deletion request. + properties: + created_at: + description: Timestamp when the deletion request was created. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + created_by: + description: UUID of the user who created the deletion request. + example: "user-uuid-1234" + type: string + from_time: + description: Start of the deletion time range in milliseconds since Unix epoch. + example: 1705314600000 + format: int64 + type: integer + org_id: + description: ID of the organization that submitted the deletion request. + example: 12345 + format: int64 + type: integer + product: + description: Product name for the deletion request. + example: "llmobs" + type: string + query: + description: The query string used to select data for deletion. + example: "@trace_id:abc123def456" + type: string + to_time: + description: End of the deletion time range in milliseconds since Unix epoch. + example: 1705315200000 + format: int64 + type: integer + required: + - org_id + - product + - created_at + - created_by + - from_time + - to_time + - query + type: object + LLMObsDataDeletionResponseData: + description: Data object for an LLM Observability data deletion response. + properties: + attributes: + $ref: "#/components/schemas/LLMObsDataDeletionResponseAttributes" + id: + description: Unique identifier of the deletion request. + example: "msg-abc123" + type: string + type: + $ref: "#/components/schemas/LLMObsDataDeletionResponseType" + required: + - id + - type + - attributes + type: object + LLMObsDataDeletionResponseType: + description: Resource type for an LLM Observability data deletion response. + enum: + - deletion_request + example: deletion_request + type: string + x-enum-varnames: + - DELETION_REQUEST LLMObsDatasetBatchUpdateDataAttributesRequest: description: Attributes for batch-updating records in an LLM Observability dataset. properties: @@ -158460,6 +158593,77 @@ paths: operator: OR permissions: - org_management + /api/v2/llm-obs/deletion/data/llmobs: + post: + description: Submit a request to delete LLM Observability span data matching a trace ID filter within a specified time range. + operationId: DeleteLLMObsData + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + from: 1705314600000 + query: + query: "@trace_id:abc123def456" + to: 1705315200000 + type: create_deletion_req + schema: + $ref: "#/components/schemas/LLMObsDataDeletionRequest" + description: Data deletion request payload. + required: true + responses: + "202": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-15T10:30:00Z" + created_by: "user-uuid-1234" + from_time: 1705314600000 + org_id: 12345 + product: llmobs + query: "@trace_id:abc123def456" + to_time: 1705315200000 + id: msg-abc123 + type: deletion_request + schema: + $ref: "#/components/schemas/LLMObsDataDeletionResponse" + description: Accepted + "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 + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete LLM Observability data + 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/annotated-interactions: get: description: |- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index ac488764e4..c2a5e5aa47 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -24049,6 +24049,62 @@ datadog\_api\_client.v2.model.llm\_obs\_custom\_eval\_config\_vertex\_ai\_option :members: :show-inheritance: +datadog\_api\_client.v2.model.llm\_obs\_data\_deletion\_request module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.llm_obs_data_deletion_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.llm\_obs\_data\_deletion\_request\_attributes module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.llm_obs_data_deletion_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.llm\_obs\_data\_deletion\_request\_data module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.llm_obs_data_deletion_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.llm\_obs\_data\_deletion\_request\_type module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.llm_obs_data_deletion_request_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.llm\_obs\_data\_deletion\_response module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.llm_obs_data_deletion_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.llm\_obs\_data\_deletion\_response\_attributes module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.llm_obs_data_deletion_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.llm\_obs\_data\_deletion\_response\_data module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.llm_obs_data_deletion_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.llm\_obs\_data\_deletion\_response\_type module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.llm_obs_data_deletion_response_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.llm\_obs\_dataset\_batch\_update\_data\_attributes\_request module ------------------------------------------------------------------------------------------------ diff --git a/examples/v2/llm-observability/DeleteLLMObsData.py b/examples/v2/llm-observability/DeleteLLMObsData.py new file mode 100644 index 0000000000..457cf7aa8a --- /dev/null +++ b/examples/v2/llm-observability/DeleteLLMObsData.py @@ -0,0 +1,32 @@ +""" +Delete LLM Observability data returns "Accepted" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.llm_observability_api import LLMObservabilityApi +from datadog_api_client.v2.model.llm_obs_data_deletion_request import LLMObsDataDeletionRequest +from datadog_api_client.v2.model.llm_obs_data_deletion_request_attributes import LLMObsDataDeletionRequestAttributes +from datadog_api_client.v2.model.llm_obs_data_deletion_request_data import LLMObsDataDeletionRequestData +from datadog_api_client.v2.model.llm_obs_data_deletion_request_type import LLMObsDataDeletionRequestType + +body = LLMObsDataDeletionRequest( + data=LLMObsDataDeletionRequestData( + attributes=LLMObsDataDeletionRequestAttributes( + delay=0, + _from=1705314600000, + query=dict( + query="@trace_id:abc123def456", + ), + to=1705315200000, + ), + type=LLMObsDataDeletionRequestType.CREATE_DELETION_REQ, + ), +) + +configuration = Configuration() +configuration.unstable_operations["delete_llm_obs_data"] = True +with ApiClient(configuration) as api_client: + api_instance = LLMObservabilityApi(api_client) + response = api_instance.delete_llm_obs_data(body=body) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 69a1250d52..9c01331488 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -270,6 +270,7 @@ def __init__( "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, "v2.delete_llm_obs_datasets": False, "v2.delete_llm_obs_experiments": False, diff --git a/src/datadog_api_client/v2/api/llm_observability_api.py b/src/datadog_api_client/v2/api/llm_observability_api.py index 6bb95ee9ec..360532f054 100644 --- a/src/datadog_api_client/v2/api/llm_observability_api.py +++ b/src/datadog_api_client/v2/api/llm_observability_api.py @@ -16,6 +16,8 @@ from datadog_api_client.v2.model.llm_obs_custom_eval_config_list_response import LLMObsCustomEvalConfigListResponse from datadog_api_client.v2.model.llm_obs_custom_eval_config_response import LLMObsCustomEvalConfigResponse from datadog_api_client.v2.model.llm_obs_custom_eval_config_update_request import LLMObsCustomEvalConfigUpdateRequest +from datadog_api_client.v2.model.llm_obs_data_deletion_response import LLMObsDataDeletionResponse +from datadog_api_client.v2.model.llm_obs_data_deletion_request import LLMObsDataDeletionRequest from datadog_api_client.v2.model.llm_obs_annotated_interactions_by_trace_response import ( LLMObsAnnotatedInteractionsByTraceResponse, ) @@ -555,6 +557,26 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_llm_obs_data_endpoint = _Endpoint( + settings={ + "response_type": (LLMObsDataDeletionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/llm-obs/deletion/data/llmobs", + "operation_id": "delete_llm_obs_data", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (LLMObsDataDeletionRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._delete_llm_obs_dataset_records_endpoint = _Endpoint( settings={ "response_type": None, @@ -2541,6 +2563,23 @@ def delete_llm_obs_custom_eval_config( return self._delete_llm_obs_custom_eval_config_endpoint.call_with_http_info(**kwargs) + def delete_llm_obs_data( + self, + body: LLMObsDataDeletionRequest, + ) -> LLMObsDataDeletionResponse: + """Delete LLM Observability data. + + Submit a request to delete LLM Observability span data matching a trace ID filter within a specified time range. + + :param body: Data deletion request payload. + :type body: LLMObsDataDeletionRequest + :rtype: LLMObsDataDeletionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._delete_llm_obs_data_endpoint.call_with_http_info(**kwargs) + def delete_llm_obs_dataset_records( self, project_id: str, diff --git a/src/datadog_api_client/v2/model/llm_obs_data_deletion_request.py b/src/datadog_api_client/v2/model/llm_obs_data_deletion_request.py new file mode 100644 index 0000000000..07aa0d35d1 --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_data_deletion_request.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.llm_obs_data_deletion_request_data import LLMObsDataDeletionRequestData + + +class LLMObsDataDeletionRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_data_deletion_request_data import LLMObsDataDeletionRequestData + + return { + "data": (LLMObsDataDeletionRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: LLMObsDataDeletionRequestData, **kwargs): + """ + Request to delete LLM Observability data. + + :param data: Data object for an LLM Observability data deletion request. + :type data: LLMObsDataDeletionRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/llm_obs_data_deletion_request_attributes.py b/src/datadog_api_client/v2/model/llm_obs_data_deletion_request_attributes.py new file mode 100644 index 0000000000..15e79ce422 --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_data_deletion_request_attributes.py @@ -0,0 +1,55 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Dict, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class LLMObsDataDeletionRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "delay": (int,), + "_from": (int,), + "query": ({str: (str,)},), + "to": (int,), + } + + attribute_map = { + "delay": "delay", + "_from": "from", + "query": "query", + "to": "to", + } + + def __init__(self_, _from: int, query: Dict[str, str], to: int, delay: Union[int, UnsetType] = unset, **kwargs): + """ + Attributes for an LLM Observability data deletion request. + + :param delay: Optional delay in seconds before the deletion is executed. + :type delay: int, optional + + :param _from: Start of the deletion time range in milliseconds since Unix epoch. + :type _from: int + + :param query: Query filters selecting the data to delete. Must include a ``query`` key with an ``@trace_id`` filter. + :type query: {str: (str,)} + + :param to: End of the deletion time range in milliseconds since Unix epoch. + :type to: int + """ + if delay is not unset: + kwargs["delay"] = delay + super().__init__(kwargs) + + self_._from = _from + self_.query = query + self_.to = to diff --git a/src/datadog_api_client/v2/model/llm_obs_data_deletion_request_data.py b/src/datadog_api_client/v2/model/llm_obs_data_deletion_request_data.py new file mode 100644 index 0000000000..8c43f66bae --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_data_deletion_request_data.py @@ -0,0 +1,50 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.llm_obs_data_deletion_request_attributes import LLMObsDataDeletionRequestAttributes + from datadog_api_client.v2.model.llm_obs_data_deletion_request_type import LLMObsDataDeletionRequestType + + +class LLMObsDataDeletionRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_data_deletion_request_attributes import ( + LLMObsDataDeletionRequestAttributes, + ) + from datadog_api_client.v2.model.llm_obs_data_deletion_request_type import LLMObsDataDeletionRequestType + + return { + "attributes": (LLMObsDataDeletionRequestAttributes,), + "type": (LLMObsDataDeletionRequestType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: LLMObsDataDeletionRequestAttributes, type: LLMObsDataDeletionRequestType, **kwargs): + """ + Data object for an LLM Observability data deletion request. + + :param attributes: Attributes for an LLM Observability data deletion request. + :type attributes: LLMObsDataDeletionRequestAttributes + + :param type: Resource type for an LLM Observability data deletion request. + :type type: LLMObsDataDeletionRequestType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/llm_obs_data_deletion_request_type.py b/src/datadog_api_client/v2/model/llm_obs_data_deletion_request_type.py new file mode 100644 index 0000000000..618c3a226c --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_data_deletion_request_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class LLMObsDataDeletionRequestType(ModelSimple): + """ + Resource type for an LLM Observability data deletion request. + + :param value: If omitted defaults to "create_deletion_req". Must be one of ["create_deletion_req"]. + :type value: str + """ + + allowed_values = { + "create_deletion_req", + } + CREATE_DELETION_REQ: ClassVar["LLMObsDataDeletionRequestType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +LLMObsDataDeletionRequestType.CREATE_DELETION_REQ = LLMObsDataDeletionRequestType("create_deletion_req") diff --git a/src/datadog_api_client/v2/model/llm_obs_data_deletion_response.py b/src/datadog_api_client/v2/model/llm_obs_data_deletion_response.py new file mode 100644 index 0000000000..eeed15429d --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_data_deletion_response.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.llm_obs_data_deletion_response_data import LLMObsDataDeletionResponseData + + +class LLMObsDataDeletionResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_data_deletion_response_data import LLMObsDataDeletionResponseData + + return { + "data": (LLMObsDataDeletionResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: LLMObsDataDeletionResponseData, **kwargs): + """ + Response containing details of a submitted LLM Observability data deletion request. + + :param data: Data object for an LLM Observability data deletion response. + :type data: LLMObsDataDeletionResponseData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/llm_obs_data_deletion_response_attributes.py b/src/datadog_api_client/v2/model/llm_obs_data_deletion_response_attributes.py new file mode 100644 index 0000000000..aabd9bc25d --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_data_deletion_response_attributes.py @@ -0,0 +1,80 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, +) + + +class LLMObsDataDeletionResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "created_at": (datetime,), + "created_by": (str,), + "from_time": (int,), + "org_id": (int,), + "product": (str,), + "query": (str,), + "to_time": (int,), + } + + attribute_map = { + "created_at": "created_at", + "created_by": "created_by", + "from_time": "from_time", + "org_id": "org_id", + "product": "product", + "query": "query", + "to_time": "to_time", + } + + def __init__( + self_, + created_at: datetime, + created_by: str, + from_time: int, + org_id: int, + product: str, + query: str, + to_time: int, + **kwargs, + ): + """ + Attributes of a submitted LLM Observability data deletion request. + + :param created_at: Timestamp when the deletion request was created. + :type created_at: datetime + + :param created_by: UUID of the user who created the deletion request. + :type created_by: str + + :param from_time: Start of the deletion time range in milliseconds since Unix epoch. + :type from_time: int + + :param org_id: ID of the organization that submitted the deletion request. + :type org_id: int + + :param product: Product name for the deletion request. + :type product: str + + :param query: The query string used to select data for deletion. + :type query: str + + :param to_time: End of the deletion time range in milliseconds since Unix epoch. + :type to_time: int + """ + super().__init__(kwargs) + + self_.created_at = created_at + self_.created_by = created_by + self_.from_time = from_time + self_.org_id = org_id + self_.product = product + self_.query = query + self_.to_time = to_time diff --git a/src/datadog_api_client/v2/model/llm_obs_data_deletion_response_data.py b/src/datadog_api_client/v2/model/llm_obs_data_deletion_response_data.py new file mode 100644 index 0000000000..29367a02d7 --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_data_deletion_response_data.py @@ -0,0 +1,60 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.llm_obs_data_deletion_response_attributes import ( + LLMObsDataDeletionResponseAttributes, + ) + from datadog_api_client.v2.model.llm_obs_data_deletion_response_type import LLMObsDataDeletionResponseType + + +class LLMObsDataDeletionResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_data_deletion_response_attributes import ( + LLMObsDataDeletionResponseAttributes, + ) + from datadog_api_client.v2.model.llm_obs_data_deletion_response_type import LLMObsDataDeletionResponseType + + return { + "attributes": (LLMObsDataDeletionResponseAttributes,), + "id": (str,), + "type": (LLMObsDataDeletionResponseType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: LLMObsDataDeletionResponseAttributes, id: str, type: LLMObsDataDeletionResponseType, **kwargs + ): + """ + Data object for an LLM Observability data deletion response. + + :param attributes: Attributes of a submitted LLM Observability data deletion request. + :type attributes: LLMObsDataDeletionResponseAttributes + + :param id: Unique identifier of the deletion request. + :type id: str + + :param type: Resource type for an LLM Observability data deletion response. + :type type: LLMObsDataDeletionResponseType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/llm_obs_data_deletion_response_type.py b/src/datadog_api_client/v2/model/llm_obs_data_deletion_response_type.py new file mode 100644 index 0000000000..e69779395b --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_data_deletion_response_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class LLMObsDataDeletionResponseType(ModelSimple): + """ + Resource type for an LLM Observability data deletion response. + + :param value: If omitted defaults to "deletion_request". Must be one of ["deletion_request"]. + :type value: str + """ + + allowed_values = { + "deletion_request", + } + DELETION_REQUEST: ClassVar["LLMObsDataDeletionResponseType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +LLMObsDataDeletionResponseType.DELETION_REQUEST = LLMObsDataDeletionResponseType("deletion_request") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 127189e023..7200f76674 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -4460,6 +4460,14 @@ from datadog_api_client.v2.model.llm_obs_custom_eval_config_vertex_ai_options import ( LLMObsCustomEvalConfigVertexAIOptions, ) +from datadog_api_client.v2.model.llm_obs_data_deletion_request import LLMObsDataDeletionRequest +from datadog_api_client.v2.model.llm_obs_data_deletion_request_attributes import LLMObsDataDeletionRequestAttributes +from datadog_api_client.v2.model.llm_obs_data_deletion_request_data import LLMObsDataDeletionRequestData +from datadog_api_client.v2.model.llm_obs_data_deletion_request_type import LLMObsDataDeletionRequestType +from datadog_api_client.v2.model.llm_obs_data_deletion_response import LLMObsDataDeletionResponse +from datadog_api_client.v2.model.llm_obs_data_deletion_response_attributes import LLMObsDataDeletionResponseAttributes +from datadog_api_client.v2.model.llm_obs_data_deletion_response_data import LLMObsDataDeletionResponseData +from datadog_api_client.v2.model.llm_obs_data_deletion_response_type import LLMObsDataDeletionResponseType from datadog_api_client.v2.model.llm_obs_dataset_batch_update_data_attributes_request import ( LLMObsDatasetBatchUpdateDataAttributesRequest, ) @@ -13908,6 +13916,14 @@ "LLMObsCustomEvalConfigUpdateRequest", "LLMObsCustomEvalConfigUser", "LLMObsCustomEvalConfigVertexAIOptions", + "LLMObsDataDeletionRequest", + "LLMObsDataDeletionRequestAttributes", + "LLMObsDataDeletionRequestData", + "LLMObsDataDeletionRequestType", + "LLMObsDataDeletionResponse", + "LLMObsDataDeletionResponseAttributes", + "LLMObsDataDeletionResponseData", + "LLMObsDataDeletionResponseType", "LLMObsDatasetBatchUpdateDataAttributesRequest", "LLMObsDatasetBatchUpdateDataRequest", "LLMObsDatasetBatchUpdateInsertRecord", diff --git a/tests/v2/features/llm_observability.feature b/tests/v2/features/llm_observability.feature index 8cb53cdc5a..b1897f532b 100644 --- a/tests/v2/features/llm_observability.feature +++ b/tests/v2/features/llm_observability.feature @@ -420,6 +420,22 @@ Feature: LLM Observability 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 + And new "DeleteLLMObsData" request + And body with value {"data": {"attributes": {"delay": 0, "from": 1705314600000, "query": {"query": "@trace_id:abc123def456"}, "to": 1705315200000}, "type": "create_deletion_req"}} + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/ml-observability + Scenario: Delete LLM Observability data returns "Bad Request" response + Given operation "DeleteLLMObsData" enabled + And new "DeleteLLMObsData" request + And body with value {"data": {"attributes": {"delay": 0, "from": 1705314600000, "query": {"query": "@trace_id:abc123def456"}, "to": 1705315200000}, "type": "create_deletion_req"}} + When the request is sent + Then the response status is 400 Bad Request + @generated @skip @team:DataDog/ml-observability Scenario: Delete LLM Observability dataset records returns "Bad Request" response Given operation "DeleteLLMObsDatasetRecords" enabled diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index ad49f8ac47..df961ee10c 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -4439,6 +4439,14 @@ "type": "idempotent" } }, + "DeleteLLMObsData": { + "tag": "LLM Observability", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, "GetLLMObsAnnotatedInteractionsByTraceIDs": { "tag": "LLM Observability", "undo": {