diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 97213ec2fe9e..22fc24351728 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -41740,11 +41740,109 @@ components: format: int64 type: integer type: object + LLMObsAnnotatedInteractionByTraceItem: + description: An annotated interaction returned by the cross-queue lookup, including the source queue metadata. + properties: + annotations: + description: List of annotations for this interaction. + items: + $ref: "#/components/schemas/LLMObsAnnotationItem" + type: array + content_id: + description: Upstream entity identifier (trace ID, session ID, or deterministic display_block ID). + example: "trace-abc-123" + type: string + created_at: + description: Timestamp when the interaction was added to the queue. + example: "2025-06-01T12:00:00Z" + format: date-time + type: string + display_block: + $ref: "#/components/schemas/LLMObsContentBlocks" + id: + description: Unique identifier of the interaction. + example: "interaction-456" + type: string + modified_at: + description: Timestamp when the interaction was last updated. + example: "2025-06-01T12:00:00Z" + format: date-time + type: string + queue_id: + description: Identifier of the annotation queue this interaction belongs to. + example: "queue-uuid-001" + type: string + queue_name: + description: Name of the annotation queue this interaction belongs to. + example: "My Annotation Queue" + type: string + type: + $ref: "#/components/schemas/LLMObsAnyInteractionType" + required: + - id + - type + - content_id + - created_at + - modified_at + - queue_id + - queue_name + - annotations + type: object LLMObsAnnotatedInteractionItem: description: An interaction with its associated annotations. oneOf: - $ref: "#/components/schemas/LLMObsTraceAnnotatedInteractionItem" - $ref: "#/components/schemas/LLMObsDisplayBlockAnnotatedInteractionItem" + LLMObsAnnotatedInteractionsByTraceDataAttributesResponse: + description: Attributes of the cross-queue annotated interactions response. + properties: + annotated_interactions: + description: List of annotated interactions across all queues for the requested content IDs. + items: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionByTraceItem" + type: array + total_count: + description: Total number of annotated interactions matching the query. + example: 1 + format: int32 + maximum: 2147483647 + type: integer + required: + - annotated_interactions + - total_count + type: object + LLMObsAnnotatedInteractionsByTraceDataResponse: + description: Data object for the cross-queue annotated interactions response. + properties: + attributes: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionsByTraceDataAttributesResponse" + id: + description: Opaque identifier for the response object. + example: "trace-query" + type: string + type: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionsByTraceType" + required: + - id + - type + - attributes + type: object + LLMObsAnnotatedInteractionsByTraceResponse: + description: Response containing annotated interactions across all queues for the requested content IDs. + properties: + data: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionsByTraceDataResponse" + required: + - data + type: object + LLMObsAnnotatedInteractionsByTraceType: + description: Resource type for cross-queue annotated interactions lookup. + enum: + - annotated_interactions_by_trace + example: annotated_interactions_by_trace + type: string + x-enum-varnames: + - ANNOTATED_INTERACTIONS_BY_TRACE LLMObsAnnotatedInteractionsDataAttributesResponse: description: Attributes containing the list of annotated interactions. properties: @@ -42214,6 +42312,20 @@ components: - ENABLED - DISABLED - ADAPTIVE + LLMObsAnyInteractionType: + description: Type of an annotated interaction. + enum: + - trace + - experiment_trace + - session + - display_block + example: trace + type: string + x-enum-varnames: + - TRACE + - EXPERIMENT_TRACE + - SESSION + - DISPLAY_BLOCK LLMObsAzureOpenAIMetadata: description: Azure OpenAI-specific metadata for an integration account or inference request. properties: @@ -122240,6 +122352,104 @@ 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/annotated-interactions: + get: + description: Returns annotated interactions across all annotation queues for the given content IDs. Results include queue metadata (ID and name) for each interaction. + operationId: GetLLMObsAnnotatedInteractionsByTraceIDs + parameters: + - description: One or more content IDs to retrieve annotated interactions for. At least one is required. + in: query + name: contentIds + required: true + schema: + items: + type: string + type: array + - description: Pagination offset. Must be >= 0. Defaults to 0. + in: query + name: offset + schema: + default: 0 + format: int32 + maximum: 2147483647 + minimum: 0 + type: integer + - description: Maximum number of results to return. Must be > 0. Defaults to 100. + in: query + name: limit + schema: + default: 100 + format: int32 + maximum: 2147483647 + minimum: 1 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + annotated_interactions: + - annotations: + - created_at: "0001-01-01T00:00:00Z" + created_by: "00000000-0000-0000-0000-000000000002" + id: annotation-789 + interaction_id: interaction-456 + label_values: + quality: good + modified_at: "0001-01-01T00:00:00Z" + modified_by: "00000000-0000-0000-0000-000000000002" + content_id: trace-abc-123 + created_at: "2025-06-01T12:00:00Z" + id: interaction-456 + modified_at: "2025-06-01T12:00:00Z" + queue_id: queue-uuid-001 + queue_name: My Annotation Queue + type: trace + total_count: 1 + id: trace-query + type: annotated_interactions_by_trace + schema: + $ref: "#/components/schemas/LLMObsAnnotatedInteractionsByTraceResponse" + 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 + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get annotated interactions by content IDs + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/llm-obs/v1/annotation-queues: get: description: |- diff --git a/examples/v2/llm-observability/GetLLMObsAnnotatedInteractionsByTraceIDs.ts b/examples/v2/llm-observability/GetLLMObsAnnotatedInteractionsByTraceIDs.ts new file mode 100644 index 000000000000..34b66e8c1b1f --- /dev/null +++ b/examples/v2/llm-observability/GetLLMObsAnnotatedInteractionsByTraceIDs.ts @@ -0,0 +1,25 @@ +/** + * Get annotated interactions by content IDs returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations[ + "v2.getLLMObsAnnotatedInteractionsByTraceIDs" +] = true; +const apiInstance = new v2.LLMObservabilityApi(configuration); + +const params: v2.LLMObservabilityApiGetLLMObsAnnotatedInteractionsByTraceIDsRequest = + { + contentIds: [], + }; + +apiInstance + .getLLMObsAnnotatedInteractionsByTraceIDs(params) + .then((data: v2.LLMObsAnnotatedInteractionsByTraceResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 0b301beaeabc..7aec55ed945d 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -2582,6 +2582,21 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "LLMObsDataDeletionResponse", }, + "v2.GetLLMObsAnnotatedInteractionsByTraceIDs": { + "contentIds": { + "type": "Array", + "format": "", + }, + "offset": { + "type": "number", + "format": "int32", + }, + "limit": { + "type": "number", + "format": "int32", + }, + "operationResponseType": "LLMObsAnnotatedInteractionsByTraceResponse", + }, "v2.ListLLMObsAnnotationQueues": { "projectId": { "type": "string", diff --git a/features/v2/llm_observability.feature b/features/v2/llm_observability.feature index 0e1a7e984fa0..d21a1f8048c5 100644 --- a/features/v2/llm_observability.feature +++ b/features/v2/llm_observability.feature @@ -441,6 +441,22 @@ Feature: LLM Observability 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 + And new "GetLLMObsAnnotatedInteractionsByTraceIDs" request + And request contains "contentIds" 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 annotated interactions by content IDs returns "OK" response + Given operation "GetLLMObsAnnotatedInteractionsByTraceIDs" enabled + And new "GetLLMObsAnnotatedInteractionsByTraceIDs" request + And request contains "contentIds" 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 queue interactions returns "Bad Request" response Given operation "GetLLMObsAnnotatedInteractions" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index 7a8309d2ceff..e93351a7e237 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3704,6 +3704,12 @@ "type": "unsafe" } }, + "GetLLMObsAnnotatedInteractionsByTraceIDs": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, "ListLLMObsAnnotationQueues": { "tag": "LLM Observability", "undo": { diff --git a/packages/datadog-api-client-common/configuration.ts b/packages/datadog-api-client-common/configuration.ts index 4de4396e588c..66af0b21cc73 100644 --- a/packages/datadog-api-client-common/configuration.ts +++ b/packages/datadog-api-client-common/configuration.ts @@ -258,6 +258,7 @@ export function createConfiguration( "v2.deleteLLMObsExperiments": false, "v2.deleteLLMObsProjects": false, "v2.getLLMObsAnnotatedInteractions": false, + "v2.getLLMObsAnnotatedInteractionsByTraceIDs": false, "v2.getLLMObsAnnotationQueueLabelSchema": false, "v2.getLLMObsCustomEvalConfig": false, "v2.listLLMObsAnnotationQueues": false, diff --git a/packages/datadog-api-client-v2/apis/LLMObservabilityApi.ts b/packages/datadog-api-client-v2/apis/LLMObservabilityApi.ts index e08a037be866..3c8233968588 100644 --- a/packages/datadog-api-client-v2/apis/LLMObservabilityApi.ts +++ b/packages/datadog-api-client-v2/apis/LLMObservabilityApi.ts @@ -18,6 +18,7 @@ import { ApiException } from "../../datadog-api-client-common/exception"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { JSONAPIErrorResponse } from "../models/JSONAPIErrorResponse"; +import { LLMObsAnnotatedInteractionsByTraceResponse } from "../models/LLMObsAnnotatedInteractionsByTraceResponse"; import { LLMObsAnnotatedInteractionsResponse } from "../models/LLMObsAnnotatedInteractionsResponse"; import { LLMObsAnnotationQueueInteractionsRequest } from "../models/LLMObsAnnotationQueueInteractionsRequest"; import { LLMObsAnnotationQueueInteractionsResponse } from "../models/LLMObsAnnotationQueueInteractionsResponse"; @@ -1035,6 +1036,77 @@ export class LLMObservabilityApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async getLLMObsAnnotatedInteractionsByTraceIDs( + contentIds: Array, + offset?: number, + limit?: number, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn( + "Using unstable operation 'getLLMObsAnnotatedInteractionsByTraceIDs'" + ); + if ( + !_config.unstableOperations["v2.getLLMObsAnnotatedInteractionsByTraceIDs"] + ) { + throw new Error( + "Unstable operation 'getLLMObsAnnotatedInteractionsByTraceIDs' is disabled" + ); + } + + // verify required parameter 'contentIds' is not null or undefined + if (contentIds === null || contentIds === undefined) { + throw new RequiredError( + "contentIds", + "getLLMObsAnnotatedInteractionsByTraceIDs" + ); + } + + // Path Params + const localVarPath = "/api/v2/llm-obs/v1/annotated-interactions"; + + // Make Request Context + const requestContext = _config + .getServer( + "v2.LLMObservabilityApi.getLLMObsAnnotatedInteractionsByTraceIDs" + ) + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (contentIds !== undefined) { + requestContext.setQueryParam( + "contentIds", + ObjectSerializer.serialize(contentIds, "Array", ""), + "multi" + ); + } + if (offset !== undefined) { + requestContext.setQueryParam( + "offset", + ObjectSerializer.serialize(offset, "number", "int32"), + "" + ); + } + if (limit !== undefined) { + requestContext.setQueryParam( + "limit", + ObjectSerializer.serialize(limit, "number", "int32"), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async getLLMObsAnnotationQueueLabelSchema( queueId: string, _options?: Configuration @@ -3777,6 +3849,94 @@ export class LLMObservabilityApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getLLMObsAnnotatedInteractionsByTraceIDs + * @throws ApiException if the response code was not in [200, 299] + */ + public async getLLMObsAnnotatedInteractionsByTraceIDs( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: LLMObsAnnotatedInteractionsByTraceResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "LLMObsAnnotatedInteractionsByTraceResponse" + ) as LLMObsAnnotatedInteractionsByTraceResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 500 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: LLMObsAnnotatedInteractionsByTraceResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "LLMObsAnnotatedInteractionsByTraceResponse", + "" + ) as LLMObsAnnotatedInteractionsByTraceResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -5786,6 +5946,24 @@ export interface LLMObservabilityApiGetLLMObsAnnotatedInteractionsRequest { queueId: string; } +export interface LLMObservabilityApiGetLLMObsAnnotatedInteractionsByTraceIDsRequest { + /** + * One or more content IDs to retrieve annotated interactions for. At least one is required. + * @type Array + */ + contentIds: Array; + /** + * Pagination offset. Must be >= 0. Defaults to 0. + * @type number + */ + offset?: number; + /** + * Maximum number of results to return. Must be > 0. Defaults to 100. + * @type number + */ + limit?: number; +} + export interface LLMObservabilityApiGetLLMObsAnnotationQueueLabelSchemaRequest { /** * The ID of the LLM Observability annotation queue. @@ -6593,6 +6771,32 @@ export class LLMObservabilityApi { }); } + /** + * Returns annotated interactions across all annotation queues for the given content IDs. Results include queue metadata (ID and name) for each interaction. + * @param param The request object + */ + public getLLMObsAnnotatedInteractionsByTraceIDs( + param: LLMObservabilityApiGetLLMObsAnnotatedInteractionsByTraceIDsRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.getLLMObsAnnotatedInteractionsByTraceIDs( + param.contentIds, + param.offset, + param.limit, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getLLMObsAnnotatedInteractionsByTraceIDs( + responseContext + ); + }); + }); + } + /** * Retrieve the label schema for a given annotation queue. * @param param The request object diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index aed4b25f94e7..2b849cbe2fbb 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -685,6 +685,7 @@ export { LLMObservabilityApiDeleteLLMObsExperimentsRequest, LLMObservabilityApiDeleteLLMObsProjectsRequest, LLMObservabilityApiGetLLMObsAnnotatedInteractionsRequest, + LLMObservabilityApiGetLLMObsAnnotatedInteractionsByTraceIDsRequest, LLMObservabilityApiGetLLMObsAnnotationQueueLabelSchemaRequest, LLMObservabilityApiGetLLMObsCustomEvalConfigRequest, LLMObservabilityApiListLLMObsAnnotationQueuesRequest, @@ -4085,7 +4086,12 @@ export { ListTeamsInclude } from "./models/ListTeamsInclude"; export { ListTeamsSort } from "./models/ListTeamsSort"; export { ListVulnerabilitiesResponse } from "./models/ListVulnerabilitiesResponse"; export { ListVulnerableAssetsResponse } from "./models/ListVulnerableAssetsResponse"; +export { LLMObsAnnotatedInteractionByTraceItem } from "./models/LLMObsAnnotatedInteractionByTraceItem"; export { LLMObsAnnotatedInteractionItem } from "./models/LLMObsAnnotatedInteractionItem"; +export { LLMObsAnnotatedInteractionsByTraceDataAttributesResponse } from "./models/LLMObsAnnotatedInteractionsByTraceDataAttributesResponse"; +export { LLMObsAnnotatedInteractionsByTraceDataResponse } from "./models/LLMObsAnnotatedInteractionsByTraceDataResponse"; +export { LLMObsAnnotatedInteractionsByTraceResponse } from "./models/LLMObsAnnotatedInteractionsByTraceResponse"; +export { LLMObsAnnotatedInteractionsByTraceType } from "./models/LLMObsAnnotatedInteractionsByTraceType"; export { LLMObsAnnotatedInteractionsDataAttributesResponse } from "./models/LLMObsAnnotatedInteractionsDataAttributesResponse"; export { LLMObsAnnotatedInteractionsDataResponse } from "./models/LLMObsAnnotatedInteractionsDataResponse"; export { LLMObsAnnotatedInteractionsResponse } from "./models/LLMObsAnnotatedInteractionsResponse"; @@ -4122,6 +4128,7 @@ export { LLMObsAnthropicEffort } from "./models/LLMObsAnthropicEffort"; export { LLMObsAnthropicMetadata } from "./models/LLMObsAnthropicMetadata"; export { LLMObsAnthropicThinkingConfig } from "./models/LLMObsAnthropicThinkingConfig"; export { LLMObsAnthropicThinkingType } from "./models/LLMObsAnthropicThinkingType"; +export { LLMObsAnyInteractionType } from "./models/LLMObsAnyInteractionType"; export { LLMObsAzureOpenAIMetadata } from "./models/LLMObsAzureOpenAIMetadata"; export { LLMObsBedrockMetadata } from "./models/LLMObsBedrockMetadata"; export { LLMObsContentBlock } from "./models/LLMObsContentBlock"; diff --git a/packages/datadog-api-client-v2/models/LLMObsAnnotatedInteractionByTraceItem.ts b/packages/datadog-api-client-v2/models/LLMObsAnnotatedInteractionByTraceItem.ts new file mode 100644 index 000000000000..096cd5097a59 --- /dev/null +++ b/packages/datadog-api-client-v2/models/LLMObsAnnotatedInteractionByTraceItem.ts @@ -0,0 +1,130 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { LLMObsAnnotationItem } from "./LLMObsAnnotationItem"; +import { LLMObsAnyInteractionType } from "./LLMObsAnyInteractionType"; +import { LLMObsContentBlock } from "./LLMObsContentBlock"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * An annotated interaction returned by the cross-queue lookup, including the source queue metadata. + */ +export class LLMObsAnnotatedInteractionByTraceItem { + /** + * List of annotations for this interaction. + */ + "annotations": Array; + /** + * Upstream entity identifier (trace ID, session ID, or deterministic display_block ID). + */ + "contentId": string; + /** + * Timestamp when the interaction was added to the queue. + */ + "createdAt": Date; + /** + * List of content blocks that make up a `display_block` interaction. + * Must contain at least one block. + */ + "displayBlock"?: Array; + /** + * Unique identifier of the interaction. + */ + "id": string; + /** + * Timestamp when the interaction was last updated. + */ + "modifiedAt": Date; + /** + * Identifier of the annotation queue this interaction belongs to. + */ + "queueId": string; + /** + * Name of the annotation queue this interaction belongs to. + */ + "queueName": string; + /** + * Type of an annotated interaction. + */ + "type": LLMObsAnyInteractionType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + annotations: { + baseName: "annotations", + type: "Array", + required: true, + }, + contentId: { + baseName: "content_id", + type: "string", + required: true, + }, + createdAt: { + baseName: "created_at", + type: "Date", + required: true, + format: "date-time", + }, + displayBlock: { + baseName: "display_block", + type: "Array", + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + modifiedAt: { + baseName: "modified_at", + type: "Date", + required: true, + format: "date-time", + }, + queueId: { + baseName: "queue_id", + type: "string", + required: true, + }, + queueName: { + baseName: "queue_name", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "LLMObsAnyInteractionType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsAnnotatedInteractionByTraceItem.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/LLMObsAnnotatedInteractionsByTraceDataAttributesResponse.ts b/packages/datadog-api-client-v2/models/LLMObsAnnotatedInteractionsByTraceDataAttributesResponse.ts new file mode 100644 index 000000000000..9f028d16864f --- /dev/null +++ b/packages/datadog-api-client-v2/models/LLMObsAnnotatedInteractionsByTraceDataAttributesResponse.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { LLMObsAnnotatedInteractionByTraceItem } from "./LLMObsAnnotatedInteractionByTraceItem"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of the cross-queue annotated interactions response. + */ +export class LLMObsAnnotatedInteractionsByTraceDataAttributesResponse { + /** + * List of annotated interactions across all queues for the requested content IDs. + */ + "annotatedInteractions": Array; + /** + * Total number of annotated interactions matching the query. + */ + "totalCount": number; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + annotatedInteractions: { + baseName: "annotated_interactions", + type: "Array", + required: true, + }, + totalCount: { + baseName: "total_count", + type: "number", + required: true, + format: "int32", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsAnnotatedInteractionsByTraceDataAttributesResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/LLMObsAnnotatedInteractionsByTraceDataResponse.ts b/packages/datadog-api-client-v2/models/LLMObsAnnotatedInteractionsByTraceDataResponse.ts new file mode 100644 index 000000000000..8791f3a77a5d --- /dev/null +++ b/packages/datadog-api-client-v2/models/LLMObsAnnotatedInteractionsByTraceDataResponse.ts @@ -0,0 +1,73 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { LLMObsAnnotatedInteractionsByTraceDataAttributesResponse } from "./LLMObsAnnotatedInteractionsByTraceDataAttributesResponse"; +import { LLMObsAnnotatedInteractionsByTraceType } from "./LLMObsAnnotatedInteractionsByTraceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object for the cross-queue annotated interactions response. + */ +export class LLMObsAnnotatedInteractionsByTraceDataResponse { + /** + * Attributes of the cross-queue annotated interactions response. + */ + "attributes": LLMObsAnnotatedInteractionsByTraceDataAttributesResponse; + /** + * Opaque identifier for the response object. + */ + "id": string; + /** + * Resource type for cross-queue annotated interactions lookup. + */ + "type": LLMObsAnnotatedInteractionsByTraceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "LLMObsAnnotatedInteractionsByTraceDataAttributesResponse", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "LLMObsAnnotatedInteractionsByTraceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsAnnotatedInteractionsByTraceDataResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/LLMObsAnnotatedInteractionsByTraceResponse.ts b/packages/datadog-api-client-v2/models/LLMObsAnnotatedInteractionsByTraceResponse.ts new file mode 100644 index 000000000000..d33ee7330105 --- /dev/null +++ b/packages/datadog-api-client-v2/models/LLMObsAnnotatedInteractionsByTraceResponse.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { LLMObsAnnotatedInteractionsByTraceDataResponse } from "./LLMObsAnnotatedInteractionsByTraceDataResponse"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing annotated interactions across all queues for the requested content IDs. + */ +export class LLMObsAnnotatedInteractionsByTraceResponse { + /** + * Data object for the cross-queue annotated interactions response. + */ + "data": LLMObsAnnotatedInteractionsByTraceDataResponse; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "LLMObsAnnotatedInteractionsByTraceDataResponse", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LLMObsAnnotatedInteractionsByTraceResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/LLMObsAnnotatedInteractionsByTraceType.ts b/packages/datadog-api-client-v2/models/LLMObsAnnotatedInteractionsByTraceType.ts new file mode 100644 index 000000000000..a47dcdf14b95 --- /dev/null +++ b/packages/datadog-api-client-v2/models/LLMObsAnnotatedInteractionsByTraceType.ts @@ -0,0 +1,17 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Resource type for cross-queue annotated interactions lookup. + */ + +export type LLMObsAnnotatedInteractionsByTraceType = + | typeof ANNOTATED_INTERACTIONS_BY_TRACE + | UnparsedObject; +export const ANNOTATED_INTERACTIONS_BY_TRACE = + "annotated_interactions_by_trace"; diff --git a/packages/datadog-api-client-v2/models/LLMObsAnyInteractionType.ts b/packages/datadog-api-client-v2/models/LLMObsAnyInteractionType.ts new file mode 100644 index 000000000000..ec28c1db5d96 --- /dev/null +++ b/packages/datadog-api-client-v2/models/LLMObsAnyInteractionType.ts @@ -0,0 +1,22 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Type of an annotated interaction. + */ + +export type LLMObsAnyInteractionType = + | typeof TRACE + | typeof EXPERIMENT_TRACE + | typeof SESSION + | typeof DISPLAY_BLOCK + | UnparsedObject; +export const TRACE = "trace"; +export const EXPERIMENT_TRACE = "experiment_trace"; +export const SESSION = "session"; +export const DISPLAY_BLOCK = "display_block"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 27dcc54448f4..1ae37c251779 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -1936,6 +1936,10 @@ import { KindData } from "./KindData"; import { KindMetadata } from "./KindMetadata"; import { KindObj } from "./KindObj"; import { KindResponseMeta } from "./KindResponseMeta"; +import { LLMObsAnnotatedInteractionByTraceItem } from "./LLMObsAnnotatedInteractionByTraceItem"; +import { LLMObsAnnotatedInteractionsByTraceDataAttributesResponse } from "./LLMObsAnnotatedInteractionsByTraceDataAttributesResponse"; +import { LLMObsAnnotatedInteractionsByTraceDataResponse } from "./LLMObsAnnotatedInteractionsByTraceDataResponse"; +import { LLMObsAnnotatedInteractionsByTraceResponse } from "./LLMObsAnnotatedInteractionsByTraceResponse"; import { LLMObsAnnotatedInteractionsDataAttributesResponse } from "./LLMObsAnnotatedInteractionsDataAttributesResponse"; import { LLMObsAnnotatedInteractionsDataResponse } from "./LLMObsAnnotatedInteractionsDataResponse"; import { LLMObsAnnotatedInteractionsResponse } from "./LLMObsAnnotatedInteractionsResponse"; @@ -5400,11 +5404,18 @@ const enumsMap: { [key: string]: any[] } = { JiraIssueTemplateType: ["jira-issue-template"], JiraIssuesDataType: ["jira_issues"], JsonPatchOperationOp: ["add", "remove", "replace", "move", "copy", "test"], + LLMObsAnnotatedInteractionsByTraceType: ["annotated_interactions_by_trace"], LLMObsAnnotatedInteractionsType: ["annotated_interactions"], LLMObsAnnotationQueueInteractionsType: ["interactions"], LLMObsAnnotationQueueType: ["queues"], LLMObsAnthropicEffort: ["low", "medium", "high", "max"], LLMObsAnthropicThinkingType: ["enabled", "disabled", "adaptive"], + LLMObsAnyInteractionType: [ + "trace", + "experiment_trace", + "session", + "display_block", + ], LLMObsContentBlockHeaderLevel: ["sm", "md", "lg", "xl"], LLMObsContentBlockLLMObsTraceInteractionType: ["trace", "experiment_trace"], LLMObsContentBlockType: [ @@ -9194,6 +9205,13 @@ const typeMap: { [index: string]: any } = { KindMetadata: KindMetadata, KindObj: KindObj, KindResponseMeta: KindResponseMeta, + LLMObsAnnotatedInteractionByTraceItem: LLMObsAnnotatedInteractionByTraceItem, + LLMObsAnnotatedInteractionsByTraceDataAttributesResponse: + LLMObsAnnotatedInteractionsByTraceDataAttributesResponse, + LLMObsAnnotatedInteractionsByTraceDataResponse: + LLMObsAnnotatedInteractionsByTraceDataResponse, + LLMObsAnnotatedInteractionsByTraceResponse: + LLMObsAnnotatedInteractionsByTraceResponse, LLMObsAnnotatedInteractionsDataAttributesResponse: LLMObsAnnotatedInteractionsDataAttributesResponse, LLMObsAnnotatedInteractionsDataResponse: