diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 96018843d0..4b65adabc6 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 within 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" @@ -56046,14 +56054,14 @@ components: annotations: description: List of annotations for this interaction. items: - $ref: "#/components/schemas/LLMObsAnnotationItem" + $ref: "#/components/schemas/LLMObsAnnotationItemResponse" type: array can_annotate: description: Whether the current caller can annotate this interaction. example: true type: boolean content_id: - description: Upstream entity identifier (trace ID, session ID, or deterministic display_block ID). + description: Upstream entity identifier (trace ID, session ID, or deterministic display_block or frontend ID). example: "trace-abc-123" type: string created_at: @@ -56063,6 +56071,8 @@ components: type: string display_block: $ref: "#/components/schemas/LLMObsContentBlocks" + frontend: + $ref: "#/components/schemas/LLMObsFrontendContent" id: description: Unique identifier of the interaction. example: "interaction-456" @@ -56093,11 +56103,44 @@ components: - can_annotate - annotations type: object + LLMObsAnnotatedInteractionDataAttributesResponse: + description: Attributes containing the annotated interaction. + properties: + annotated_interaction: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionItem" + required: + - annotated_interaction + type: object + LLMObsAnnotatedInteractionDataResponse: + description: Data object for a single annotated interaction. + properties: + attributes: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionDataAttributesResponse" + id: + description: The annotation queue ID. + example: "00000000-0000-0000-0000-000000000001" + type: string + type: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionsType" + required: + - id + - type + - attributes + type: object LLMObsAnnotatedInteractionItem: description: An interaction with its associated annotations. oneOf: - $ref: "#/components/schemas/LLMObsTraceAnnotatedInteractionItem" - $ref: "#/components/schemas/LLMObsDisplayBlockAnnotatedInteractionItem" + - $ref: "#/components/schemas/LLMObsFrontendAnnotatedInteractionItem" + LLMObsAnnotatedInteractionResponse: + description: Response containing a single annotated interaction. + properties: + data: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionDataResponse" + required: + - data + type: object LLMObsAnnotatedInteractionsByTraceDataAttributesResponse: description: Attributes of the cross-queue annotated interactions response. properties: @@ -56236,51 +56279,6 @@ components: type: string x-enum-varnames: - PERMISSION_DENIED - LLMObsAnnotationItem: - description: A single annotation on an interaction. - properties: - created_at: - description: Timestamp when the annotation was created. - example: "2024-01-15T10:30:00Z" - format: date-time - type: string - created_by: - description: Identifier of the user who created the annotation. - example: "00000000-0000-0000-0000-000000000002" - type: string - id: - description: Unique identifier of the annotation. - example: "annotation-789" - type: string - interaction_id: - description: Identifier of the interaction this annotation belongs to. - example: "interaction-456" - type: string - label_values: - additionalProperties: {} - description: Label values for this annotation. - example: - - label_schema_id: "abc-123" - value: "good" - type: object - modified_at: - description: Timestamp when the annotation was last modified. - example: "2024-01-15T10:30:00Z" - format: date-time - type: string - modified_by: - description: Identifier of the user who last modified the annotation. - example: "00000000-0000-0000-0000-000000000002" - type: string - required: - - id - - interaction_id - - label_values - - created_by - - created_at - - modified_by - - modified_at - type: object LLMObsAnnotationItemResponse: description: A single annotation on an interaction, as returned by the API. properties: @@ -56539,11 +56537,13 @@ components: oneOf: - $ref: "#/components/schemas/LLMObsTraceInteractionItem" - $ref: "#/components/schemas/LLMObsDisplayBlockInteractionItem" + - $ref: "#/components/schemas/LLMObsFrontendInteractionItem" LLMObsAnnotationQueueInteractionResponseItem: description: A single interaction result. oneOf: - $ref: "#/components/schemas/LLMObsTraceInteractionResponseItem" - $ref: "#/components/schemas/LLMObsDisplayBlockInteractionResponseItem" + - $ref: "#/components/schemas/LLMObsFrontendInteractionResponseItem" LLMObsAnnotationQueueInteractionsDataAttributesRequest: description: Attributes for adding interactions to an annotation queue. properties: @@ -56915,6 +56915,7 @@ components: - experiment_trace - session - display_block + - frontend example: trace type: string x-enum-varnames: @@ -56922,6 +56923,7 @@ components: - EXPERIMENT_TRACE - SESSION - DISPLAY_BLOCK + - FRONTEND LLMObsAzureOpenAIMetadata: description: Azure OpenAI-specific metadata for an integration account or inference request. properties: @@ -58619,7 +58621,7 @@ components: annotations: description: List of annotations for this interaction. items: - $ref: "#/components/schemas/LLMObsAnnotationItem" + $ref: "#/components/schemas/LLMObsAnnotationItemResponse" type: array can_annotate: description: Whether the current caller can annotate this interaction. @@ -59900,6 +59902,96 @@ components: required: - data type: object + LLMObsFrontendAnnotatedInteractionItem: + description: A frontend interaction with its associated annotations. + properties: + annotations: + description: List of annotations for this interaction. + items: + $ref: "#/components/schemas/LLMObsAnnotationItemResponse" + type: array + can_annotate: + description: Whether the current caller can annotate this interaction. + example: true + type: boolean + content_id: + description: Server-generated deterministic identifier derived from the content. + example: "9a87f3e2b1d4c5a6f8b3e2d1c4a7b5f6e3d2a1c4b7e5f8a3d6c2e1b4a7d5f8c2" + type: string + frontend: + $ref: "#/components/schemas/LLMObsFrontendContent" + id: + description: Unique identifier of the interaction. + example: "interaction-456" + type: string + type: + $ref: "#/components/schemas/LLMObsFrontendInteractionType" + required: + - id + - type + - content_id + - can_annotate + - annotations + - frontend + type: object + LLMObsFrontendContent: + description: Web content that makes up a `frontend` interaction. + properties: + code: + description: Caller-provided web content. + example: "
Hello world
" + type: string + required: + - code + type: object + LLMObsFrontendInteractionItem: + description: |- + An interaction whose rendered content is supplied directly as web + content. The server generates `content_id` deterministically from the + content. + properties: + frontend: + $ref: "#/components/schemas/LLMObsFrontendContent" + type: + $ref: "#/components/schemas/LLMObsFrontendInteractionType" + required: + - type + - frontend + type: object + LLMObsFrontendInteractionResponseItem: + description: A frontend interaction result. + properties: + already_existed: + description: Whether this interaction already existed in the queue. + example: false + type: boolean + content_id: + description: Server-generated deterministic identifier derived from the content. + example: "9a87f3e2b1d4c5a6f8b3e2d1c4a7b5f6e3d2a1c4b7e5f8a3d6c2e1b4a7d5f8c2" + type: string + frontend: + $ref: "#/components/schemas/LLMObsFrontendContent" + id: + description: Unique identifier of the interaction. + example: "00000000-0000-0000-0000-000000000000" + type: string + type: + $ref: "#/components/schemas/LLMObsFrontendInteractionType" + required: + - id + - type + - content_id + - already_existed + - frontend + type: object + LLMObsFrontendInteractionType: + description: Type discriminator for a `frontend` interaction. + enum: + - frontend + example: frontend + type: string + x-enum-varnames: + - FRONTEND LLMObsInferenceCode: description: A generated code snippet for running an inference request programmatically. properties: @@ -62630,7 +62722,7 @@ components: annotations: description: List of annotations for this interaction. items: - $ref: "#/components/schemas/LLMObsAnnotationItem" + $ref: "#/components/schemas/LLMObsAnnotationItemResponse" type: array can_annotate: description: Whether the current caller can annotate this interaction. @@ -166054,6 +166146,70 @@ 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 a single interaction (trace, session, display block, or frontend content) and its annotations for a given annotation queue. + operationId: GetLLMObsAnnotatedInteraction + parameters: + - $ref: "#/components/parameters/LLMObsAnnotationQueueIDPathParameter" + - $ref: "#/components/parameters/LLMObsAnnotationQueueInteractionIDPathParameter" + 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 + id: 00000000-0000-0000-0000-000000000001 + 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-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: |- @@ -166263,6 +166419,9 @@ paths: - `display_block`: omit `content_id` and provide the rendered content in `display_block`. The server generates `content_id` as a deterministic hash of the block list. + - `frontend`: omit `content_id` and provide the web content in + `frontend`. The server returns a deterministic `content_id` for the + content. Items of different types can be mixed in a single request. operationId: CreateLLMObsAnnotationQueueInteractions @@ -166298,6 +166457,16 @@ paths: type: json type: display_block type: interactions + frontend: + summary: Add a frontend interaction + value: + data: + attributes: + interactions: + - frontend: + code: "
Hello world
" + type: frontend + type: interactions schema: $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionsRequest" description: Add interactions payload. @@ -166333,6 +166502,20 @@ paths: type: display_block id: 00000000-0000-0000-0000-000000000001 type: interactions + frontend: + summary: frontend response + value: + data: + attributes: + interactions: + - already_existed: false + content_id: 9a87f3e2b1d4c5a6f8b3e2d1c4a7b5f6e3d2a1c4b7e5f8a3d6c2e1b4a7d5f8c2 + frontend: + code: "
Hello world
" + id: 00000000-0000-0000-0000-000000000000 + type: frontend + id: 00000000-0000-0000-0000-000000000001 + type: interactions schema: $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionsResponse" description: Created 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/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 7c1e1cc136..fc665a8efd 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..a69983f550 100644 --- a/src/datadog_api_client/v2/api/agent_observability_api.py +++ b/src/datadog_api_client/v2/api/agent_observability_api.py @@ -24,6 +24,7 @@ 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_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 +742,35 @@ 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", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._get_llm_obs_annotated_interactions_endpoint = _Endpoint( settings={ "response_type": (LLMObsAnnotatedInteractionsResponse,), @@ -2277,6 +2307,9 @@ def create_llm_obs_annotation_queue_interactions( * ``display_block`` : omit ``content_id`` and provide the rendered content in ``display_block``. The server generates ``content_id`` as a deterministic hash of the block list. + * ``frontend`` : omit ``content_id`` and provide the web content in + ``frontend``. The server returns a deterministic ``content_id`` for the + content. Items of different types can be mixed in a single request. @@ -2694,6 +2727,28 @@ 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, + ) -> LLMObsAnnotatedInteractionResponse: + """Get an annotated queue interaction. + + Retrieve a single interaction (trace, session, display block, or frontend content) and its annotations for a given 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 within the annotation queue. + :type interaction_id: str + :rtype: LLMObsAnnotatedInteractionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["queue_id"] = queue_id + + kwargs["interaction_id"] = interaction_id + + return self._get_llm_obs_annotated_interaction_endpoint.call_with_http_info(**kwargs) + def get_llm_obs_annotated_interactions( self, queue_id: str, diff --git a/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_by_trace_item.py b/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_by_trace_item.py index 56801353e9..101889095f 100644 --- a/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_by_trace_item.py +++ b/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_by_trace_item.py @@ -15,8 +15,9 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.llm_obs_annotation_item import LLMObsAnnotationItem + from datadog_api_client.v2.model.llm_obs_annotation_item_response import LLMObsAnnotationItemResponse from datadog_api_client.v2.model.llm_obs_content_block import LLMObsContentBlock + from datadog_api_client.v2.model.llm_obs_frontend_content import LLMObsFrontendContent from datadog_api_client.v2.model.llm_obs_any_interaction_type import LLMObsAnyInteractionType @@ -29,16 +30,18 @@ class LLMObsAnnotatedInteractionByTraceItem(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.llm_obs_annotation_item import LLMObsAnnotationItem + from datadog_api_client.v2.model.llm_obs_annotation_item_response import LLMObsAnnotationItemResponse from datadog_api_client.v2.model.llm_obs_content_block import LLMObsContentBlock + from datadog_api_client.v2.model.llm_obs_frontend_content import LLMObsFrontendContent from datadog_api_client.v2.model.llm_obs_any_interaction_type import LLMObsAnyInteractionType return { - "annotations": ([LLMObsAnnotationItem],), + "annotations": ([LLMObsAnnotationItemResponse],), "can_annotate": (bool,), "content_id": (str,), "created_at": (datetime,), "display_block": ([LLMObsContentBlock],), + "frontend": (LLMObsFrontendContent,), "id": (str,), "modified_at": (datetime,), "queue_id": (str,), @@ -52,6 +55,7 @@ def openapi_types(_): "content_id": "content_id", "created_at": "created_at", "display_block": "display_block", + "frontend": "frontend", "id": "id", "modified_at": "modified_at", "queue_id": "queue_id", @@ -61,7 +65,7 @@ def openapi_types(_): def __init__( self_, - annotations: List[LLMObsAnnotationItem], + annotations: List[LLMObsAnnotationItemResponse], can_annotate: bool, content_id: str, created_at: datetime, @@ -71,18 +75,19 @@ def __init__( queue_name: str, type: LLMObsAnyInteractionType, display_block: Union[List[LLMObsContentBlock], UnsetType] = unset, + frontend: Union[LLMObsFrontendContent, UnsetType] = unset, **kwargs, ): """ An annotated interaction returned by the cross-queue lookup, including the source queue metadata. :param annotations: List of annotations for this interaction. - :type annotations: [LLMObsAnnotationItem] + :type annotations: [LLMObsAnnotationItemResponse] :param can_annotate: Whether the current caller can annotate this interaction. :type can_annotate: bool - :param content_id: Upstream entity identifier (trace ID, session ID, or deterministic display_block ID). + :param content_id: Upstream entity identifier (trace ID, session ID, or deterministic display_block or frontend ID). :type content_id: str :param created_at: Timestamp when the interaction was added to the queue. @@ -92,6 +97,9 @@ def __init__( Must contain at least one block. :type display_block: [LLMObsContentBlock], optional + :param frontend: Web content that makes up a ``frontend`` interaction. + :type frontend: LLMObsFrontendContent, optional + :param id: Unique identifier of the interaction. :type id: str @@ -109,6 +117,8 @@ def __init__( """ if display_block is not unset: kwargs["display_block"] = display_block + if frontend is not unset: + kwargs["frontend"] = frontend super().__init__(kwargs) self_.annotations = annotations 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..80bfdcf35d --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_data_attributes_response.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 Union, 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_item import LLMObsAnnotatedInteractionItem + 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, + ) + from datadog_api_client.v2.model.llm_obs_frontend_annotated_interaction_item import ( + LLMObsFrontendAnnotatedInteractionItem, + ) + + +class LLMObsAnnotatedInteractionDataAttributesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_annotated_interaction_item import LLMObsAnnotatedInteractionItem + + return { + "annotated_interaction": (LLMObsAnnotatedInteractionItem,), + } + + attribute_map = { + "annotated_interaction": "annotated_interaction", + } + + def __init__( + self_, + annotated_interaction: Union[ + LLMObsAnnotatedInteractionItem, + LLMObsTraceAnnotatedInteractionItem, + LLMObsDisplayBlockAnnotatedInteractionItem, + LLMObsFrontendAnnotatedInteractionItem, + ], + **kwargs, + ): + """ + Attributes containing the annotated interaction. + + :param annotated_interaction: An interaction with its associated annotations. + :type annotated_interaction: LLMObsAnnotatedInteractionItem + """ + super().__init__(kwargs) + + self_.annotated_interaction = annotated_interaction 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..360c2f3987 --- /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 the annotated interaction. + :type attributes: LLMObsAnnotatedInteractionDataAttributesResponse + + :param id: The annotation queue ID. + :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_item.py b/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_item.py index bbdf73ba35..32754e9310 100644 --- a/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_item.py +++ b/src/datadog_api_client/v2/model/llm_obs_annotated_interaction_item.py @@ -16,7 +16,7 @@ def __init__(self, **kwargs): An interaction with its associated annotations. :param annotations: List of annotations for this interaction. - :type annotations: [LLMObsAnnotationItem] + :type annotations: [LLMObsAnnotationItemResponse] :param can_annotate: Whether the current caller can annotate this interaction. :type can_annotate: bool @@ -39,6 +39,9 @@ def __init__(self, **kwargs): :param display_block: List of content blocks that make up a `display_block` interaction. Must contain at least one block. :type display_block: [LLMObsContentBlock] + + :param frontend: Web content that makes up a `frontend` interaction. + :type frontend: LLMObsFrontendContent """ super().__init__(kwargs) @@ -57,10 +60,14 @@ def _composed_schemas(_): from datadog_api_client.v2.model.llm_obs_display_block_annotated_interaction_item import ( LLMObsDisplayBlockAnnotatedInteractionItem, ) + from datadog_api_client.v2.model.llm_obs_frontend_annotated_interaction_item import ( + LLMObsFrontendAnnotatedInteractionItem, + ) return { "oneOf": [ LLMObsTraceAnnotatedInteractionItem, LLMObsDisplayBlockAnnotatedInteractionItem, + LLMObsFrontendAnnotatedInteractionItem, ], } 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..59d1ccd9b3 --- /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. + + :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/model/llm_obs_annotated_interactions_data_attributes_response.py b/src/datadog_api_client/v2/model/llm_obs_annotated_interactions_data_attributes_response.py index 5718c2519e..070797030a 100644 --- a/src/datadog_api_client/v2/model/llm_obs_annotated_interactions_data_attributes_response.py +++ b/src/datadog_api_client/v2/model/llm_obs_annotated_interactions_data_attributes_response.py @@ -17,6 +17,9 @@ from datadog_api_client.v2.model.llm_obs_display_block_annotated_interaction_item import ( LLMObsDisplayBlockAnnotatedInteractionItem, ) + from datadog_api_client.v2.model.llm_obs_frontend_annotated_interaction_item import ( + LLMObsFrontendAnnotatedInteractionItem, + ) class LLMObsAnnotatedInteractionsDataAttributesResponse(ModelNormal): @@ -39,6 +42,7 @@ def __init__( LLMObsAnnotatedInteractionItem, LLMObsTraceAnnotatedInteractionItem, LLMObsDisplayBlockAnnotatedInteractionItem, + LLMObsFrontendAnnotatedInteractionItem, ] ], **kwargs, diff --git a/src/datadog_api_client/v2/model/llm_obs_annotation_item.py b/src/datadog_api_client/v2/model/llm_obs_annotation_item.py deleted file mode 100644 index dd9408f296..0000000000 --- a/src/datadog_api_client/v2/model/llm_obs_annotation_item.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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 Any, Dict - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, - date, - datetime, - none_type, - UUID, -) - - -class LLMObsAnnotationItem(ModelNormal): - @cached_property - def openapi_types(_): - return { - "created_at": (datetime,), - "created_by": (str,), - "id": (str,), - "interaction_id": (str,), - "label_values": ( - { - str: ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - UUID, - none_type, - ) - }, - ), - "modified_at": (datetime,), - "modified_by": (str,), - } - - attribute_map = { - "created_at": "created_at", - "created_by": "created_by", - "id": "id", - "interaction_id": "interaction_id", - "label_values": "label_values", - "modified_at": "modified_at", - "modified_by": "modified_by", - } - - def __init__( - self_, - created_at: datetime, - created_by: str, - id: str, - interaction_id: str, - label_values: Dict[str, Any], - modified_at: datetime, - modified_by: str, - **kwargs, - ): - """ - A single annotation on an interaction. - - :param created_at: Timestamp when the annotation was created. - :type created_at: datetime - - :param created_by: Identifier of the user who created the annotation. - :type created_by: str - - :param id: Unique identifier of the annotation. - :type id: str - - :param interaction_id: Identifier of the interaction this annotation belongs to. - :type interaction_id: str - - :param label_values: Label values for this annotation. - :type label_values: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)} - - :param modified_at: Timestamp when the annotation was last modified. - :type modified_at: datetime - - :param modified_by: Identifier of the user who last modified the annotation. - :type modified_by: str - """ - super().__init__(kwargs) - - self_.created_at = created_at - self_.created_by = created_by - self_.id = id - self_.interaction_id = interaction_id - self_.label_values = label_values - self_.modified_at = modified_at - self_.modified_by = modified_by diff --git a/src/datadog_api_client/v2/model/llm_obs_annotation_queue_interaction_item.py b/src/datadog_api_client/v2/model/llm_obs_annotation_queue_interaction_item.py index 7ef54bf709..94948b8a23 100644 --- a/src/datadog_api_client/v2/model/llm_obs_annotation_queue_interaction_item.py +++ b/src/datadog_api_client/v2/model/llm_obs_annotation_queue_interaction_item.py @@ -24,6 +24,9 @@ def __init__(self, **kwargs): :param display_block: List of content blocks that make up a `display_block` interaction. Must contain at least one block. :type display_block: [LLMObsContentBlock] + + :param frontend: Web content that makes up a `frontend` interaction. + :type frontend: LLMObsFrontendContent """ super().__init__(kwargs) @@ -38,10 +41,12 @@ def _composed_schemas(_): # loading from datadog_api_client.v2.model.llm_obs_trace_interaction_item import LLMObsTraceInteractionItem from datadog_api_client.v2.model.llm_obs_display_block_interaction_item import LLMObsDisplayBlockInteractionItem + from datadog_api_client.v2.model.llm_obs_frontend_interaction_item import LLMObsFrontendInteractionItem return { "oneOf": [ LLMObsTraceInteractionItem, LLMObsDisplayBlockInteractionItem, + LLMObsFrontendInteractionItem, ], } diff --git a/src/datadog_api_client/v2/model/llm_obs_annotation_queue_interaction_response_item.py b/src/datadog_api_client/v2/model/llm_obs_annotation_queue_interaction_response_item.py index ce5d246f31..7a4068fb38 100644 --- a/src/datadog_api_client/v2/model/llm_obs_annotation_queue_interaction_response_item.py +++ b/src/datadog_api_client/v2/model/llm_obs_annotation_queue_interaction_response_item.py @@ -36,6 +36,9 @@ def __init__(self, **kwargs): :param display_block: List of content blocks that make up a `display_block` interaction. Must contain at least one block. :type display_block: [LLMObsContentBlock] + + :param frontend: Web content that makes up a `frontend` interaction. + :type frontend: LLMObsFrontendContent """ super().__init__(kwargs) @@ -54,10 +57,14 @@ def _composed_schemas(_): from datadog_api_client.v2.model.llm_obs_display_block_interaction_response_item import ( LLMObsDisplayBlockInteractionResponseItem, ) + from datadog_api_client.v2.model.llm_obs_frontend_interaction_response_item import ( + LLMObsFrontendInteractionResponseItem, + ) return { "oneOf": [ LLMObsTraceInteractionResponseItem, LLMObsDisplayBlockInteractionResponseItem, + LLMObsFrontendInteractionResponseItem, ], } diff --git a/src/datadog_api_client/v2/model/llm_obs_annotation_queue_interactions_data_attributes_request.py b/src/datadog_api_client/v2/model/llm_obs_annotation_queue_interactions_data_attributes_request.py index 49c7b1be91..295ab6fcb3 100644 --- a/src/datadog_api_client/v2/model/llm_obs_annotation_queue_interactions_data_attributes_request.py +++ b/src/datadog_api_client/v2/model/llm_obs_annotation_queue_interactions_data_attributes_request.py @@ -17,6 +17,7 @@ ) from datadog_api_client.v2.model.llm_obs_trace_interaction_item import LLMObsTraceInteractionItem from datadog_api_client.v2.model.llm_obs_display_block_interaction_item import LLMObsDisplayBlockInteractionItem + from datadog_api_client.v2.model.llm_obs_frontend_interaction_item import LLMObsFrontendInteractionItem class LLMObsAnnotationQueueInteractionsDataAttributesRequest(ModelNormal): @@ -43,7 +44,12 @@ def openapi_types(_): def __init__( self_, interactions: List[ - Union[LLMObsAnnotationQueueInteractionItem, LLMObsTraceInteractionItem, LLMObsDisplayBlockInteractionItem] + Union[ + LLMObsAnnotationQueueInteractionItem, + LLMObsTraceInteractionItem, + LLMObsDisplayBlockInteractionItem, + LLMObsFrontendInteractionItem, + ] ], **kwargs, ): diff --git a/src/datadog_api_client/v2/model/llm_obs_annotation_queue_interactions_data_attributes_response.py b/src/datadog_api_client/v2/model/llm_obs_annotation_queue_interactions_data_attributes_response.py index 97d7713cca..d336768636 100644 --- a/src/datadog_api_client/v2/model/llm_obs_annotation_queue_interactions_data_attributes_response.py +++ b/src/datadog_api_client/v2/model/llm_obs_annotation_queue_interactions_data_attributes_response.py @@ -19,6 +19,9 @@ from datadog_api_client.v2.model.llm_obs_display_block_interaction_response_item import ( LLMObsDisplayBlockInteractionResponseItem, ) + from datadog_api_client.v2.model.llm_obs_frontend_interaction_response_item import ( + LLMObsFrontendInteractionResponseItem, + ) class LLMObsAnnotationQueueInteractionsDataAttributesResponse(ModelNormal): @@ -43,6 +46,7 @@ def __init__( LLMObsAnnotationQueueInteractionResponseItem, LLMObsTraceInteractionResponseItem, LLMObsDisplayBlockInteractionResponseItem, + LLMObsFrontendInteractionResponseItem, ] ], **kwargs, diff --git a/src/datadog_api_client/v2/model/llm_obs_any_interaction_type.py b/src/datadog_api_client/v2/model/llm_obs_any_interaction_type.py index 12f010a070..5b5ac2aaff 100644 --- a/src/datadog_api_client/v2/model/llm_obs_any_interaction_type.py +++ b/src/datadog_api_client/v2/model/llm_obs_any_interaction_type.py @@ -16,7 +16,7 @@ class LLMObsAnyInteractionType(ModelSimple): """ Type of an annotated interaction. - :param value: Must be one of ["trace", "experiment_trace", "session", "display_block"]. + :param value: Must be one of ["trace", "experiment_trace", "session", "display_block", "frontend"]. :type value: str """ @@ -25,11 +25,13 @@ class LLMObsAnyInteractionType(ModelSimple): "experiment_trace", "session", "display_block", + "frontend", } TRACE: ClassVar["LLMObsAnyInteractionType"] EXPERIMENT_TRACE: ClassVar["LLMObsAnyInteractionType"] SESSION: ClassVar["LLMObsAnyInteractionType"] DISPLAY_BLOCK: ClassVar["LLMObsAnyInteractionType"] + FRONTEND: ClassVar["LLMObsAnyInteractionType"] @cached_property def openapi_types(_): @@ -42,3 +44,4 @@ def openapi_types(_): LLMObsAnyInteractionType.EXPERIMENT_TRACE = LLMObsAnyInteractionType("experiment_trace") LLMObsAnyInteractionType.SESSION = LLMObsAnyInteractionType("session") LLMObsAnyInteractionType.DISPLAY_BLOCK = LLMObsAnyInteractionType("display_block") +LLMObsAnyInteractionType.FRONTEND = LLMObsAnyInteractionType("frontend") diff --git a/src/datadog_api_client/v2/model/llm_obs_display_block_annotated_interaction_item.py b/src/datadog_api_client/v2/model/llm_obs_display_block_annotated_interaction_item.py index 0eb8a65c98..e09e98661e 100644 --- a/src/datadog_api_client/v2/model/llm_obs_display_block_annotated_interaction_item.py +++ b/src/datadog_api_client/v2/model/llm_obs_display_block_annotated_interaction_item.py @@ -12,7 +12,7 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.llm_obs_annotation_item import LLMObsAnnotationItem + from datadog_api_client.v2.model.llm_obs_annotation_item_response import LLMObsAnnotationItemResponse from datadog_api_client.v2.model.llm_obs_content_block import LLMObsContentBlock from datadog_api_client.v2.model.llm_obs_display_block_interaction_type import LLMObsDisplayBlockInteractionType @@ -26,12 +26,12 @@ class LLMObsDisplayBlockAnnotatedInteractionItem(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.llm_obs_annotation_item import LLMObsAnnotationItem + from datadog_api_client.v2.model.llm_obs_annotation_item_response import LLMObsAnnotationItemResponse from datadog_api_client.v2.model.llm_obs_content_block import LLMObsContentBlock from datadog_api_client.v2.model.llm_obs_display_block_interaction_type import LLMObsDisplayBlockInteractionType return { - "annotations": ([LLMObsAnnotationItem],), + "annotations": ([LLMObsAnnotationItemResponse],), "can_annotate": (bool,), "content_id": (str,), "display_block": ([LLMObsContentBlock],), @@ -50,7 +50,7 @@ def openapi_types(_): def __init__( self_, - annotations: List[LLMObsAnnotationItem], + annotations: List[LLMObsAnnotationItemResponse], can_annotate: bool, content_id: str, display_block: List[LLMObsContentBlock], @@ -62,7 +62,7 @@ def __init__( A display_block interaction with its associated annotations. :param annotations: List of annotations for this interaction. - :type annotations: [LLMObsAnnotationItem] + :type annotations: [LLMObsAnnotationItemResponse] :param can_annotate: Whether the current caller can annotate this interaction. :type can_annotate: bool diff --git a/src/datadog_api_client/v2/model/llm_obs_frontend_annotated_interaction_item.py b/src/datadog_api_client/v2/model/llm_obs_frontend_annotated_interaction_item.py new file mode 100644 index 0000000000..0809a66eca --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_frontend_annotated_interaction_item.py @@ -0,0 +1,83 @@ +# 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, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.llm_obs_annotation_item_response import LLMObsAnnotationItemResponse + from datadog_api_client.v2.model.llm_obs_frontend_content import LLMObsFrontendContent + from datadog_api_client.v2.model.llm_obs_frontend_interaction_type import LLMObsFrontendInteractionType + + +class LLMObsFrontendAnnotatedInteractionItem(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_annotation_item_response import LLMObsAnnotationItemResponse + from datadog_api_client.v2.model.llm_obs_frontend_content import LLMObsFrontendContent + from datadog_api_client.v2.model.llm_obs_frontend_interaction_type import LLMObsFrontendInteractionType + + return { + "annotations": ([LLMObsAnnotationItemResponse],), + "can_annotate": (bool,), + "content_id": (str,), + "frontend": (LLMObsFrontendContent,), + "id": (str,), + "type": (LLMObsFrontendInteractionType,), + } + + attribute_map = { + "annotations": "annotations", + "can_annotate": "can_annotate", + "content_id": "content_id", + "frontend": "frontend", + "id": "id", + "type": "type", + } + + def __init__( + self_, + annotations: List[LLMObsAnnotationItemResponse], + can_annotate: bool, + content_id: str, + frontend: LLMObsFrontendContent, + id: str, + type: LLMObsFrontendInteractionType, + **kwargs, + ): + """ + A frontend interaction with its associated annotations. + + :param annotations: List of annotations for this interaction. + :type annotations: [LLMObsAnnotationItemResponse] + + :param can_annotate: Whether the current caller can annotate this interaction. + :type can_annotate: bool + + :param content_id: Server-generated deterministic identifier derived from the content. + :type content_id: str + + :param frontend: Web content that makes up a ``frontend`` interaction. + :type frontend: LLMObsFrontendContent + + :param id: Unique identifier of the interaction. + :type id: str + + :param type: Type discriminator for a ``frontend`` interaction. + :type type: LLMObsFrontendInteractionType + """ + super().__init__(kwargs) + + self_.annotations = annotations + self_.can_annotate = can_annotate + self_.content_id = content_id + self_.frontend = frontend + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/llm_obs_frontend_content.py b/src/datadog_api_client/v2/model/llm_obs_frontend_content.py new file mode 100644 index 0000000000..bb1c5001c2 --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_frontend_content.py @@ -0,0 +1,33 @@ +# 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, +) + + +class LLMObsFrontendContent(ModelNormal): + @cached_property + def openapi_types(_): + return { + "code": (str,), + } + + attribute_map = { + "code": "code", + } + + def __init__(self_, code: str, **kwargs): + """ + Web content that makes up a ``frontend`` interaction. + + :param code: Caller-provided web content. + :type code: str + """ + super().__init__(kwargs) + + self_.code = code diff --git a/src/datadog_api_client/v2/model/llm_obs_frontend_interaction_item.py b/src/datadog_api_client/v2/model/llm_obs_frontend_interaction_item.py new file mode 100644 index 0000000000..2261eac84d --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_frontend_interaction_item.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_frontend_content import LLMObsFrontendContent + from datadog_api_client.v2.model.llm_obs_frontend_interaction_type import LLMObsFrontendInteractionType + + +class LLMObsFrontendInteractionItem(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_frontend_content import LLMObsFrontendContent + from datadog_api_client.v2.model.llm_obs_frontend_interaction_type import LLMObsFrontendInteractionType + + return { + "frontend": (LLMObsFrontendContent,), + "type": (LLMObsFrontendInteractionType,), + } + + attribute_map = { + "frontend": "frontend", + "type": "type", + } + + def __init__(self_, frontend: LLMObsFrontendContent, type: LLMObsFrontendInteractionType, **kwargs): + """ + An interaction whose rendered content is supplied directly as web + content. The server generates ``content_id`` deterministically from the + content. + + :param frontend: Web content that makes up a ``frontend`` interaction. + :type frontend: LLMObsFrontendContent + + :param type: Type discriminator for a ``frontend`` interaction. + :type type: LLMObsFrontendInteractionType + """ + super().__init__(kwargs) + + self_.frontend = frontend + self_.type = type diff --git a/src/datadog_api_client/v2/model/llm_obs_frontend_interaction_response_item.py b/src/datadog_api_client/v2/model/llm_obs_frontend_interaction_response_item.py new file mode 100644 index 0000000000..82544f7cff --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_frontend_interaction_response_item.py @@ -0,0 +1,74 @@ +# 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_frontend_content import LLMObsFrontendContent + from datadog_api_client.v2.model.llm_obs_frontend_interaction_type import LLMObsFrontendInteractionType + + +class LLMObsFrontendInteractionResponseItem(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.llm_obs_frontend_content import LLMObsFrontendContent + from datadog_api_client.v2.model.llm_obs_frontend_interaction_type import LLMObsFrontendInteractionType + + return { + "already_existed": (bool,), + "content_id": (str,), + "frontend": (LLMObsFrontendContent,), + "id": (str,), + "type": (LLMObsFrontendInteractionType,), + } + + attribute_map = { + "already_existed": "already_existed", + "content_id": "content_id", + "frontend": "frontend", + "id": "id", + "type": "type", + } + + def __init__( + self_, + already_existed: bool, + content_id: str, + frontend: LLMObsFrontendContent, + id: str, + type: LLMObsFrontendInteractionType, + **kwargs, + ): + """ + A frontend interaction result. + + :param already_existed: Whether this interaction already existed in the queue. + :type already_existed: bool + + :param content_id: Server-generated deterministic identifier derived from the content. + :type content_id: str + + :param frontend: Web content that makes up a ``frontend`` interaction. + :type frontend: LLMObsFrontendContent + + :param id: Unique identifier of the interaction. + :type id: str + + :param type: Type discriminator for a ``frontend`` interaction. + :type type: LLMObsFrontendInteractionType + """ + super().__init__(kwargs) + + self_.already_existed = already_existed + self_.content_id = content_id + self_.frontend = frontend + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/llm_obs_frontend_interaction_type.py b/src/datadog_api_client/v2/model/llm_obs_frontend_interaction_type.py new file mode 100644 index 0000000000..58be50f68c --- /dev/null +++ b/src/datadog_api_client/v2/model/llm_obs_frontend_interaction_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 LLMObsFrontendInteractionType(ModelSimple): + """ + Type discriminator for a `frontend` interaction. + + :param value: If omitted defaults to "frontend". Must be one of ["frontend"]. + :type value: str + """ + + allowed_values = { + "frontend", + } + FRONTEND: ClassVar["LLMObsFrontendInteractionType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +LLMObsFrontendInteractionType.FRONTEND = LLMObsFrontendInteractionType("frontend") diff --git a/src/datadog_api_client/v2/model/llm_obs_trace_annotated_interaction_item.py b/src/datadog_api_client/v2/model/llm_obs_trace_annotated_interaction_item.py index da96e519af..65b0642e0c 100644 --- a/src/datadog_api_client/v2/model/llm_obs_trace_annotated_interaction_item.py +++ b/src/datadog_api_client/v2/model/llm_obs_trace_annotated_interaction_item.py @@ -13,18 +13,18 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.llm_obs_annotation_item import LLMObsAnnotationItem + from datadog_api_client.v2.model.llm_obs_annotation_item_response import LLMObsAnnotationItemResponse from datadog_api_client.v2.model.llm_obs_trace_interaction_type import LLMObsTraceInteractionType class LLMObsTraceAnnotatedInteractionItem(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.llm_obs_annotation_item import LLMObsAnnotationItem + from datadog_api_client.v2.model.llm_obs_annotation_item_response import LLMObsAnnotationItemResponse from datadog_api_client.v2.model.llm_obs_trace_interaction_type import LLMObsTraceInteractionType return { - "annotations": ([LLMObsAnnotationItem],), + "annotations": ([LLMObsAnnotationItemResponse],), "can_annotate": (bool,), "content_id": (str,), "created_at": (datetime,), @@ -45,7 +45,7 @@ def openapi_types(_): def __init__( self_, - annotations: List[LLMObsAnnotationItem], + annotations: List[LLMObsAnnotationItemResponse], can_annotate: bool, content_id: str, created_at: datetime, @@ -58,7 +58,7 @@ def __init__( A trace, experiment trace, or session interaction with its associated annotations. :param annotations: List of annotations for this interaction. - :type annotations: [LLMObsAnnotationItem] + :type annotations: [LLMObsAnnotationItemResponse] :param can_annotate: Whether the current caller can annotate this interaction. :type can_annotate: bool diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index ba4fdd992c..35137998a3 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -4458,7 +4458,14 @@ 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_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, ) @@ -4482,7 +4489,6 @@ from datadog_api_client.v2.model.llm_obs_annotation_assessment import LLMObsAnnotationAssessment from datadog_api_client.v2.model.llm_obs_annotation_error import LLMObsAnnotationError from datadog_api_client.v2.model.llm_obs_annotation_error_code import LLMObsAnnotationErrorCode -from datadog_api_client.v2.model.llm_obs_annotation_item import LLMObsAnnotationItem from datadog_api_client.v2.model.llm_obs_annotation_item_response import LLMObsAnnotationItemResponse from datadog_api_client.v2.model.llm_obs_annotation_label_value import LLMObsAnnotationLabelValue from datadog_api_client.v2.model.llm_obs_annotation_label_value_response import LLMObsAnnotationLabelValueResponse @@ -4844,6 +4850,13 @@ ) from datadog_api_client.v2.model.llm_obs_experimentation_type import LLMObsExperimentationType from datadog_api_client.v2.model.llm_obs_experiments_response import LLMObsExperimentsResponse +from datadog_api_client.v2.model.llm_obs_frontend_annotated_interaction_item import ( + LLMObsFrontendAnnotatedInteractionItem, +) +from datadog_api_client.v2.model.llm_obs_frontend_content import LLMObsFrontendContent +from datadog_api_client.v2.model.llm_obs_frontend_interaction_item import LLMObsFrontendInteractionItem +from datadog_api_client.v2.model.llm_obs_frontend_interaction_response_item import LLMObsFrontendInteractionResponseItem +from datadog_api_client.v2.model.llm_obs_frontend_interaction_type import LLMObsFrontendInteractionType from datadog_api_client.v2.model.llm_obs_inference_code import LLMObsInferenceCode from datadog_api_client.v2.model.llm_obs_inference_content import LLMObsInferenceContent from datadog_api_client.v2.model.llm_obs_inference_content_value import LLMObsInferenceContentValue @@ -14608,7 +14621,10 @@ "KindObj", "KindResponseMeta", "LLMObsAnnotatedInteractionByTraceItem", + "LLMObsAnnotatedInteractionDataAttributesResponse", + "LLMObsAnnotatedInteractionDataResponse", "LLMObsAnnotatedInteractionItem", + "LLMObsAnnotatedInteractionResponse", "LLMObsAnnotatedInteractionsByTraceDataAttributesResponse", "LLMObsAnnotatedInteractionsByTraceDataResponse", "LLMObsAnnotatedInteractionsByTraceResponse", @@ -14620,7 +14636,6 @@ "LLMObsAnnotationAssessment", "LLMObsAnnotationError", "LLMObsAnnotationErrorCode", - "LLMObsAnnotationItem", "LLMObsAnnotationItemResponse", "LLMObsAnnotationLabelValue", "LLMObsAnnotationLabelValueResponse", @@ -14844,6 +14859,11 @@ "LLMObsExperimentationSortFieldDirection", "LLMObsExperimentationType", "LLMObsExperimentsResponse", + "LLMObsFrontendAnnotatedInteractionItem", + "LLMObsFrontendContent", + "LLMObsFrontendInteractionItem", + "LLMObsFrontendInteractionResponseItem", + "LLMObsFrontendInteractionType", "LLMObsInferenceCode", "LLMObsInferenceContent", "LLMObsInferenceContentValue", diff --git a/tests/generated-test/test-server b/tests/generated-test/test-server index 899230cbcc..a7224b2c64 100755 --- a/tests/generated-test/test-server +++ b/tests/generated-test/test-server @@ -16,7 +16,7 @@ import re import tempfile import threading import uuid -from datetime import datetime, timezone +from datetime import UTC, datetime from http import HTTPStatus from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer from pathlib import Path @@ -435,7 +435,8 @@ def _json_contains(actual: Any, expected: Any) -> bool: return all(key in actual and _json_contains(actual[key], value) for key, value in expected.items()) if isinstance(expected, list) and isinstance(actual, list): return len(expected) == len(actual) and all( - _json_contains(actual_item, expected_item) for actual_item, expected_item in zip(actual, expected) + _json_contains(actual_item, expected_item) + for actual_item, expected_item in zip(actual, expected, strict=False) ) return actual == expected @@ -460,7 +461,7 @@ def _slug(value: str) -> str: def _now_iso() -> str: - return datetime.now(timezone.utc).isoformat().replace("+00:00", "Z") + return datetime.now(UTC).isoformat().replace("+00:00", "Z") def _read_json(path: Path) -> dict[str, Any]: diff --git a/tests/v2/features/agent_observability.feature b/tests/v2/features/agent_observability.feature index acf08cf0dd..3136a1312f 100644 --- a/tests/v2/features/agent_observability.feature +++ b/tests/v2/features/agent_observability.feature @@ -782,6 +782,33 @@ 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 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 535ebca0b1..f73a9089c8 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": {