From cb2768667c58ea1d95e9b7e308d4cb29333ac0e9 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 3 Sep 2026 17:01:54 +0000 Subject: [PATCH] Regenerate client from commit 24d86a0 of spec repo --- .generator/schemas/v2/openapi.yaml | 183 ++++++++++++++++++ .../GetLLMObsAnnotatedInteraction.py | 17 ++ ...etLLMObsAnnotatedInteraction_3394378457.py | 17 ++ src/datadog_api_client/configuration.py | 1 + .../v2/api/agent_observability_api.py | 131 +++++++++++++ ...ed_interaction_data_attributes_response.py | 80 ++++++++ ...obs_annotated_interaction_data_response.py | 64 ++++++ .../llm_obs_annotated_interaction_event.py | 56 ++++++ ..._annotated_interaction_event_attributes.py | 17 ++ .../llm_obs_annotated_interaction_response.py | 44 +++++ src/datadog_api_client/v2/models/__init__.py | 16 ++ tests/v2/features/agent_observability.feature | 36 ++++ tests/v2/features/undo.json | 6 + 13 files changed, 668 insertions(+) create mode 100644 examples/v2/agent-observability/GetLLMObsAnnotatedInteraction.py create mode 100644 examples/v2/agent-observability/GetLLMObsAnnotatedInteraction_3394378457.py create mode 100644 src/datadog_api_client/v2/model/llm_obs_annotated_interaction_data_attributes_response.py create mode 100644 src/datadog_api_client/v2/model/llm_obs_annotated_interaction_data_response.py create mode 100644 src/datadog_api_client/v2/model/llm_obs_annotated_interaction_event.py create mode 100644 src/datadog_api_client/v2/model/llm_obs_annotated_interaction_event_attributes.py create mode 100644 src/datadog_api_client/v2/model/llm_obs_annotated_interaction_response.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 324b65c3eb..68c9c54a6d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -988,6 +988,14 @@ components: required: true schema: type: string + LLMObsAnnotationQueueInteractionIDPathParameter: + description: The ID of the interaction in the annotation queue. + example: "interaction-456" + in: path + name: interaction_id + required: true + schema: + type: string LLMObsDatasetIDPathParameter: description: The ID of the Agent Observability dataset. example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" @@ -56166,11 +56174,89 @@ components: - can_annotate - annotations type: object + LLMObsAnnotatedInteractionDataAttributesResponse: + description: Attributes containing an annotated interaction and its related events. + properties: + annotated_interaction: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionItem" + events: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionEvents" + interaction_type: + $ref: "#/components/schemas/LLMObsAnyInteractionType" + next_cursor: + description: Cursor to retrieve the next page of events. Absent when there are no more events. + example: "eyJzdGFydCI6MTAwfQ==" + type: string + required: + - annotated_interaction + - interaction_type + - events + type: object + LLMObsAnnotatedInteractionDataResponse: + description: Data object for a single annotated interaction. + properties: + attributes: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionDataAttributesResponse" + id: + description: Unique identifier of the interaction. + example: "interaction-456" + type: string + type: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionsType" + required: + - id + - type + - attributes + type: object + LLMObsAnnotatedInteractionEvent: + description: An event associated with an annotated interaction. + properties: + attributes: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionEventAttributes" + id: + description: Unique identifier of the event. + example: "span-7a1b2c3d" + type: string + type: + description: Type of the event. + example: span + type: string + required: + - id + - type + - attributes + type: object + LLMObsAnnotatedInteractionEventAttributes: + additionalProperties: {} + description: Attributes of an event associated with an annotated interaction. + example: + duration: 1500000000 + ml_app: my-llm-app + name: agent_workflow + span_id: span-7a1b2c3d + span_kind: agent + start_ns: 1705314600000000000 + status: ok + trace_id: trace-abc-123 + type: object + LLMObsAnnotatedInteractionEvents: + description: Page of events associated with the annotated interaction. + items: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionEvent" + type: array LLMObsAnnotatedInteractionItem: description: An interaction with its associated annotations. oneOf: - $ref: "#/components/schemas/LLMObsTraceAnnotatedInteractionItem" - $ref: "#/components/schemas/LLMObsDisplayBlockAnnotatedInteractionItem" + LLMObsAnnotatedInteractionResponse: + description: Response containing a single annotated interaction and its related events. + properties: + data: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionDataResponse" + required: + - data + type: object LLMObsAnnotatedInteractionsByTraceDataAttributesResponse: description: Attributes of the cross-queue annotated interactions response. properties: @@ -166482,6 +166568,103 @@ 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}/annotated-interactions/{interaction_id}: + get: + description: Retrieve an interaction, its annotations, and a page of related events from an annotation queue. + operationId: GetLLMObsAnnotatedInteraction + parameters: + - $ref: "#/components/parameters/LLMObsAnnotationQueueIDPathParameter" + - $ref: "#/components/parameters/LLMObsAnnotationQueueInteractionIDPathParameter" + - description: Maximum number of events to return. Defaults to 10. + in: query + name: limit + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + - description: Cursor from the previous response to retrieve the next page of events. + in: query + name: cursor + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + annotated_interaction: + annotations: [] + can_annotate: true + content_id: trace-abc-123 + created_at: "2024-01-15T10:30:00Z" + id: interaction-456 + modified_at: "2024-01-15T10:30:00Z" + type: trace + events: + - attributes: + duration: 1500000000 + ml_app: my-llm-app + name: agent_workflow + span_id: span-7a1b2c3d + span_kind: agent + start_ns: 1705314600000000000 + status: ok + trace_id: trace-abc-123 + id: span-7a1b2c3d + type: span + interaction_type: session + next_cursor: eyJzdGFydCI6MTAwfQ== + id: interaction-456 + type: annotated_interactions + schema: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionResponse" + description: OK + "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 + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get an annotated queue interaction + tags: + - Agent Observability + x-pagination: + cursorParam: cursor + cursorPath: data.attributes.next_cursor + limitParam: limit + resultsPath: data.attributes.events + 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: |- diff --git a/examples/v2/agent-observability/GetLLMObsAnnotatedInteraction.py b/examples/v2/agent-observability/GetLLMObsAnnotatedInteraction.py new file mode 100644 index 0000000000..ff8cd09eb5 --- /dev/null +++ b/examples/v2/agent-observability/GetLLMObsAnnotatedInteraction.py @@ -0,0 +1,17 @@ +""" +Get an annotated queue interaction returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.agent_observability_api import AgentObservabilityApi + +configuration = Configuration() +configuration.unstable_operations["get_llm_obs_annotated_interaction"] = True +with ApiClient(configuration) as api_client: + api_instance = AgentObservabilityApi(api_client) + response = api_instance.get_llm_obs_annotated_interaction( + queue_id="queue_id", + interaction_id="interaction_id", + ) + + print(response) diff --git a/examples/v2/agent-observability/GetLLMObsAnnotatedInteraction_3394378457.py b/examples/v2/agent-observability/GetLLMObsAnnotatedInteraction_3394378457.py new file mode 100644 index 0000000000..888e224dba --- /dev/null +++ b/examples/v2/agent-observability/GetLLMObsAnnotatedInteraction_3394378457.py @@ -0,0 +1,17 @@ +""" +Get an annotated queue interaction returns "OK" response with pagination +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.agent_observability_api import AgentObservabilityApi + +configuration = Configuration() +configuration.unstable_operations["get_llm_obs_annotated_interaction"] = True +with ApiClient(configuration) as api_client: + api_instance = AgentObservabilityApi(api_client) + items = api_instance.get_llm_obs_annotated_interaction_with_pagination( + queue_id="queue_id", + interaction_id="interaction_id", + ) + for item in items: + print(item) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 14e6953ee1..0afdd78e66 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -286,6 +286,7 @@ def __init__( "v2.delete_llm_obs_projects": False, "v2.delete_llm_obs_prompt": False, "v2.export_llm_obs_dataset": False, + "v2.get_llm_obs_annotated_interaction": False, "v2.get_llm_obs_annotated_interactions": False, "v2.get_llm_obs_annotated_interactions_by_trace_i_ds": False, "v2.get_llm_obs_annotation_queue_label_schema": False, diff --git a/src/datadog_api_client/v2/api/agent_observability_api.py b/src/datadog_api_client/v2/api/agent_observability_api.py index 3cd16b79d1..dda16d2c78 100644 --- a/src/datadog_api_client/v2/api/agent_observability_api.py +++ b/src/datadog_api_client/v2/api/agent_observability_api.py @@ -3,12 +3,15 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations +import collections from typing import Any, Dict, List, Union import warnings from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint from datadog_api_client.configuration import Configuration from datadog_api_client.model_utils import ( + set_attribute_from_path, + get_attribute_from_path, file_type, UnsetType, unset, @@ -24,6 +27,8 @@ from datadog_api_client.v2.model.llm_obs_annotation_queue_request import LLMObsAnnotationQueueRequest from datadog_api_client.v2.model.llm_obs_annotation_queue_update_request import LLMObsAnnotationQueueUpdateRequest from datadog_api_client.v2.model.llm_obs_annotated_interactions_response import LLMObsAnnotatedInteractionsResponse +from datadog_api_client.v2.model.llm_obs_annotated_interaction_response import LLMObsAnnotatedInteractionResponse +from datadog_api_client.v2.model.llm_obs_annotated_interaction_event import LLMObsAnnotatedInteractionEvent from datadog_api_client.v2.model.llm_obs_annotations_response import LLMObsAnnotationsResponse from datadog_api_client.v2.model.llm_obs_annotations_request import LLMObsAnnotationsRequest from datadog_api_client.v2.model.llm_obs_delete_annotations_response import LLMObsDeleteAnnotationsResponse @@ -741,6 +746,49 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_llm_obs_annotated_interaction_endpoint = _Endpoint( + settings={ + "response_type": (LLMObsAnnotatedInteractionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotated-interactions/{interaction_id}", + "operation_id": "get_llm_obs_annotated_interaction", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "queue_id": { + "required": True, + "openapi_types": (str,), + "attribute": "queue_id", + "location": "path", + }, + "interaction_id": { + "required": True, + "openapi_types": (str,), + "attribute": "interaction_id", + "location": "path", + }, + "limit": { + "validation": { + "inclusive_maximum": 1000, + "inclusive_minimum": 1, + }, + "openapi_types": (int,), + "attribute": "limit", + "location": "query", + }, + "cursor": { + "openapi_types": (str,), + "attribute": "cursor", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._get_llm_obs_annotated_interactions_endpoint = _Endpoint( settings={ "response_type": (LLMObsAnnotatedInteractionsResponse,), @@ -2694,6 +2742,89 @@ def export_llm_obs_dataset( return self._export_llm_obs_dataset_endpoint.call_with_http_info(**kwargs) + def get_llm_obs_annotated_interaction( + self, + queue_id: str, + interaction_id: str, + *, + limit: Union[int, UnsetType] = unset, + cursor: Union[str, UnsetType] = unset, + ) -> LLMObsAnnotatedInteractionResponse: + """Get an annotated queue interaction. + + Retrieve an interaction, its annotations, and a page of related events from an annotation queue. + + :param queue_id: The ID of the Agent Observability annotation queue. + :type queue_id: str + :param interaction_id: The ID of the interaction in the annotation queue. + :type interaction_id: str + :param limit: Maximum number of events to return. Defaults to 10. + :type limit: int, optional + :param cursor: Cursor from the previous response to retrieve the next page of events. + :type cursor: str, optional + :rtype: LLMObsAnnotatedInteractionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["queue_id"] = queue_id + + kwargs["interaction_id"] = interaction_id + + if limit is not unset: + kwargs["limit"] = limit + + if cursor is not unset: + kwargs["cursor"] = cursor + + return self._get_llm_obs_annotated_interaction_endpoint.call_with_http_info(**kwargs) + + def get_llm_obs_annotated_interaction_with_pagination( + self, + queue_id: str, + interaction_id: str, + *, + limit: Union[int, UnsetType] = unset, + cursor: Union[str, UnsetType] = unset, + ) -> collections.abc.Iterable[LLMObsAnnotatedInteractionEvent]: + """Get an annotated queue interaction. + + Provide a paginated version of :meth:`get_llm_obs_annotated_interaction`, returning all items. + + :param queue_id: The ID of the Agent Observability annotation queue. + :type queue_id: str + :param interaction_id: The ID of the interaction in the annotation queue. + :type interaction_id: str + :param limit: Maximum number of events to return. Defaults to 10. + :type limit: int, optional + :param cursor: Cursor from the previous response to retrieve the next page of events. + :type cursor: str, optional + + :return: A generator of paginated results. + :rtype: collections.abc.Iterable[LLMObsAnnotatedInteractionEvent] + """ + kwargs: Dict[str, Any] = {} + kwargs["queue_id"] = queue_id + + kwargs["interaction_id"] = interaction_id + + if limit is not unset: + kwargs["limit"] = limit + + if cursor is not unset: + kwargs["cursor"] = cursor + + local_page_size = get_attribute_from_path(kwargs, "limit", 10) + endpoint = self._get_llm_obs_annotated_interaction_endpoint + set_attribute_from_path(kwargs, "limit", local_page_size, endpoint.params_map) + pagination = { + "limit_value": local_page_size, + "results_path": "data.attributes.events", + "cursor_param": "cursor", + "cursor_path": "data.attributes.next_cursor", + "endpoint": endpoint, + "kwargs": kwargs, + } + return endpoint.call_with_http_info_paginated(pagination) + def get_llm_obs_annotated_interactions( self, queue_id: str, diff --git a/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_data_attributes_response.py b/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_data_attributes_response.py new file mode 100644 index 0000000000..742f70cdd0 --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_data_attributes_response.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 typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.llm_obs_annotated_interaction_item import LLMObsAnnotatedInteractionItem + from datadog_api_client.v2.model.llm_obs_annotated_interaction_event import LLMObsAnnotatedInteractionEvent + from datadog_api_client.v2.model.llm_obs_any_interaction_type import LLMObsAnyInteractionType + from datadog_api_client.v2.model.llm_obs_trace_annotated_interaction_item import LLMObsTraceAnnotatedInteractionItem + from datadog_api_client.v2.model.llm_obs_display_block_annotated_interaction_item import ( + LLMObsDisplayBlockAnnotatedInteractionItem, + ) + + +class LLMObsAnnotatedInteractionDataAttributesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_annotated_interaction_item import LLMObsAnnotatedInteractionItem + from datadog_api_client.v2.model.llm_obs_annotated_interaction_event import LLMObsAnnotatedInteractionEvent + from datadog_api_client.v2.model.llm_obs_any_interaction_type import LLMObsAnyInteractionType + + return { + "annotated_interaction": (LLMObsAnnotatedInteractionItem,), + "events": ([LLMObsAnnotatedInteractionEvent],), + "interaction_type": (LLMObsAnyInteractionType,), + "next_cursor": (str,), + } + + attribute_map = { + "annotated_interaction": "annotated_interaction", + "events": "events", + "interaction_type": "interaction_type", + "next_cursor": "next_cursor", + } + + def __init__( + self_, + annotated_interaction: Union[ + LLMObsAnnotatedInteractionItem, + LLMObsTraceAnnotatedInteractionItem, + LLMObsDisplayBlockAnnotatedInteractionItem, + ], + events: List[LLMObsAnnotatedInteractionEvent], + interaction_type: LLMObsAnyInteractionType, + next_cursor: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Attributes containing an annotated interaction and its related events. + + :param annotated_interaction: An interaction with its associated annotations. + :type annotated_interaction: LLMObsAnnotatedInteractionItem + + :param events: Page of events associated with the annotated interaction. + :type events: [LLMObsAnnotatedInteractionEvent] + + :param interaction_type: Type of an annotated interaction. + :type interaction_type: LLMObsAnyInteractionType + + :param next_cursor: Cursor to retrieve the next page of events. Absent when there are no more events. + :type next_cursor: str, optional + """ + if next_cursor is not unset: + kwargs["next_cursor"] = next_cursor + super().__init__(kwargs) + + self_.annotated_interaction = annotated_interaction + self_.events = events + self_.interaction_type = interaction_type diff --git a/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_data_response.py b/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_data_response.py new file mode 100644 index 0000000000..df456a6402 --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_data_response.py @@ -0,0 +1,64 @@ +# 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_annotated_interaction_data_attributes_response import ( + LLMObsAnnotatedInteractionDataAttributesResponse, + ) + from datadog_api_client.v2.model.llm_obs_annotated_interactions_type import LLMObsAnnotatedInteractionsType + + +class LLMObsAnnotatedInteractionDataResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_annotated_interaction_data_attributes_response import ( + LLMObsAnnotatedInteractionDataAttributesResponse, + ) + from datadog_api_client.v2.model.llm_obs_annotated_interactions_type import LLMObsAnnotatedInteractionsType + + return { + "attributes": (LLMObsAnnotatedInteractionDataAttributesResponse,), + "id": (str,), + "type": (LLMObsAnnotatedInteractionsType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: LLMObsAnnotatedInteractionDataAttributesResponse, + id: str, + type: LLMObsAnnotatedInteractionsType, + **kwargs, + ): + """ + Data object for a single annotated interaction. + + :param attributes: Attributes containing an annotated interaction and its related events. + :type attributes: LLMObsAnnotatedInteractionDataAttributesResponse + + :param id: Unique identifier of the interaction. + :type id: str + + :param type: Resource type for annotated interactions. + :type type: LLMObsAnnotatedInteractionsType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_event.py b/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_event.py new file mode 100644 index 0000000000..c8c0025f2e --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_event.py @@ -0,0 +1,56 @@ +# 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_annotated_interaction_event_attributes import ( + LLMObsAnnotatedInteractionEventAttributes, + ) + + +class LLMObsAnnotatedInteractionEvent(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_annotated_interaction_event_attributes import ( + LLMObsAnnotatedInteractionEventAttributes, + ) + + return { + "attributes": (LLMObsAnnotatedInteractionEventAttributes,), + "id": (str,), + "type": (str,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: LLMObsAnnotatedInteractionEventAttributes, id: str, type: str, **kwargs): + """ + An event associated with an annotated interaction. + + :param attributes: Attributes of an event associated with an annotated interaction. + :type attributes: LLMObsAnnotatedInteractionEventAttributes + + :param id: Unique identifier of the event. + :type id: str + + :param type: Type of the event. + :type type: str + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_event_attributes.py b/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_event_attributes.py new file mode 100644 index 0000000000..fde6b010a5 --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_event_attributes.py @@ -0,0 +1,17 @@ +# 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, +) + + +class LLMObsAnnotatedInteractionEventAttributes(ModelNormal): + def __init__(self_, **kwargs): + """ + Attributes of an event associated with an annotated interaction. + """ + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_response.py b/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_response.py new file mode 100644 index 0000000000..e102c4c24b --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_response.py @@ -0,0 +1,44 @@ +# 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_annotated_interaction_data_response import ( + LLMObsAnnotatedInteractionDataResponse, + ) + + +class LLMObsAnnotatedInteractionResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_annotated_interaction_data_response import ( + LLMObsAnnotatedInteractionDataResponse, + ) + + return { + "data": (LLMObsAnnotatedInteractionDataResponse,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: LLMObsAnnotatedInteractionDataResponse, **kwargs): + """ + Response containing a single annotated interaction and its related events. + + :param data: Data object for a single annotated interaction. + :type data: LLMObsAnnotatedInteractionDataResponse + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index e4a7cf4916..6e882ce1c4 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -4460,7 +4460,18 @@ from datadog_api_client.v2.model.llm_obs_annotated_interaction_by_trace_item import ( LLMObsAnnotatedInteractionByTraceItem, ) +from datadog_api_client.v2.model.llm_obs_annotated_interaction_data_attributes_response import ( + LLMObsAnnotatedInteractionDataAttributesResponse, +) +from datadog_api_client.v2.model.llm_obs_annotated_interaction_data_response import ( + LLMObsAnnotatedInteractionDataResponse, +) +from datadog_api_client.v2.model.llm_obs_annotated_interaction_event import LLMObsAnnotatedInteractionEvent +from datadog_api_client.v2.model.llm_obs_annotated_interaction_event_attributes import ( + LLMObsAnnotatedInteractionEventAttributes, +) from datadog_api_client.v2.model.llm_obs_annotated_interaction_item import LLMObsAnnotatedInteractionItem +from datadog_api_client.v2.model.llm_obs_annotated_interaction_response import LLMObsAnnotatedInteractionResponse from datadog_api_client.v2.model.llm_obs_annotated_interactions_by_trace_data_attributes_response import ( LLMObsAnnotatedInteractionsByTraceDataAttributesResponse, ) @@ -14634,7 +14645,12 @@ "KindObj", "KindResponseMeta", "LLMObsAnnotatedInteractionByTraceItem", + "LLMObsAnnotatedInteractionDataAttributesResponse", + "LLMObsAnnotatedInteractionDataResponse", + "LLMObsAnnotatedInteractionEvent", + "LLMObsAnnotatedInteractionEventAttributes", "LLMObsAnnotatedInteractionItem", + "LLMObsAnnotatedInteractionResponse", "LLMObsAnnotatedInteractionsByTraceDataAttributesResponse", "LLMObsAnnotatedInteractionsByTraceDataResponse", "LLMObsAnnotatedInteractionsByTraceResponse", diff --git a/tests/v2/features/agent_observability.feature b/tests/v2/features/agent_observability.feature index acf08cf0dd..8cc3d34237 100644 --- a/tests/v2/features/agent_observability.feature +++ b/tests/v2/features/agent_observability.feature @@ -782,6 +782,42 @@ Feature: Agent Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: Get an annotated queue interaction returns "Bad Request" response + Given operation "GetLLMObsAnnotatedInteraction" enabled + And new "GetLLMObsAnnotatedInteraction" request + And request contains "queue_id" parameter from "REPLACE.ME" + And request contains "interaction_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Get an annotated queue interaction returns "Not Found" response + Given operation "GetLLMObsAnnotatedInteraction" enabled + And new "GetLLMObsAnnotatedInteraction" request + And request contains "queue_id" parameter from "REPLACE.ME" + And request contains "interaction_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Get an annotated queue interaction returns "OK" response + Given operation "GetLLMObsAnnotatedInteraction" enabled + And new "GetLLMObsAnnotatedInteraction" request + And request contains "queue_id" parameter from "REPLACE.ME" + And request contains "interaction_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability @with-pagination + Scenario: Get an annotated queue interaction returns "OK" response with pagination + Given operation "GetLLMObsAnnotatedInteraction" enabled + And new "GetLLMObsAnnotatedInteraction" request + And request contains "queue_id" parameter from "REPLACE.ME" + And request contains "interaction_id" parameter from "REPLACE.ME" + When the request with pagination is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Get annotated interactions by content IDs returns "Bad Request" response Given operation "GetLLMObsAnnotatedInteractionsByTraceIDs" enabled diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 383d0fec6e..960023eb2f 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -4636,6 +4636,12 @@ "type": "safe" } }, + "GetLLMObsAnnotatedInteraction": { + "tag": "Agent Observability", + "undo": { + "type": "safe" + } + }, "UpsertLLMObsAnnotations": { "tag": "Agent Observability", "undo": {