From 2b8fc51f77ccdeb2d7c91ace6e5d776ede8680f0 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 1 Sep 2026 23:28:29 +0000 Subject: [PATCH] Regenerate client from commit f90600e of spec repo --- .generator/schemas/v2/openapi.yaml | 281 ++++++++++++--- .../GetLLMObsAnnotatedInteraction.java | 28 ++ .../com/datadog/api/client/ApiClient.java | 1 + .../client/v2/api/AgentObservabilityApi.java | 195 +++++++++++ ...LLMObsAnnotatedInteractionByTraceItem.java | 54 ++- ...atedInteractionDataAttributesResponse.java | 161 +++++++++ ...LMObsAnnotatedInteractionDataResponse.java | 216 ++++++++++++ .../model/LLMObsAnnotatedInteractionItem.java | 85 ++++- .../LLMObsAnnotatedInteractionResponse.java | 151 ++++++++ .../client/v2/model/LLMObsAnnotationItem.java | 328 ------------------ .../LLMObsAnnotationQueueInteractionItem.java | 78 ++++- ...nnotationQueueInteractionResponseItem.java | 82 ++++- .../v2/model/LLMObsAnyInteractionType.java | 4 +- ...sDisplayBlockAnnotatedInteractionItem.java | 18 +- ...LMObsFrontendAnnotatedInteractionItem.java | 321 +++++++++++++++++ .../v2/model/LLMObsFrontendContent.java | 143 ++++++++ .../model/LLMObsFrontendInteractionItem.java | 188 ++++++++++ ...LLMObsFrontendInteractionResponseItem.java | 270 ++++++++++++++ .../model/LLMObsFrontendInteractionType.java | 56 +++ .../LLMObsTraceAnnotatedInteractionItem.java | 19 +- .../client/v2/api/agent_observability.feature | 27 ++ .../com/datadog/api/client/v2/api/undo.json | 6 + src/test/resources/generated-test/test-server | 7 +- 23 files changed, 2298 insertions(+), 421 deletions(-) create mode 100644 examples/v2/agent-observability/GetLLMObsAnnotatedInteraction.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotatedInteractionDataAttributesResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotatedInteractionDataResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotatedInteractionResponse.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationItem.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/LLMObsFrontendAnnotatedInteractionItem.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/LLMObsFrontendContent.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/LLMObsFrontendInteractionItem.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/LLMObsFrontendInteractionResponseItem.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/LLMObsFrontendInteractionType.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 96018843d06..4b65adabc6a 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.java b/examples/v2/agent-observability/GetLLMObsAnnotatedInteraction.java new file mode 100644 index 00000000000..9db5a278dc4 --- /dev/null +++ b/examples/v2/agent-observability/GetLLMObsAnnotatedInteraction.java @@ -0,0 +1,28 @@ +// Get an annotated queue interaction returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AgentObservabilityApi; +import com.datadog.api.client.v2.model.LLMObsAnnotatedInteractionResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getLLMObsAnnotatedInteraction", true); + AgentObservabilityApi apiInstance = new AgentObservabilityApi(defaultClient); + + try { + LLMObsAnnotatedInteractionResponse result = + apiInstance.getLLMObsAnnotatedInteraction( + "00000000-0000-0000-0000-000000000001", "interaction-456"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling AgentObservabilityApi#getLLMObsAnnotatedInteraction"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 2d9698f1db2..d54466d643b 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -868,6 +868,7 @@ public class ApiClient { put("v2.deleteLLMObsProjects", false); put("v2.deleteLLMObsPrompt", false); put("v2.exportLLMObsDataset", false); + put("v2.getLLMObsAnnotatedInteraction", false); put("v2.getLLMObsAnnotatedInteractions", false); put("v2.getLLMObsAnnotatedInteractionsByTraceIDs", false); put("v2.getLLMObsAnnotationQueueLabelSchema", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/AgentObservabilityApi.java b/src/main/java/com/datadog/api/client/v2/api/AgentObservabilityApi.java index 698682c017c..69e77899e11 100644 --- a/src/main/java/com/datadog/api/client/v2/api/AgentObservabilityApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/AgentObservabilityApi.java @@ -4,6 +4,7 @@ import com.datadog.api.client.ApiException; import com.datadog.api.client.ApiResponse; import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.LLMObsAnnotatedInteractionResponse; import com.datadog.api.client.v2.model.LLMObsAnnotatedInteractionsByTraceResponse; import com.datadog.api.client.v2.model.LLMObsAnnotatedInteractionsResponse; import com.datadog.api.client.v2.model.LLMObsAnnotationQueueInteractionsRequest; @@ -894,6 +895,9 @@ public LLMObsAnnotationQueueInteractionsResponse createLLMObsAnnotationQueueInte *
  • 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. @@ -4401,6 +4405,197 @@ public CompletableFuture> exportLLMObsDatasetWithHttpInfoAsy new GenericType() {}); } + /** + * Get an annotated queue interaction. + * + *

    See {@link #getLLMObsAnnotatedInteractionWithHttpInfo}. + * + * @param queueId The ID of the Agent Observability annotation queue. (required) + * @param interactionId The ID of the interaction within the annotation queue. (required) + * @return LLMObsAnnotatedInteractionResponse + * @throws ApiException if fails to make API call + */ + public LLMObsAnnotatedInteractionResponse getLLMObsAnnotatedInteraction( + String queueId, String interactionId) throws ApiException { + return getLLMObsAnnotatedInteractionWithHttpInfo(queueId, interactionId).getData(); + } + + /** + * Get an annotated queue interaction. + * + *

    See {@link #getLLMObsAnnotatedInteractionWithHttpInfoAsync}. + * + * @param queueId The ID of the Agent Observability annotation queue. (required) + * @param interactionId The ID of the interaction within the annotation queue. (required) + * @return CompletableFuture<LLMObsAnnotatedInteractionResponse> + */ + public CompletableFuture getLLMObsAnnotatedInteractionAsync( + String queueId, String interactionId) { + return getLLMObsAnnotatedInteractionWithHttpInfoAsync(queueId, interactionId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieve a single interaction (trace, session, display block, or frontend content) and its + * annotations for a given annotation queue. + * + * @param queueId The ID of the Agent Observability annotation queue. (required) + * @param interactionId The ID of the interaction within the annotation queue. (required) + * @return ApiResponse<LLMObsAnnotatedInteractionResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
    Response details
    Status Code Description Response Headers
    200 OK -
    400 Bad Request -
    401 Unauthorized -
    403 Forbidden -
    404 Not Found -
    429 Too many requests -
    + */ + public ApiResponse getLLMObsAnnotatedInteractionWithHttpInfo( + String queueId, String interactionId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getLLMObsAnnotatedInteraction"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'queueId' is set + if (queueId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'queueId' when calling getLLMObsAnnotatedInteraction"); + } + + // verify the required parameter 'interactionId' is set + if (interactionId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'interactionId' when calling" + + " getLLMObsAnnotatedInteraction"); + } + // create path and map variables + String localVarPath = + "/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotated-interactions/{interaction_id}" + .replaceAll("\\{" + "queue_id" + "\\}", apiClient.escapeString(queueId.toString())) + .replaceAll( + "\\{" + "interaction_id" + "\\}", apiClient.escapeString(interactionId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AgentObservabilityApi.getLLMObsAnnotatedInteraction", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get an annotated queue interaction. + * + *

    See {@link #getLLMObsAnnotatedInteractionWithHttpInfo}. + * + * @param queueId The ID of the Agent Observability annotation queue. (required) + * @param interactionId The ID of the interaction within the annotation queue. (required) + * @return CompletableFuture<ApiResponse<LLMObsAnnotatedInteractionResponse>> + */ + public CompletableFuture> + getLLMObsAnnotatedInteractionWithHttpInfoAsync(String queueId, String interactionId) { + // Check if unstable operation is enabled + String operationId = "getLLMObsAnnotatedInteraction"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'queueId' is set + if (queueId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'queueId' when calling" + + " getLLMObsAnnotatedInteraction")); + return result; + } + + // verify the required parameter 'interactionId' is set + if (interactionId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'interactionId' when calling" + + " getLLMObsAnnotatedInteraction")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/llm-obs/v1/annotation-queues/{queue_id}/annotated-interactions/{interaction_id}" + .replaceAll("\\{" + "queue_id" + "\\}", apiClient.escapeString(queueId.toString())) + .replaceAll( + "\\{" + "interaction_id" + "\\}", apiClient.escapeString(interactionId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AgentObservabilityApi.getLLMObsAnnotatedInteraction", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Get annotated queue interactions. * diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotatedInteractionByTraceItem.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotatedInteractionByTraceItem.java index 7c7aea80267..47dd1984687 100644 --- a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotatedInteractionByTraceItem.java +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotatedInteractionByTraceItem.java @@ -29,6 +29,7 @@ LLMObsAnnotatedInteractionByTraceItem.JSON_PROPERTY_CONTENT_ID, LLMObsAnnotatedInteractionByTraceItem.JSON_PROPERTY_CREATED_AT, LLMObsAnnotatedInteractionByTraceItem.JSON_PROPERTY_DISPLAY_BLOCK, + LLMObsAnnotatedInteractionByTraceItem.JSON_PROPERTY_FRONTEND, LLMObsAnnotatedInteractionByTraceItem.JSON_PROPERTY_ID, LLMObsAnnotatedInteractionByTraceItem.JSON_PROPERTY_MODIFIED_AT, LLMObsAnnotatedInteractionByTraceItem.JSON_PROPERTY_QUEUE_ID, @@ -40,7 +41,7 @@ public class LLMObsAnnotatedInteractionByTraceItem { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_ANNOTATIONS = "annotations"; - private List annotations = new ArrayList<>(); + private List annotations = new ArrayList<>(); public static final String JSON_PROPERTY_CAN_ANNOTATE = "can_annotate"; private Boolean canAnnotate; @@ -54,6 +55,9 @@ public class LLMObsAnnotatedInteractionByTraceItem { public static final String JSON_PROPERTY_DISPLAY_BLOCK = "display_block"; private List displayBlock = null; + public static final String JSON_PROPERTY_FRONTEND = "frontend"; + private LLMObsFrontendContent frontend; + public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -74,7 +78,7 @@ public LLMObsAnnotatedInteractionByTraceItem() {} @JsonCreator public LLMObsAnnotatedInteractionByTraceItem( @JsonProperty(required = true, value = JSON_PROPERTY_ANNOTATIONS) - List annotations, + List annotations, @JsonProperty(required = true, value = JSON_PROPERTY_CAN_ANNOTATE) Boolean canAnnotate, @JsonProperty(required = true, value = JSON_PROPERTY_CONTENT_ID) String contentId, @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, @@ -84,7 +88,7 @@ public LLMObsAnnotatedInteractionByTraceItem( @JsonProperty(required = true, value = JSON_PROPERTY_QUEUE_NAME) String queueName, @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) LLMObsAnyInteractionType type) { this.annotations = annotations; - for (LLMObsAnnotationItem item : annotations) { + for (LLMObsAnnotationItemResponse item : annotations) { this.unparsed |= item.unparsed; } this.canAnnotate = canAnnotate; @@ -98,16 +102,17 @@ public LLMObsAnnotatedInteractionByTraceItem( this.unparsed |= !type.isValid(); } - public LLMObsAnnotatedInteractionByTraceItem annotations(List annotations) { + public LLMObsAnnotatedInteractionByTraceItem annotations( + List annotations) { this.annotations = annotations; - for (LLMObsAnnotationItem item : annotations) { + for (LLMObsAnnotationItemResponse item : annotations) { this.unparsed |= item.unparsed; } return this; } public LLMObsAnnotatedInteractionByTraceItem addAnnotationsItem( - LLMObsAnnotationItem annotationsItem) { + LLMObsAnnotationItemResponse annotationsItem) { this.annotations.add(annotationsItem); this.unparsed |= annotationsItem.unparsed; return this; @@ -120,14 +125,14 @@ public LLMObsAnnotatedInteractionByTraceItem addAnnotationsItem( */ @JsonProperty(JSON_PROPERTY_ANNOTATIONS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getAnnotations() { + public List getAnnotations() { return annotations; } - public void setAnnotations(List annotations) { + public void setAnnotations(List annotations) { this.annotations = annotations; if (annotations != null) { - for (LLMObsAnnotationItem item : annotations) { + for (LLMObsAnnotationItemResponse item : annotations) { this.unparsed |= item.unparsed; } } @@ -159,7 +164,8 @@ public LLMObsAnnotatedInteractionByTraceItem contentId(String contentId) { } /** - * Upstream entity identifier (trace ID, session ID, or deterministic display_block ID). + * Upstream entity identifier (trace ID, session ID, or deterministic display_block or frontend + * ID). * * @return contentId */ @@ -235,6 +241,31 @@ public void setDisplayBlock(List displayBlock) { } } + public LLMObsAnnotatedInteractionByTraceItem frontend(LLMObsFrontendContent frontend) { + this.frontend = frontend; + this.unparsed |= frontend.unparsed; + return this; + } + + /** + * Web content that makes up a frontend interaction. + * + * @return frontend + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FRONTEND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsFrontendContent getFrontend() { + return frontend; + } + + public void setFrontend(LLMObsFrontendContent frontend) { + this.frontend = frontend; + if (frontend != null) { + this.unparsed |= frontend.unparsed; + } + } + public LLMObsAnnotatedInteractionByTraceItem id(String id) { this.id = id; return this; @@ -401,6 +432,7 @@ public boolean equals(Object o) { && Objects.equals(this.contentId, llmObsAnnotatedInteractionByTraceItem.contentId) && Objects.equals(this.createdAt, llmObsAnnotatedInteractionByTraceItem.createdAt) && Objects.equals(this.displayBlock, llmObsAnnotatedInteractionByTraceItem.displayBlock) + && Objects.equals(this.frontend, llmObsAnnotatedInteractionByTraceItem.frontend) && Objects.equals(this.id, llmObsAnnotatedInteractionByTraceItem.id) && Objects.equals(this.modifiedAt, llmObsAnnotatedInteractionByTraceItem.modifiedAt) && Objects.equals(this.queueId, llmObsAnnotatedInteractionByTraceItem.queueId) @@ -418,6 +450,7 @@ public int hashCode() { contentId, createdAt, displayBlock, + frontend, id, modifiedAt, queueId, @@ -435,6 +468,7 @@ public String toString() { sb.append(" contentId: ").append(toIndentedString(contentId)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" displayBlock: ").append(toIndentedString(displayBlock)).append("\n"); + sb.append(" frontend: ").append(toIndentedString(frontend)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); sb.append(" queueId: ").append(toIndentedString(queueId)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotatedInteractionDataAttributesResponse.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotatedInteractionDataAttributesResponse.java new file mode 100644 index 00000000000..2d6a1b0850d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotatedInteractionDataAttributesResponse.java @@ -0,0 +1,161 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes containing the annotated interaction. */ +@JsonPropertyOrder({ + LLMObsAnnotatedInteractionDataAttributesResponse.JSON_PROPERTY_ANNOTATED_INTERACTION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsAnnotatedInteractionDataAttributesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ANNOTATED_INTERACTION = "annotated_interaction"; + private LLMObsAnnotatedInteractionItem annotatedInteraction; + + public LLMObsAnnotatedInteractionDataAttributesResponse() {} + + @JsonCreator + public LLMObsAnnotatedInteractionDataAttributesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ANNOTATED_INTERACTION) + LLMObsAnnotatedInteractionItem annotatedInteraction) { + this.annotatedInteraction = annotatedInteraction; + this.unparsed |= annotatedInteraction.unparsed; + } + + public LLMObsAnnotatedInteractionDataAttributesResponse annotatedInteraction( + LLMObsAnnotatedInteractionItem annotatedInteraction) { + this.annotatedInteraction = annotatedInteraction; + this.unparsed |= annotatedInteraction.unparsed; + return this; + } + + /** + * An interaction with its associated annotations. + * + * @return annotatedInteraction + */ + @JsonProperty(JSON_PROPERTY_ANNOTATED_INTERACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsAnnotatedInteractionItem getAnnotatedInteraction() { + return annotatedInteraction; + } + + public void setAnnotatedInteraction(LLMObsAnnotatedInteractionItem annotatedInteraction) { + this.annotatedInteraction = annotatedInteraction; + if (annotatedInteraction != null) { + this.unparsed |= annotatedInteraction.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsAnnotatedInteractionDataAttributesResponse + */ + @JsonAnySetter + public LLMObsAnnotatedInteractionDataAttributesResponse putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsAnnotatedInteractionDataAttributesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsAnnotatedInteractionDataAttributesResponse + llmObsAnnotatedInteractionDataAttributesResponse = + (LLMObsAnnotatedInteractionDataAttributesResponse) o; + return Objects.equals( + this.annotatedInteraction, + llmObsAnnotatedInteractionDataAttributesResponse.annotatedInteraction) + && Objects.equals( + this.additionalProperties, + llmObsAnnotatedInteractionDataAttributesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(annotatedInteraction, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsAnnotatedInteractionDataAttributesResponse {\n"); + sb.append(" annotatedInteraction: ") + .append(toIndentedString(annotatedInteraction)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotatedInteractionDataResponse.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotatedInteractionDataResponse.java new file mode 100644 index 00000000000..de01ef79b2a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotatedInteractionDataResponse.java @@ -0,0 +1,216 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for a single annotated interaction. */ +@JsonPropertyOrder({ + LLMObsAnnotatedInteractionDataResponse.JSON_PROPERTY_ATTRIBUTES, + LLMObsAnnotatedInteractionDataResponse.JSON_PROPERTY_ID, + LLMObsAnnotatedInteractionDataResponse.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsAnnotatedInteractionDataResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private LLMObsAnnotatedInteractionDataAttributesResponse attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private LLMObsAnnotatedInteractionsType type; + + public LLMObsAnnotatedInteractionDataResponse() {} + + @JsonCreator + public LLMObsAnnotatedInteractionDataResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + LLMObsAnnotatedInteractionDataAttributesResponse attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + LLMObsAnnotatedInteractionsType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public LLMObsAnnotatedInteractionDataResponse attributes( + LLMObsAnnotatedInteractionDataAttributesResponse attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes containing the annotated interaction. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsAnnotatedInteractionDataAttributesResponse getAttributes() { + return attributes; + } + + public void setAttributes(LLMObsAnnotatedInteractionDataAttributesResponse attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public LLMObsAnnotatedInteractionDataResponse id(String id) { + this.id = id; + return this; + } + + /** + * The annotation queue ID. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public LLMObsAnnotatedInteractionDataResponse type(LLMObsAnnotatedInteractionsType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Resource type for annotated interactions. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsAnnotatedInteractionsType getType() { + return type; + } + + public void setType(LLMObsAnnotatedInteractionsType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsAnnotatedInteractionDataResponse + */ + @JsonAnySetter + public LLMObsAnnotatedInteractionDataResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsAnnotatedInteractionDataResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsAnnotatedInteractionDataResponse llmObsAnnotatedInteractionDataResponse = + (LLMObsAnnotatedInteractionDataResponse) o; + return Objects.equals(this.attributes, llmObsAnnotatedInteractionDataResponse.attributes) + && Objects.equals(this.id, llmObsAnnotatedInteractionDataResponse.id) + && Objects.equals(this.type, llmObsAnnotatedInteractionDataResponse.type) + && Objects.equals( + this.additionalProperties, llmObsAnnotatedInteractionDataResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsAnnotatedInteractionDataResponse {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotatedInteractionItem.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotatedInteractionItem.java index 3b88978fe1e..61fa58df1eb 100644 --- a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotatedInteractionItem.java +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotatedInteractionItem.java @@ -183,6 +183,57 @@ public LLMObsAnnotatedInteractionItem deserialize(JsonParser jp, Deserialization e); } + // deserialize LLMObsFrontendAnnotatedInteractionItem + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (LLMObsFrontendAnnotatedInteractionItem.class.equals(Integer.class) + || LLMObsFrontendAnnotatedInteractionItem.class.equals(Long.class) + || LLMObsFrontendAnnotatedInteractionItem.class.equals(Float.class) + || LLMObsFrontendAnnotatedInteractionItem.class.equals(Double.class) + || LLMObsFrontendAnnotatedInteractionItem.class.equals(Boolean.class) + || LLMObsFrontendAnnotatedInteractionItem.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((LLMObsFrontendAnnotatedInteractionItem.class.equals(Integer.class) + || LLMObsFrontendAnnotatedInteractionItem.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((LLMObsFrontendAnnotatedInteractionItem.class.equals(Float.class) + || LLMObsFrontendAnnotatedInteractionItem.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (LLMObsFrontendAnnotatedInteractionItem.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (LLMObsFrontendAnnotatedInteractionItem.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(LLMObsFrontendAnnotatedInteractionItem.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((LLMObsFrontendAnnotatedInteractionItem) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, "Input data matches schema 'LLMObsFrontendAnnotatedInteractionItem'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'LLMObsFrontendAnnotatedInteractionItem'", + e); + } + LLMObsAnnotatedInteractionItem ret = new LLMObsAnnotatedInteractionItem(); if (match == 1) { ret.setActualInstance(deserialized); @@ -223,6 +274,11 @@ public LLMObsAnnotatedInteractionItem(LLMObsDisplayBlockAnnotatedInteractionItem setActualInstance(o); } + public LLMObsAnnotatedInteractionItem(LLMObsFrontendAnnotatedInteractionItem o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + static { schemas.put( "LLMObsTraceAnnotatedInteractionItem", @@ -230,6 +286,9 @@ public LLMObsAnnotatedInteractionItem(LLMObsDisplayBlockAnnotatedInteractionItem schemas.put( "LLMObsDisplayBlockAnnotatedInteractionItem", new GenericType() {}); + schemas.put( + "LLMObsFrontendAnnotatedInteractionItem", + new GenericType() {}); JSON.registerDescendants( LLMObsAnnotatedInteractionItem.class, Collections.unmodifiableMap(schemas)); } @@ -242,7 +301,7 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check the instance parameter is valid * against the oneOf child schemas: LLMObsTraceAnnotatedInteractionItem, - * LLMObsDisplayBlockAnnotatedInteractionItem + * LLMObsDisplayBlockAnnotatedInteractionItem, LLMObsFrontendAnnotatedInteractionItem * *

    It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a * composed schema (allOf, anyOf, oneOf). @@ -259,6 +318,11 @@ public void setActualInstance(Object instance) { super.setActualInstance(instance); return; } + if (JSON.isInstanceOf( + LLMObsFrontendAnnotatedInteractionItem.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { super.setActualInstance(instance); @@ -266,15 +330,16 @@ public void setActualInstance(Object instance) { } throw new RuntimeException( "Invalid instance type. Must be LLMObsTraceAnnotatedInteractionItem," - + " LLMObsDisplayBlockAnnotatedInteractionItem"); + + " LLMObsDisplayBlockAnnotatedInteractionItem," + + " LLMObsFrontendAnnotatedInteractionItem"); } /** * Get the actual instance, which can be the following: LLMObsTraceAnnotatedInteractionItem, - * LLMObsDisplayBlockAnnotatedInteractionItem + * LLMObsDisplayBlockAnnotatedInteractionItem, LLMObsFrontendAnnotatedInteractionItem * * @return The actual instance (LLMObsTraceAnnotatedInteractionItem, - * LLMObsDisplayBlockAnnotatedInteractionItem) + * LLMObsDisplayBlockAnnotatedInteractionItem, LLMObsFrontendAnnotatedInteractionItem) */ @Override public Object getActualInstance() { @@ -304,4 +369,16 @@ public LLMObsDisplayBlockAnnotatedInteractionItem getLLMObsDisplayBlockAnnotated throws ClassCastException { return (LLMObsDisplayBlockAnnotatedInteractionItem) super.getActualInstance(); } + + /** + * Get the actual instance of `LLMObsFrontendAnnotatedInteractionItem`. If the actual instance is + * not `LLMObsFrontendAnnotatedInteractionItem`, the ClassCastException will be thrown. + * + * @return The actual instance of `LLMObsFrontendAnnotatedInteractionItem` + * @throws ClassCastException if the instance is not `LLMObsFrontendAnnotatedInteractionItem` + */ + public LLMObsFrontendAnnotatedInteractionItem getLLMObsFrontendAnnotatedInteractionItem() + throws ClassCastException { + return (LLMObsFrontendAnnotatedInteractionItem) super.getActualInstance(); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotatedInteractionResponse.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotatedInteractionResponse.java new file mode 100644 index 00000000000..bb97648672d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotatedInteractionResponse.java @@ -0,0 +1,151 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response containing a single annotated interaction. */ +@JsonPropertyOrder({LLMObsAnnotatedInteractionResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsAnnotatedInteractionResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private LLMObsAnnotatedInteractionDataResponse data; + + public LLMObsAnnotatedInteractionResponse() {} + + @JsonCreator + public LLMObsAnnotatedInteractionResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + LLMObsAnnotatedInteractionDataResponse data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public LLMObsAnnotatedInteractionResponse data(LLMObsAnnotatedInteractionDataResponse data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for a single annotated interaction. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsAnnotatedInteractionDataResponse getData() { + return data; + } + + public void setData(LLMObsAnnotatedInteractionDataResponse data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsAnnotatedInteractionResponse + */ + @JsonAnySetter + public LLMObsAnnotatedInteractionResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsAnnotatedInteractionResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsAnnotatedInteractionResponse llmObsAnnotatedInteractionResponse = + (LLMObsAnnotatedInteractionResponse) o; + return Objects.equals(this.data, llmObsAnnotatedInteractionResponse.data) + && Objects.equals( + this.additionalProperties, llmObsAnnotatedInteractionResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsAnnotatedInteractionResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationItem.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationItem.java deleted file mode 100644 index c5d3b867b6c..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationItem.java +++ /dev/null @@ -1,328 +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. - */ - -package com.datadog.api.client.v2.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** A single annotation on an interaction. */ -@JsonPropertyOrder({ - LLMObsAnnotationItem.JSON_PROPERTY_CREATED_AT, - LLMObsAnnotationItem.JSON_PROPERTY_CREATED_BY, - LLMObsAnnotationItem.JSON_PROPERTY_ID, - LLMObsAnnotationItem.JSON_PROPERTY_INTERACTION_ID, - LLMObsAnnotationItem.JSON_PROPERTY_LABEL_VALUES, - LLMObsAnnotationItem.JSON_PROPERTY_MODIFIED_AT, - LLMObsAnnotationItem.JSON_PROPERTY_MODIFIED_BY -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class LLMObsAnnotationItem { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_CREATED_AT = "created_at"; - private OffsetDateTime createdAt; - - public static final String JSON_PROPERTY_CREATED_BY = "created_by"; - private String createdBy; - - public static final String JSON_PROPERTY_ID = "id"; - private String id; - - public static final String JSON_PROPERTY_INTERACTION_ID = "interaction_id"; - private String interactionId; - - public static final String JSON_PROPERTY_LABEL_VALUES = "label_values"; - private Map labelValues = new HashMap(); - - public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; - private OffsetDateTime modifiedAt; - - public static final String JSON_PROPERTY_MODIFIED_BY = "modified_by"; - private String modifiedBy; - - public LLMObsAnnotationItem() {} - - @JsonCreator - public LLMObsAnnotationItem( - @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, - @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY) String createdBy, - @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, - @JsonProperty(required = true, value = JSON_PROPERTY_INTERACTION_ID) String interactionId, - @JsonProperty(required = true, value = JSON_PROPERTY_LABEL_VALUES) - Map labelValues, - @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) OffsetDateTime modifiedAt, - @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_BY) String modifiedBy) { - this.createdAt = createdAt; - this.createdBy = createdBy; - this.id = id; - this.interactionId = interactionId; - this.labelValues = labelValues; - this.modifiedAt = modifiedAt; - this.modifiedBy = modifiedBy; - } - - public LLMObsAnnotationItem createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Timestamp when the annotation was created. - * - * @return createdAt - */ - @JsonProperty(JSON_PROPERTY_CREATED_AT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - public LLMObsAnnotationItem createdBy(String createdBy) { - this.createdBy = createdBy; - return this; - } - - /** - * Identifier of the user who created the annotation. - * - * @return createdBy - */ - @JsonProperty(JSON_PROPERTY_CREATED_BY) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public LLMObsAnnotationItem id(String id) { - this.id = id; - return this; - } - - /** - * Unique identifier of the annotation. - * - * @return id - */ - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public LLMObsAnnotationItem interactionId(String interactionId) { - this.interactionId = interactionId; - return this; - } - - /** - * Identifier of the interaction this annotation belongs to. - * - * @return interactionId - */ - @JsonProperty(JSON_PROPERTY_INTERACTION_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getInteractionId() { - return interactionId; - } - - public void setInteractionId(String interactionId) { - this.interactionId = interactionId; - } - - public LLMObsAnnotationItem labelValues(Map labelValues) { - this.labelValues = labelValues; - return this; - } - - public LLMObsAnnotationItem putLabelValuesItem(String key, Object labelValuesItem) { - this.labelValues.put(key, labelValuesItem); - return this; - } - - /** - * Label values for this annotation. - * - * @return labelValues - */ - @JsonProperty(JSON_PROPERTY_LABEL_VALUES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Map getLabelValues() { - return labelValues; - } - - public void setLabelValues(Map labelValues) { - this.labelValues = labelValues; - } - - public LLMObsAnnotationItem modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - /** - * Timestamp when the annotation was last modified. - * - * @return modifiedAt - */ - @JsonProperty(JSON_PROPERTY_MODIFIED_AT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public OffsetDateTime getModifiedAt() { - return modifiedAt; - } - - public void setModifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = modifiedAt; - } - - public LLMObsAnnotationItem modifiedBy(String modifiedBy) { - this.modifiedBy = modifiedBy; - return this; - } - - /** - * Identifier of the user who last modified the annotation. - * - * @return modifiedBy - */ - @JsonProperty(JSON_PROPERTY_MODIFIED_BY) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getModifiedBy() { - return modifiedBy; - } - - public void setModifiedBy(String modifiedBy) { - this.modifiedBy = modifiedBy; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key The arbitrary key to set - * @param value The associated value - * @return LLMObsAnnotationItem - */ - @JsonAnySetter - public LLMObsAnnotationItem putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return The additional properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key The arbitrary key to get - * @return The specific additional property for the given key - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** Return true if this LLMObsAnnotationItem object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - LLMObsAnnotationItem llmObsAnnotationItem = (LLMObsAnnotationItem) o; - return Objects.equals(this.createdAt, llmObsAnnotationItem.createdAt) - && Objects.equals(this.createdBy, llmObsAnnotationItem.createdBy) - && Objects.equals(this.id, llmObsAnnotationItem.id) - && Objects.equals(this.interactionId, llmObsAnnotationItem.interactionId) - && Objects.equals(this.labelValues, llmObsAnnotationItem.labelValues) - && Objects.equals(this.modifiedAt, llmObsAnnotationItem.modifiedAt) - && Objects.equals(this.modifiedBy, llmObsAnnotationItem.modifiedBy) - && Objects.equals(this.additionalProperties, llmObsAnnotationItem.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - createdAt, - createdBy, - id, - interactionId, - labelValues, - modifiedAt, - modifiedBy, - additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class LLMObsAnnotationItem {\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" interactionId: ").append(toIndentedString(interactionId)).append("\n"); - sb.append(" labelValues: ").append(toIndentedString(labelValues)).append("\n"); - sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); - sb.append(" modifiedBy: ").append(toIndentedString(modifiedBy)).append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .append("\n"); - sb.append('}'); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueInteractionItem.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueInteractionItem.java index 1a9df63394d..2be932ec982 100644 --- a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueInteractionItem.java +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueInteractionItem.java @@ -177,6 +177,51 @@ public LLMObsAnnotationQueueInteractionItem deserialize( Level.FINER, "Input data does not match schema 'LLMObsDisplayBlockInteractionItem'", e); } + // deserialize LLMObsFrontendInteractionItem + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (LLMObsFrontendInteractionItem.class.equals(Integer.class) + || LLMObsFrontendInteractionItem.class.equals(Long.class) + || LLMObsFrontendInteractionItem.class.equals(Float.class) + || LLMObsFrontendInteractionItem.class.equals(Double.class) + || LLMObsFrontendInteractionItem.class.equals(Boolean.class) + || LLMObsFrontendInteractionItem.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((LLMObsFrontendInteractionItem.class.equals(Integer.class) + || LLMObsFrontendInteractionItem.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((LLMObsFrontendInteractionItem.class.equals(Float.class) + || LLMObsFrontendInteractionItem.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (LLMObsFrontendInteractionItem.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (LLMObsFrontendInteractionItem.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(LLMObsFrontendInteractionItem.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((LLMObsFrontendInteractionItem) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'LLMObsFrontendInteractionItem'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'LLMObsFrontendInteractionItem'", e); + } + LLMObsAnnotationQueueInteractionItem ret = new LLMObsAnnotationQueueInteractionItem(); if (match == 1) { ret.setActualInstance(deserialized); @@ -217,11 +262,18 @@ public LLMObsAnnotationQueueInteractionItem(LLMObsDisplayBlockInteractionItem o) setActualInstance(o); } + public LLMObsAnnotationQueueInteractionItem(LLMObsFrontendInteractionItem o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + static { schemas.put("LLMObsTraceInteractionItem", new GenericType() {}); schemas.put( "LLMObsDisplayBlockInteractionItem", new GenericType() {}); + schemas.put( + "LLMObsFrontendInteractionItem", new GenericType() {}); JSON.registerDescendants( LLMObsAnnotationQueueInteractionItem.class, Collections.unmodifiableMap(schemas)); } @@ -233,7 +285,8 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: LLMObsTraceInteractionItem, LLMObsDisplayBlockInteractionItem + * against the oneOf child schemas: LLMObsTraceInteractionItem, LLMObsDisplayBlockInteractionItem, + * LLMObsFrontendInteractionItem * *

    It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a * composed schema (allOf, anyOf, oneOf). @@ -249,6 +302,10 @@ public void setActualInstance(Object instance) { super.setActualInstance(instance); return; } + if (JSON.isInstanceOf(LLMObsFrontendInteractionItem.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { super.setActualInstance(instance); @@ -256,14 +313,15 @@ public void setActualInstance(Object instance) { } throw new RuntimeException( "Invalid instance type. Must be LLMObsTraceInteractionItem," - + " LLMObsDisplayBlockInteractionItem"); + + " LLMObsDisplayBlockInteractionItem, LLMObsFrontendInteractionItem"); } /** * Get the actual instance, which can be the following: LLMObsTraceInteractionItem, - * LLMObsDisplayBlockInteractionItem + * LLMObsDisplayBlockInteractionItem, LLMObsFrontendInteractionItem * - * @return The actual instance (LLMObsTraceInteractionItem, LLMObsDisplayBlockInteractionItem) + * @return The actual instance (LLMObsTraceInteractionItem, LLMObsDisplayBlockInteractionItem, + * LLMObsFrontendInteractionItem) */ @Override public Object getActualInstance() { @@ -292,4 +350,16 @@ public LLMObsDisplayBlockInteractionItem getLLMObsDisplayBlockInteractionItem() throws ClassCastException { return (LLMObsDisplayBlockInteractionItem) super.getActualInstance(); } + + /** + * Get the actual instance of `LLMObsFrontendInteractionItem`. If the actual instance is not + * `LLMObsFrontendInteractionItem`, the ClassCastException will be thrown. + * + * @return The actual instance of `LLMObsFrontendInteractionItem` + * @throws ClassCastException if the instance is not `LLMObsFrontendInteractionItem` + */ + public LLMObsFrontendInteractionItem getLLMObsFrontendInteractionItem() + throws ClassCastException { + return (LLMObsFrontendInteractionItem) super.getActualInstance(); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueInteractionResponseItem.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueInteractionResponseItem.java index 8d4aed402f4..333ff8eeb3c 100644 --- a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueInteractionResponseItem.java +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueInteractionResponseItem.java @@ -189,6 +189,55 @@ public LLMObsAnnotationQueueInteractionResponseItem deserialize( e); } + // deserialize LLMObsFrontendInteractionResponseItem + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (LLMObsFrontendInteractionResponseItem.class.equals(Integer.class) + || LLMObsFrontendInteractionResponseItem.class.equals(Long.class) + || LLMObsFrontendInteractionResponseItem.class.equals(Float.class) + || LLMObsFrontendInteractionResponseItem.class.equals(Double.class) + || LLMObsFrontendInteractionResponseItem.class.equals(Boolean.class) + || LLMObsFrontendInteractionResponseItem.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((LLMObsFrontendInteractionResponseItem.class.equals(Integer.class) + || LLMObsFrontendInteractionResponseItem.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((LLMObsFrontendInteractionResponseItem.class.equals(Float.class) + || LLMObsFrontendInteractionResponseItem.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (LLMObsFrontendInteractionResponseItem.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (LLMObsFrontendInteractionResponseItem.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()).readValueAs(LLMObsFrontendInteractionResponseItem.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((LLMObsFrontendInteractionResponseItem) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'LLMObsFrontendInteractionResponseItem'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'LLMObsFrontendInteractionResponseItem'", + e); + } + LLMObsAnnotationQueueInteractionResponseItem ret = new LLMObsAnnotationQueueInteractionResponseItem(); if (match == 1) { @@ -230,6 +279,11 @@ public LLMObsAnnotationQueueInteractionResponseItem(LLMObsDisplayBlockInteractio setActualInstance(o); } + public LLMObsAnnotationQueueInteractionResponseItem(LLMObsFrontendInteractionResponseItem o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + static { schemas.put( "LLMObsTraceInteractionResponseItem", @@ -237,6 +291,9 @@ public LLMObsAnnotationQueueInteractionResponseItem(LLMObsDisplayBlockInteractio schemas.put( "LLMObsDisplayBlockInteractionResponseItem", new GenericType() {}); + schemas.put( + "LLMObsFrontendInteractionResponseItem", + new GenericType() {}); JSON.registerDescendants( LLMObsAnnotationQueueInteractionResponseItem.class, Collections.unmodifiableMap(schemas)); } @@ -249,7 +306,7 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check the instance parameter is valid * against the oneOf child schemas: LLMObsTraceInteractionResponseItem, - * LLMObsDisplayBlockInteractionResponseItem + * LLMObsDisplayBlockInteractionResponseItem, LLMObsFrontendInteractionResponseItem * *

    It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a * composed schema (allOf, anyOf, oneOf). @@ -266,6 +323,11 @@ public void setActualInstance(Object instance) { super.setActualInstance(instance); return; } + if (JSON.isInstanceOf( + LLMObsFrontendInteractionResponseItem.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { super.setActualInstance(instance); @@ -273,15 +335,15 @@ public void setActualInstance(Object instance) { } throw new RuntimeException( "Invalid instance type. Must be LLMObsTraceInteractionResponseItem," - + " LLMObsDisplayBlockInteractionResponseItem"); + + " LLMObsDisplayBlockInteractionResponseItem, LLMObsFrontendInteractionResponseItem"); } /** * Get the actual instance, which can be the following: LLMObsTraceInteractionResponseItem, - * LLMObsDisplayBlockInteractionResponseItem + * LLMObsDisplayBlockInteractionResponseItem, LLMObsFrontendInteractionResponseItem * * @return The actual instance (LLMObsTraceInteractionResponseItem, - * LLMObsDisplayBlockInteractionResponseItem) + * LLMObsDisplayBlockInteractionResponseItem, LLMObsFrontendInteractionResponseItem) */ @Override public Object getActualInstance() { @@ -311,4 +373,16 @@ public LLMObsDisplayBlockInteractionResponseItem getLLMObsDisplayBlockInteractio throws ClassCastException { return (LLMObsDisplayBlockInteractionResponseItem) super.getActualInstance(); } + + /** + * Get the actual instance of `LLMObsFrontendInteractionResponseItem`. If the actual instance is + * not `LLMObsFrontendInteractionResponseItem`, the ClassCastException will be thrown. + * + * @return The actual instance of `LLMObsFrontendInteractionResponseItem` + * @throws ClassCastException if the instance is not `LLMObsFrontendInteractionResponseItem` + */ + public LLMObsFrontendInteractionResponseItem getLLMObsFrontendInteractionResponseItem() + throws ClassCastException { + return (LLMObsFrontendInteractionResponseItem) super.getActualInstance(); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnyInteractionType.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnyInteractionType.java index 681bf1c7f33..54f5fd26357 100644 --- a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnyInteractionType.java +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnyInteractionType.java @@ -23,7 +23,8 @@ public class LLMObsAnyInteractionType extends ModelEnum { private static final Set allowedValues = - new HashSet(Arrays.asList("trace", "experiment_trace", "session", "display_block")); + new HashSet( + Arrays.asList("trace", "experiment_trace", "session", "display_block", "frontend")); public static final LLMObsAnyInteractionType TRACE = new LLMObsAnyInteractionType("trace"); public static final LLMObsAnyInteractionType EXPERIMENT_TRACE = @@ -31,6 +32,7 @@ public class LLMObsAnyInteractionType extends ModelEnum { public static final LLMObsAnyInteractionType SESSION = new LLMObsAnyInteractionType("session"); public static final LLMObsAnyInteractionType DISPLAY_BLOCK = new LLMObsAnyInteractionType("display_block"); + public static final LLMObsAnyInteractionType FRONTEND = new LLMObsAnyInteractionType("frontend"); LLMObsAnyInteractionType(String value) { super(value, allowedValues); diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsDisplayBlockAnnotatedInteractionItem.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsDisplayBlockAnnotatedInteractionItem.java index 2d3e7f4b05a..4a5a760f525 100644 --- a/src/main/java/com/datadog/api/client/v2/model/LLMObsDisplayBlockAnnotatedInteractionItem.java +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsDisplayBlockAnnotatedInteractionItem.java @@ -33,7 +33,7 @@ public class LLMObsDisplayBlockAnnotatedInteractionItem { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_ANNOTATIONS = "annotations"; - private List annotations = new ArrayList<>(); + private List annotations = new ArrayList<>(); public static final String JSON_PROPERTY_CAN_ANNOTATE = "can_annotate"; private Boolean canAnnotate; @@ -55,7 +55,7 @@ public LLMObsDisplayBlockAnnotatedInteractionItem() {} @JsonCreator public LLMObsDisplayBlockAnnotatedInteractionItem( @JsonProperty(required = true, value = JSON_PROPERTY_ANNOTATIONS) - List annotations, + List annotations, @JsonProperty(required = true, value = JSON_PROPERTY_CAN_ANNOTATE) Boolean canAnnotate, @JsonProperty(required = true, value = JSON_PROPERTY_CONTENT_ID) String contentId, @JsonProperty(required = true, value = JSON_PROPERTY_DISPLAY_BLOCK) @@ -64,7 +64,7 @@ public LLMObsDisplayBlockAnnotatedInteractionItem( @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) LLMObsDisplayBlockInteractionType type) { this.annotations = annotations; - for (LLMObsAnnotationItem item : annotations) { + for (LLMObsAnnotationItemResponse item : annotations) { this.unparsed |= item.unparsed; } this.canAnnotate = canAnnotate; @@ -79,16 +79,16 @@ public LLMObsDisplayBlockAnnotatedInteractionItem( } public LLMObsDisplayBlockAnnotatedInteractionItem annotations( - List annotations) { + List annotations) { this.annotations = annotations; - for (LLMObsAnnotationItem item : annotations) { + for (LLMObsAnnotationItemResponse item : annotations) { this.unparsed |= item.unparsed; } return this; } public LLMObsDisplayBlockAnnotatedInteractionItem addAnnotationsItem( - LLMObsAnnotationItem annotationsItem) { + LLMObsAnnotationItemResponse annotationsItem) { this.annotations.add(annotationsItem); this.unparsed |= annotationsItem.unparsed; return this; @@ -101,14 +101,14 @@ public LLMObsDisplayBlockAnnotatedInteractionItem addAnnotationsItem( */ @JsonProperty(JSON_PROPERTY_ANNOTATIONS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getAnnotations() { + public List getAnnotations() { return annotations; } - public void setAnnotations(List annotations) { + public void setAnnotations(List annotations) { this.annotations = annotations; if (annotations != null) { - for (LLMObsAnnotationItem item : annotations) { + for (LLMObsAnnotationItemResponse item : annotations) { this.unparsed |= item.unparsed; } } diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsFrontendAnnotatedInteractionItem.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsFrontendAnnotatedInteractionItem.java new file mode 100644 index 00000000000..0b0ba3a06be --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsFrontendAnnotatedInteractionItem.java @@ -0,0 +1,321 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A frontend interaction with its associated annotations. */ +@JsonPropertyOrder({ + LLMObsFrontendAnnotatedInteractionItem.JSON_PROPERTY_ANNOTATIONS, + LLMObsFrontendAnnotatedInteractionItem.JSON_PROPERTY_CAN_ANNOTATE, + LLMObsFrontendAnnotatedInteractionItem.JSON_PROPERTY_CONTENT_ID, + LLMObsFrontendAnnotatedInteractionItem.JSON_PROPERTY_FRONTEND, + LLMObsFrontendAnnotatedInteractionItem.JSON_PROPERTY_ID, + LLMObsFrontendAnnotatedInteractionItem.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsFrontendAnnotatedInteractionItem { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ANNOTATIONS = "annotations"; + private List annotations = new ArrayList<>(); + + public static final String JSON_PROPERTY_CAN_ANNOTATE = "can_annotate"; + private Boolean canAnnotate; + + public static final String JSON_PROPERTY_CONTENT_ID = "content_id"; + private String contentId; + + public static final String JSON_PROPERTY_FRONTEND = "frontend"; + private LLMObsFrontendContent frontend; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private LLMObsFrontendInteractionType type; + + public LLMObsFrontendAnnotatedInteractionItem() {} + + @JsonCreator + public LLMObsFrontendAnnotatedInteractionItem( + @JsonProperty(required = true, value = JSON_PROPERTY_ANNOTATIONS) + List annotations, + @JsonProperty(required = true, value = JSON_PROPERTY_CAN_ANNOTATE) Boolean canAnnotate, + @JsonProperty(required = true, value = JSON_PROPERTY_CONTENT_ID) String contentId, + @JsonProperty(required = true, value = JSON_PROPERTY_FRONTEND) LLMObsFrontendContent frontend, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + LLMObsFrontendInteractionType type) { + this.annotations = annotations; + for (LLMObsAnnotationItemResponse item : annotations) { + this.unparsed |= item.unparsed; + } + this.canAnnotate = canAnnotate; + this.contentId = contentId; + this.frontend = frontend; + this.unparsed |= frontend.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public LLMObsFrontendAnnotatedInteractionItem annotations( + List annotations) { + this.annotations = annotations; + for (LLMObsAnnotationItemResponse item : annotations) { + this.unparsed |= item.unparsed; + } + return this; + } + + public LLMObsFrontendAnnotatedInteractionItem addAnnotationsItem( + LLMObsAnnotationItemResponse annotationsItem) { + this.annotations.add(annotationsItem); + this.unparsed |= annotationsItem.unparsed; + return this; + } + + /** + * List of annotations for this interaction. + * + * @return annotations + */ + @JsonProperty(JSON_PROPERTY_ANNOTATIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getAnnotations() { + return annotations; + } + + public void setAnnotations(List annotations) { + this.annotations = annotations; + if (annotations != null) { + for (LLMObsAnnotationItemResponse item : annotations) { + this.unparsed |= item.unparsed; + } + } + } + + public LLMObsFrontendAnnotatedInteractionItem canAnnotate(Boolean canAnnotate) { + this.canAnnotate = canAnnotate; + return this; + } + + /** + * Whether the current caller can annotate this interaction. + * + * @return canAnnotate + */ + @JsonProperty(JSON_PROPERTY_CAN_ANNOTATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getCanAnnotate() { + return canAnnotate; + } + + public void setCanAnnotate(Boolean canAnnotate) { + this.canAnnotate = canAnnotate; + } + + public LLMObsFrontendAnnotatedInteractionItem contentId(String contentId) { + this.contentId = contentId; + return this; + } + + /** + * Server-generated deterministic identifier derived from the content. + * + * @return contentId + */ + @JsonProperty(JSON_PROPERTY_CONTENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getContentId() { + return contentId; + } + + public void setContentId(String contentId) { + this.contentId = contentId; + } + + public LLMObsFrontendAnnotatedInteractionItem frontend(LLMObsFrontendContent frontend) { + this.frontend = frontend; + this.unparsed |= frontend.unparsed; + return this; + } + + /** + * Web content that makes up a frontend interaction. + * + * @return frontend + */ + @JsonProperty(JSON_PROPERTY_FRONTEND) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsFrontendContent getFrontend() { + return frontend; + } + + public void setFrontend(LLMObsFrontendContent frontend) { + this.frontend = frontend; + if (frontend != null) { + this.unparsed |= frontend.unparsed; + } + } + + public LLMObsFrontendAnnotatedInteractionItem id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the interaction. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public LLMObsFrontendAnnotatedInteractionItem type(LLMObsFrontendInteractionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type discriminator for a frontend interaction. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsFrontendInteractionType getType() { + return type; + } + + public void setType(LLMObsFrontendInteractionType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsFrontendAnnotatedInteractionItem + */ + @JsonAnySetter + public LLMObsFrontendAnnotatedInteractionItem putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsFrontendAnnotatedInteractionItem object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsFrontendAnnotatedInteractionItem llmObsFrontendAnnotatedInteractionItem = + (LLMObsFrontendAnnotatedInteractionItem) o; + return Objects.equals(this.annotations, llmObsFrontendAnnotatedInteractionItem.annotations) + && Objects.equals(this.canAnnotate, llmObsFrontendAnnotatedInteractionItem.canAnnotate) + && Objects.equals(this.contentId, llmObsFrontendAnnotatedInteractionItem.contentId) + && Objects.equals(this.frontend, llmObsFrontendAnnotatedInteractionItem.frontend) + && Objects.equals(this.id, llmObsFrontendAnnotatedInteractionItem.id) + && Objects.equals(this.type, llmObsFrontendAnnotatedInteractionItem.type) + && Objects.equals( + this.additionalProperties, llmObsFrontendAnnotatedInteractionItem.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + annotations, canAnnotate, contentId, frontend, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsFrontendAnnotatedInteractionItem {\n"); + sb.append(" annotations: ").append(toIndentedString(annotations)).append("\n"); + sb.append(" canAnnotate: ").append(toIndentedString(canAnnotate)).append("\n"); + sb.append(" contentId: ").append(toIndentedString(contentId)).append("\n"); + sb.append(" frontend: ").append(toIndentedString(frontend)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsFrontendContent.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsFrontendContent.java new file mode 100644 index 00000000000..9be78f6cb74 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsFrontendContent.java @@ -0,0 +1,143 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Web content that makes up a frontend interaction. */ +@JsonPropertyOrder({LLMObsFrontendContent.JSON_PROPERTY_CODE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsFrontendContent { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CODE = "code"; + private String code; + + public LLMObsFrontendContent() {} + + @JsonCreator + public LLMObsFrontendContent( + @JsonProperty(required = true, value = JSON_PROPERTY_CODE) String code) { + this.code = code; + } + + public LLMObsFrontendContent code(String code) { + this.code = code; + return this; + } + + /** + * Caller-provided web content. + * + * @return code + */ + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsFrontendContent + */ + @JsonAnySetter + public LLMObsFrontendContent putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsFrontendContent object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsFrontendContent llmObsFrontendContent = (LLMObsFrontendContent) o; + return Objects.equals(this.code, llmObsFrontendContent.code) + && Objects.equals(this.additionalProperties, llmObsFrontendContent.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(code, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsFrontendContent {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsFrontendInteractionItem.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsFrontendInteractionItem.java new file mode 100644 index 00000000000..100d0c76150 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsFrontendInteractionItem.java @@ -0,0 +1,188 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * An interaction whose rendered content is supplied directly as web content. The server generates + * content_id deterministically from the content. + */ +@JsonPropertyOrder({ + LLMObsFrontendInteractionItem.JSON_PROPERTY_FRONTEND, + LLMObsFrontendInteractionItem.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsFrontendInteractionItem { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FRONTEND = "frontend"; + private LLMObsFrontendContent frontend; + + public static final String JSON_PROPERTY_TYPE = "type"; + private LLMObsFrontendInteractionType type; + + public LLMObsFrontendInteractionItem() {} + + @JsonCreator + public LLMObsFrontendInteractionItem( + @JsonProperty(required = true, value = JSON_PROPERTY_FRONTEND) LLMObsFrontendContent frontend, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + LLMObsFrontendInteractionType type) { + this.frontend = frontend; + this.unparsed |= frontend.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public LLMObsFrontendInteractionItem frontend(LLMObsFrontendContent frontend) { + this.frontend = frontend; + this.unparsed |= frontend.unparsed; + return this; + } + + /** + * Web content that makes up a frontend interaction. + * + * @return frontend + */ + @JsonProperty(JSON_PROPERTY_FRONTEND) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsFrontendContent getFrontend() { + return frontend; + } + + public void setFrontend(LLMObsFrontendContent frontend) { + this.frontend = frontend; + if (frontend != null) { + this.unparsed |= frontend.unparsed; + } + } + + public LLMObsFrontendInteractionItem type(LLMObsFrontendInteractionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type discriminator for a frontend interaction. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsFrontendInteractionType getType() { + return type; + } + + public void setType(LLMObsFrontendInteractionType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsFrontendInteractionItem + */ + @JsonAnySetter + public LLMObsFrontendInteractionItem putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsFrontendInteractionItem object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsFrontendInteractionItem llmObsFrontendInteractionItem = (LLMObsFrontendInteractionItem) o; + return Objects.equals(this.frontend, llmObsFrontendInteractionItem.frontend) + && Objects.equals(this.type, llmObsFrontendInteractionItem.type) + && Objects.equals( + this.additionalProperties, llmObsFrontendInteractionItem.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(frontend, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsFrontendInteractionItem {\n"); + sb.append(" frontend: ").append(toIndentedString(frontend)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsFrontendInteractionResponseItem.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsFrontendInteractionResponseItem.java new file mode 100644 index 00000000000..c7ebbbdafc5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsFrontendInteractionResponseItem.java @@ -0,0 +1,270 @@ +/* + * 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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A frontend interaction result. */ +@JsonPropertyOrder({ + LLMObsFrontendInteractionResponseItem.JSON_PROPERTY_ALREADY_EXISTED, + LLMObsFrontendInteractionResponseItem.JSON_PROPERTY_CONTENT_ID, + LLMObsFrontendInteractionResponseItem.JSON_PROPERTY_FRONTEND, + LLMObsFrontendInteractionResponseItem.JSON_PROPERTY_ID, + LLMObsFrontendInteractionResponseItem.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsFrontendInteractionResponseItem { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ALREADY_EXISTED = "already_existed"; + private Boolean alreadyExisted; + + public static final String JSON_PROPERTY_CONTENT_ID = "content_id"; + private String contentId; + + public static final String JSON_PROPERTY_FRONTEND = "frontend"; + private LLMObsFrontendContent frontend; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private LLMObsFrontendInteractionType type; + + public LLMObsFrontendInteractionResponseItem() {} + + @JsonCreator + public LLMObsFrontendInteractionResponseItem( + @JsonProperty(required = true, value = JSON_PROPERTY_ALREADY_EXISTED) Boolean alreadyExisted, + @JsonProperty(required = true, value = JSON_PROPERTY_CONTENT_ID) String contentId, + @JsonProperty(required = true, value = JSON_PROPERTY_FRONTEND) LLMObsFrontendContent frontend, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + LLMObsFrontendInteractionType type) { + this.alreadyExisted = alreadyExisted; + this.contentId = contentId; + this.frontend = frontend; + this.unparsed |= frontend.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public LLMObsFrontendInteractionResponseItem alreadyExisted(Boolean alreadyExisted) { + this.alreadyExisted = alreadyExisted; + return this; + } + + /** + * Whether this interaction already existed in the queue. + * + * @return alreadyExisted + */ + @JsonProperty(JSON_PROPERTY_ALREADY_EXISTED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getAlreadyExisted() { + return alreadyExisted; + } + + public void setAlreadyExisted(Boolean alreadyExisted) { + this.alreadyExisted = alreadyExisted; + } + + public LLMObsFrontendInteractionResponseItem contentId(String contentId) { + this.contentId = contentId; + return this; + } + + /** + * Server-generated deterministic identifier derived from the content. + * + * @return contentId + */ + @JsonProperty(JSON_PROPERTY_CONTENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getContentId() { + return contentId; + } + + public void setContentId(String contentId) { + this.contentId = contentId; + } + + public LLMObsFrontendInteractionResponseItem frontend(LLMObsFrontendContent frontend) { + this.frontend = frontend; + this.unparsed |= frontend.unparsed; + return this; + } + + /** + * Web content that makes up a frontend interaction. + * + * @return frontend + */ + @JsonProperty(JSON_PROPERTY_FRONTEND) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsFrontendContent getFrontend() { + return frontend; + } + + public void setFrontend(LLMObsFrontendContent frontend) { + this.frontend = frontend; + if (frontend != null) { + this.unparsed |= frontend.unparsed; + } + } + + public LLMObsFrontendInteractionResponseItem id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the interaction. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public LLMObsFrontendInteractionResponseItem type(LLMObsFrontendInteractionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type discriminator for a frontend interaction. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsFrontendInteractionType getType() { + return type; + } + + public void setType(LLMObsFrontendInteractionType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LLMObsFrontendInteractionResponseItem + */ + @JsonAnySetter + public LLMObsFrontendInteractionResponseItem putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LLMObsFrontendInteractionResponseItem object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsFrontendInteractionResponseItem llmObsFrontendInteractionResponseItem = + (LLMObsFrontendInteractionResponseItem) o; + return Objects.equals(this.alreadyExisted, llmObsFrontendInteractionResponseItem.alreadyExisted) + && Objects.equals(this.contentId, llmObsFrontendInteractionResponseItem.contentId) + && Objects.equals(this.frontend, llmObsFrontendInteractionResponseItem.frontend) + && Objects.equals(this.id, llmObsFrontendInteractionResponseItem.id) + && Objects.equals(this.type, llmObsFrontendInteractionResponseItem.type) + && Objects.equals( + this.additionalProperties, llmObsFrontendInteractionResponseItem.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(alreadyExisted, contentId, frontend, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsFrontendInteractionResponseItem {\n"); + sb.append(" alreadyExisted: ").append(toIndentedString(alreadyExisted)).append("\n"); + sb.append(" contentId: ").append(toIndentedString(contentId)).append("\n"); + sb.append(" frontend: ").append(toIndentedString(frontend)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsFrontendInteractionType.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsFrontendInteractionType.java new file mode 100644 index 00000000000..5ddc284e213 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsFrontendInteractionType.java @@ -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. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type discriminator for a frontend interaction. */ +@JsonSerialize(using = LLMObsFrontendInteractionType.LLMObsFrontendInteractionTypeSerializer.class) +public class LLMObsFrontendInteractionType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("frontend")); + + public static final LLMObsFrontendInteractionType FRONTEND = + new LLMObsFrontendInteractionType("frontend"); + + LLMObsFrontendInteractionType(String value) { + super(value, allowedValues); + } + + public static class LLMObsFrontendInteractionTypeSerializer + extends StdSerializer { + public LLMObsFrontendInteractionTypeSerializer(Class t) { + super(t); + } + + public LLMObsFrontendInteractionTypeSerializer() { + this(null); + } + + @Override + public void serialize( + LLMObsFrontendInteractionType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static LLMObsFrontendInteractionType fromValue(String value) { + return new LLMObsFrontendInteractionType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsTraceAnnotatedInteractionItem.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsTraceAnnotatedInteractionItem.java index 456019d5b26..bb35d324eeb 100644 --- a/src/main/java/com/datadog/api/client/v2/model/LLMObsTraceAnnotatedInteractionItem.java +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsTraceAnnotatedInteractionItem.java @@ -35,7 +35,7 @@ public class LLMObsTraceAnnotatedInteractionItem { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_ANNOTATIONS = "annotations"; - private List annotations = new ArrayList<>(); + private List annotations = new ArrayList<>(); public static final String JSON_PROPERTY_CAN_ANNOTATE = "can_annotate"; private Boolean canAnnotate; @@ -60,7 +60,7 @@ public LLMObsTraceAnnotatedInteractionItem() {} @JsonCreator public LLMObsTraceAnnotatedInteractionItem( @JsonProperty(required = true, value = JSON_PROPERTY_ANNOTATIONS) - List annotations, + List annotations, @JsonProperty(required = true, value = JSON_PROPERTY_CAN_ANNOTATE) Boolean canAnnotate, @JsonProperty(required = true, value = JSON_PROPERTY_CONTENT_ID) String contentId, @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, @@ -68,7 +68,7 @@ public LLMObsTraceAnnotatedInteractionItem( @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) OffsetDateTime modifiedAt, @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) LLMObsTraceInteractionType type) { this.annotations = annotations; - for (LLMObsAnnotationItem item : annotations) { + for (LLMObsAnnotationItemResponse item : annotations) { this.unparsed |= item.unparsed; } this.canAnnotate = canAnnotate; @@ -80,16 +80,17 @@ public LLMObsTraceAnnotatedInteractionItem( this.unparsed |= !type.isValid(); } - public LLMObsTraceAnnotatedInteractionItem annotations(List annotations) { + public LLMObsTraceAnnotatedInteractionItem annotations( + List annotations) { this.annotations = annotations; - for (LLMObsAnnotationItem item : annotations) { + for (LLMObsAnnotationItemResponse item : annotations) { this.unparsed |= item.unparsed; } return this; } public LLMObsTraceAnnotatedInteractionItem addAnnotationsItem( - LLMObsAnnotationItem annotationsItem) { + LLMObsAnnotationItemResponse annotationsItem) { this.annotations.add(annotationsItem); this.unparsed |= annotationsItem.unparsed; return this; @@ -102,14 +103,14 @@ public LLMObsTraceAnnotatedInteractionItem addAnnotationsItem( */ @JsonProperty(JSON_PROPERTY_ANNOTATIONS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getAnnotations() { + public List getAnnotations() { return annotations; } - public void setAnnotations(List annotations) { + public void setAnnotations(List annotations) { this.annotations = annotations; if (annotations != null) { - for (LLMObsAnnotationItem item : annotations) { + for (LLMObsAnnotationItemResponse item : annotations) { this.unparsed |= item.unparsed; } } diff --git a/src/test/resources/com/datadog/api/client/v2/api/agent_observability.feature b/src/test/resources/com/datadog/api/client/v2/api/agent_observability.feature index acf08cf0dd8..3136a1312f5 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/agent_observability.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/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/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 535ebca0b11..f73a9089c8e 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -4636,6 +4636,12 @@ "type": "safe" } }, + "GetLLMObsAnnotatedInteraction": { + "tag": "Agent Observability", + "undo": { + "type": "safe" + } + }, "UpsertLLMObsAnnotations": { "tag": "Agent Observability", "undo": { diff --git a/src/test/resources/generated-test/test-server b/src/test/resources/generated-test/test-server index 899230cbccd..a7224b2c64c 100755 --- a/src/test/resources/generated-test/test-server +++ b/src/test/resources/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]: