diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9041f8a0039..5b3f25722be 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -38071,6 +38071,8 @@ components: LLMObsAnnotationQueueDataAttributesRequest: description: Attributes for creating an LLM Observability annotation queue. properties: + annotation_schema: + $ref: "#/components/schemas/LLMObsAnnotationSchema" description: description: Description of the annotation queue. example: "Queue for annotating customer support traces" @@ -38090,6 +38092,8 @@ components: LLMObsAnnotationQueueDataAttributesResponse: description: Attributes of an LLM Observability annotation queue. properties: + annotation_schema: + $ref: "#/components/schemas/LLMObsAnnotationSchema" created_at: description: Timestamp when the queue was created. example: "2024-01-15T10:30:00Z" @@ -38271,6 +38275,65 @@ components: type: string x-enum-varnames: - INTERACTIONS + LLMObsAnnotationQueueLabelSchemaAttributes: + description: Attributes of an annotation queue label schema. + properties: + annotation_schema: + $ref: "#/components/schemas/LLMObsAnnotationSchema" + required: + - annotation_schema + type: object + LLMObsAnnotationQueueLabelSchemaData: + description: Data object for an annotation queue label schema. + properties: + attributes: + $ref: "#/components/schemas/LLMObsAnnotationQueueLabelSchemaAttributes" + id: + description: Unique identifier of the annotation queue. + example: "b5e7f3a1-9c2d-4f8b-a1e6-3d7e9f0a2b4c" + type: string + type: + $ref: "#/components/schemas/LLMObsAnnotationQueueType" + required: + - id + - type + - attributes + type: object + LLMObsAnnotationQueueLabelSchemaResponse: + description: Response containing the label schema of an annotation queue. + properties: + data: + $ref: "#/components/schemas/LLMObsAnnotationQueueLabelSchemaData" + required: + - data + type: object + LLMObsAnnotationQueueLabelSchemaUpdateAttributes: + description: Attributes for updating an annotation queue label schema. + properties: + annotation_schema: + $ref: "#/components/schemas/LLMObsAnnotationSchema" + required: + - annotation_schema + type: object + LLMObsAnnotationQueueLabelSchemaUpdateData: + description: Data object for updating an annotation queue label schema. + properties: + attributes: + $ref: "#/components/schemas/LLMObsAnnotationQueueLabelSchemaUpdateAttributes" + type: + $ref: "#/components/schemas/LLMObsAnnotationQueueType" + required: + - type + - attributes + type: object + LLMObsAnnotationQueueLabelSchemaUpdateRequest: + description: Request to update the label schema of an annotation queue. + properties: + data: + $ref: "#/components/schemas/LLMObsAnnotationQueueLabelSchemaUpdateData" + required: + - data + type: object LLMObsAnnotationQueueRequest: description: Request to create an LLM Observability annotation queue. properties: @@ -38298,6 +38361,8 @@ components: LLMObsAnnotationQueueUpdateDataAttributesRequest: description: Attributes for updating an LLM Observability annotation queue. All fields are optional. properties: + annotation_schema: + $ref: "#/components/schemas/LLMObsAnnotationSchema" description: description: Updated description of the annotation queue. example: "Updated description" @@ -38337,6 +38402,17 @@ components: required: - data type: object + LLMObsAnnotationSchema: + description: Schema defining the labels for an annotation queue. + properties: + label_schemas: + description: List of label schema definitions. + items: + $ref: "#/components/schemas/LLMObsLabelSchema" + type: array + required: + - label_schemas + type: object LLMObsCursorMeta: description: Pagination cursor metadata. properties: @@ -39634,6 +39710,81 @@ components: x-enum-varnames: - TRACE - EXPERIMENT_TRACE + LLMObsLabelSchema: + description: Schema definition for a single label in an annotation queue. + properties: + description: + description: Description of the label. + example: "Rating of the response quality." + type: string + has_assessment: + description: Whether this label includes an assessment field. + example: false + type: boolean + has_reasoning: + description: Whether this label includes a reasoning field. + example: false + type: boolean + id: + description: Unique identifier of the label schema. Assigned by the server if not provided. + example: "ab12cd34" + type: string + is_assessment: + description: Whether the boolean label represents an assessment. Requires `has_assessment` to be true. + example: false + type: boolean + is_integer: + description: Whether score values must be integers. Applicable to score-type labels. + example: false + type: boolean + is_required: + description: Whether this label is required for an annotation. + example: true + type: boolean + max: + description: Maximum value for score-type labels. + example: 5.0 + format: double + type: number + min: + description: Minimum value for score-type labels. + example: 0.0 + format: double + type: number + name: + description: Name of the label. Must match the pattern `^[a-zA-Z0-9_-]+$` and be unique within the queue. + example: "quality" + type: string + type: + $ref: "#/components/schemas/LLMObsLabelSchemaType" + values: + description: Allowed values for categorical-type labels. Must contain at least one non-empty, unique value. + example: + - "good" + - "bad" + - "neutral" + items: + description: An allowed value for a categorical label. + type: string + type: array + required: + - name + - type + type: object + LLMObsLabelSchemaType: + description: Type of a label in an annotation queue label schema. + enum: + - score + - categorical + - boolean + - text + example: score + type: string + x-enum-varnames: + - SCORE + - CATEGORICAL + - BOOLEAN + - TEXT LLMObsMetricAssessment: description: Assessment result for an LLM Observability experiment metric. enum: @@ -103821,8 +103972,10 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). post: description: |- - Create a new annotation queue. Only `name`, `project_id`, and `description` are accepted. - Fields such as `created_by`, `owned_by`, `created_at`, `modified_by`, and `modified_at` are inferred by the backend. + Create an annotation queue. The `name` and `project_id` fields are required. + An optional `annotation_schema` can be provided to define the labels for the queue. + Fields such as `created_by`, `owned_by`, `created_at`, `modified_by`, + and `modified_at` are inferred by the backend. operationId: CreateLLMObsAnnotationQueue requestBody: content: @@ -103836,6 +103989,28 @@ paths: name: My annotation queue project_id: a33671aa-24fd-4dcd-9b33-a8ec7dde7751 type: queues + with_schema: + summary: Create queue with annotation schema + value: + data: + attributes: + annotation_schema: + label_schemas: + - is_required: true + max: 5.0 + min: 0.0 + name: quality + type: score + - name: sentiment + type: categorical + values: + - positive + - negative + - neutral + description: Queue for annotating customer support traces + name: My annotation queue + project_id: a33671aa-24fd-4dcd-9b33-a8ec7dde7751 + type: queues schema: $ref: "#/components/schemas/LLMObsAnnotationQueueRequest" description: Create annotation queue payload. @@ -103916,7 +104091,7 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). patch: description: |- - Partially update an annotation queue. Only `name` and `description` can be updated. + Partially update an annotation queue. The `name`, `description`, and `annotation_schema` fields can be updated. operationId: UpdateLLMObsAnnotationQueue parameters: - $ref: "#/components/parameters/LLMObsAnnotationQueueIDPathParameter" @@ -104151,6 +104326,206 @@ 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}/label-schema: + get: + description: Retrieve the label schema for a given annotation queue. + operationId: GetLLMObsAnnotationQueueLabelSchema + parameters: + - $ref: "#/components/parameters/LLMObsAnnotationQueueIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + annotation_schema: + label_schemas: + - id: "ab12cd34" + is_required: true + max: 5.0 + min: 0.0 + name: quality + type: score + - id: "ef56gh78" + name: sentiment + type: categorical + values: + - positive + - negative + - neutral + id: "b5e7f3a1-9c2d-4f8b-a1e6-3d7e9f0a2b4c" + type: queues + schema: + $ref: "#/components/schemas/LLMObsAnnotationQueueLabelSchemaResponse" + description: OK + "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" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get annotation queue label schema + 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/). + put: + description: |- + Create or replace the label schema for a given annotation queue. + The label schema defines the labels annotators can apply to interactions in the queue. + Label names must be unique within the queue and match the pattern `^[a-zA-Z0-9_-]+$`. + Each label must have a valid type: score, categorical, boolean, or text. + operationId: UpdateLLMObsAnnotationQueueLabelSchema + parameters: + - $ref: "#/components/parameters/LLMObsAnnotationQueueIDPathParameter" + requestBody: + content: + application/json: + examples: + boolean_label: + summary: Boolean label schema + value: + data: + attributes: + annotation_schema: + label_schemas: + - has_assessment: true + is_assessment: true + is_required: true + name: is_correct + type: boolean + type: queues + categorical_label: + summary: Categorical label schema + value: + data: + attributes: + annotation_schema: + label_schemas: + - is_required: true + name: sentiment + type: categorical + values: + - positive + - negative + - neutral + type: queues + default: + value: + data: + attributes: + annotation_schema: + label_schemas: + - is_required: true + max: 5.0 + min: 0.0 + name: quality + type: score + type: queues + score_label: + summary: Score label schema + value: + data: + attributes: + annotation_schema: + label_schemas: + - has_reasoning: true + is_required: true + max: 5.0 + min: 0.0 + name: quality + type: score + type: queues + text_label: + summary: Text label schema + value: + data: + attributes: + annotation_schema: + label_schemas: + - is_required: false + name: feedback + type: text + type: queues + schema: + $ref: "#/components/schemas/LLMObsAnnotationQueueLabelSchemaUpdateRequest" + description: Update label schema payload. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/LLMObsAnnotationQueueLabelSchemaResponse" + 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" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update annotation queue label schema + 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/experiments: get: description: List all LLM Observability experiments sorted by creation date, newest first. diff --git a/examples/v2/llm-observability/CreateLLMObsAnnotationQueue.java b/examples/v2/llm-observability/CreateLLMObsAnnotationQueue.java index c2d025904af..6addd81882b 100644 --- a/examples/v2/llm-observability/CreateLLMObsAnnotationQueue.java +++ b/examples/v2/llm-observability/CreateLLMObsAnnotationQueue.java @@ -8,6 +8,11 @@ import com.datadog.api.client.v2.model.LLMObsAnnotationQueueRequest; import com.datadog.api.client.v2.model.LLMObsAnnotationQueueResponse; import com.datadog.api.client.v2.model.LLMObsAnnotationQueueType; +import com.datadog.api.client.v2.model.LLMObsAnnotationSchema; +import com.datadog.api.client.v2.model.LLMObsLabelSchema; +import com.datadog.api.client.v2.model.LLMObsLabelSchemaType; +import java.util.Arrays; +import java.util.Collections; public class Example { public static void main(String[] args) { @@ -21,6 +26,22 @@ public static void main(String[] args) { new LLMObsAnnotationQueueDataRequest() .attributes( new LLMObsAnnotationQueueDataAttributesRequest() + .annotationSchema( + new LLMObsAnnotationSchema() + .labelSchemas( + Collections.singletonList( + new LLMObsLabelSchema() + .description("Rating of the response quality.") + .hasAssessment(false) + .hasReasoning(false) + .id("ab12cd34") + .isAssessment(false) + .isInteger(false) + .isRequired(true) + .max(5.0) + .name("quality") + .type(LLMObsLabelSchemaType.SCORE) + .values(Arrays.asList("good", "bad", "neutral"))))) .description("Queue for annotating customer support traces") .name("My annotation queue") .projectId("a33671aa-24fd-4dcd-9b33-a8ec7dde7751")) diff --git a/examples/v2/llm-observability/GetLLMObsAnnotationQueueLabelSchema.java b/examples/v2/llm-observability/GetLLMObsAnnotationQueueLabelSchema.java new file mode 100644 index 00000000000..f412531bf89 --- /dev/null +++ b/examples/v2/llm-observability/GetLLMObsAnnotationQueueLabelSchema.java @@ -0,0 +1,27 @@ +// Get annotation queue label schema returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.LlmObservabilityApi; +import com.datadog.api.client.v2.model.LLMObsAnnotationQueueLabelSchemaResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getLLMObsAnnotationQueueLabelSchema", true); + LlmObservabilityApi apiInstance = new LlmObservabilityApi(defaultClient); + + try { + LLMObsAnnotationQueueLabelSchemaResponse result = + apiInstance.getLLMObsAnnotationQueueLabelSchema("b5e7f3a1-9c2d-4f8b-a1e6-3d7e9f0a2b4c"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling LlmObservabilityApi#getLLMObsAnnotationQueueLabelSchema"); + 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/examples/v2/llm-observability/UpdateLLMObsAnnotationQueue.java b/examples/v2/llm-observability/UpdateLLMObsAnnotationQueue.java index dc73e9f8df9..c4eb9dffd47 100644 --- a/examples/v2/llm-observability/UpdateLLMObsAnnotationQueue.java +++ b/examples/v2/llm-observability/UpdateLLMObsAnnotationQueue.java @@ -8,6 +8,11 @@ import com.datadog.api.client.v2.model.LLMObsAnnotationQueueUpdateDataAttributesRequest; import com.datadog.api.client.v2.model.LLMObsAnnotationQueueUpdateDataRequest; import com.datadog.api.client.v2.model.LLMObsAnnotationQueueUpdateRequest; +import com.datadog.api.client.v2.model.LLMObsAnnotationSchema; +import com.datadog.api.client.v2.model.LLMObsLabelSchema; +import com.datadog.api.client.v2.model.LLMObsLabelSchemaType; +import java.util.Arrays; +import java.util.Collections; public class Example { public static void main(String[] args) { @@ -21,6 +26,22 @@ public static void main(String[] args) { new LLMObsAnnotationQueueUpdateDataRequest() .attributes( new LLMObsAnnotationQueueUpdateDataAttributesRequest() + .annotationSchema( + new LLMObsAnnotationSchema() + .labelSchemas( + Collections.singletonList( + new LLMObsLabelSchema() + .description("Rating of the response quality.") + .hasAssessment(false) + .hasReasoning(false) + .id("ab12cd34") + .isAssessment(false) + .isInteger(false) + .isRequired(true) + .max(5.0) + .name("quality") + .type(LLMObsLabelSchemaType.SCORE) + .values(Arrays.asList("good", "bad", "neutral"))))) .description("Updated description") .name("Updated queue name")) .type(LLMObsAnnotationQueueType.QUEUES)); diff --git a/examples/v2/llm-observability/UpdateLLMObsAnnotationQueueLabelSchema.java b/examples/v2/llm-observability/UpdateLLMObsAnnotationQueueLabelSchema.java new file mode 100644 index 00000000000..689b49dbf82 --- /dev/null +++ b/examples/v2/llm-observability/UpdateLLMObsAnnotationQueueLabelSchema.java @@ -0,0 +1,61 @@ +// Update annotation queue label schema returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.LlmObservabilityApi; +import com.datadog.api.client.v2.model.LLMObsAnnotationQueueLabelSchemaResponse; +import com.datadog.api.client.v2.model.LLMObsAnnotationQueueLabelSchemaUpdateAttributes; +import com.datadog.api.client.v2.model.LLMObsAnnotationQueueLabelSchemaUpdateData; +import com.datadog.api.client.v2.model.LLMObsAnnotationQueueLabelSchemaUpdateRequest; +import com.datadog.api.client.v2.model.LLMObsAnnotationQueueType; +import com.datadog.api.client.v2.model.LLMObsAnnotationSchema; +import com.datadog.api.client.v2.model.LLMObsLabelSchema; +import com.datadog.api.client.v2.model.LLMObsLabelSchemaType; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateLLMObsAnnotationQueueLabelSchema", true); + LlmObservabilityApi apiInstance = new LlmObservabilityApi(defaultClient); + + LLMObsAnnotationQueueLabelSchemaUpdateRequest body = + new LLMObsAnnotationQueueLabelSchemaUpdateRequest() + .data( + new LLMObsAnnotationQueueLabelSchemaUpdateData() + .attributes( + new LLMObsAnnotationQueueLabelSchemaUpdateAttributes() + .annotationSchema( + new LLMObsAnnotationSchema() + .labelSchemas( + Collections.singletonList( + new LLMObsLabelSchema() + .description("Rating of the response quality.") + .hasAssessment(false) + .hasReasoning(false) + .id("ab12cd34") + .isAssessment(false) + .isInteger(false) + .isRequired(true) + .max(5.0) + .name("quality") + .type(LLMObsLabelSchemaType.SCORE) + .values(Arrays.asList("good", "bad", "neutral")))))) + .type(LLMObsAnnotationQueueType.QUEUES)); + + try { + LLMObsAnnotationQueueLabelSchemaResponse result = + apiInstance.updateLLMObsAnnotationQueueLabelSchema( + "b5e7f3a1-9c2d-4f8b-a1e6-3d7e9f0a2b4c", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling LlmObservabilityApi#updateLLMObsAnnotationQueueLabelSchema"); + 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 699b6df241c..376f4ed086c 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -788,6 +788,7 @@ public class ApiClient { put("v2.deleteLLMObsExperiments", false); put("v2.deleteLLMObsProjects", false); put("v2.getLLMObsAnnotatedInteractions", false); + put("v2.getLLMObsAnnotationQueueLabelSchema", false); put("v2.getLLMObsCustomEvalConfig", false); put("v2.listLLMObsAnnotationQueues", false); put("v2.listLLMObsDatasetRecords", false); @@ -795,6 +796,7 @@ public class ApiClient { put("v2.listLLMObsExperiments", false); put("v2.listLLMObsProjects", false); put("v2.updateLLMObsAnnotationQueue", false); + put("v2.updateLLMObsAnnotationQueueLabelSchema", false); put("v2.updateLLMObsCustomEvalConfig", false); put("v2.updateLLMObsDataset", false); put("v2.updateLLMObsDatasetRecords", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/LlmObservabilityApi.java b/src/main/java/com/datadog/api/client/v2/api/LlmObservabilityApi.java index 92ca069b35b..54f49f0c6da 100644 --- a/src/main/java/com/datadog/api/client/v2/api/LlmObservabilityApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/LlmObservabilityApi.java @@ -7,6 +7,8 @@ import com.datadog.api.client.v2.model.LLMObsAnnotatedInteractionsResponse; import com.datadog.api.client.v2.model.LLMObsAnnotationQueueInteractionsRequest; import com.datadog.api.client.v2.model.LLMObsAnnotationQueueInteractionsResponse; +import com.datadog.api.client.v2.model.LLMObsAnnotationQueueLabelSchemaResponse; +import com.datadog.api.client.v2.model.LLMObsAnnotationQueueLabelSchemaUpdateRequest; import com.datadog.api.client.v2.model.LLMObsAnnotationQueueRequest; import com.datadog.api.client.v2.model.LLMObsAnnotationQueueResponse; import com.datadog.api.client.v2.model.LLMObsAnnotationQueueUpdateRequest; @@ -106,10 +108,10 @@ public CompletableFuture createLLMObsAnnotationQu } /** - * Create a new annotation queue. Only name, project_id, and - * description are accepted. Fields such as created_by, owned_by, - * created_at, modified_by, and modified_at are inferred by - * the backend. + * Create an annotation queue. The name and project_id fields are + * required. An optional annotation_schema can be provided to define the labels for + * the queue. Fields such as created_by, owned_by, created_at + * , modified_by, and modified_at are inferred by the backend. * * @param body Create annotation queue payload. (required) * @return ApiResponse<LLMObsAnnotationQueueResponse> @@ -2621,6 +2623,169 @@ public CompletableFuture getLLMObsAnnotated new GenericType() {}); } + /** + * Get annotation queue label schema. + * + *

See {@link #getLLMObsAnnotationQueueLabelSchemaWithHttpInfo}. + * + * @param queueId The ID of the LLM Observability annotation queue. (required) + * @return LLMObsAnnotationQueueLabelSchemaResponse + * @throws ApiException if fails to make API call + */ + public LLMObsAnnotationQueueLabelSchemaResponse getLLMObsAnnotationQueueLabelSchema( + String queueId) throws ApiException { + return getLLMObsAnnotationQueueLabelSchemaWithHttpInfo(queueId).getData(); + } + + /** + * Get annotation queue label schema. + * + *

See {@link #getLLMObsAnnotationQueueLabelSchemaWithHttpInfoAsync}. + * + * @param queueId The ID of the LLM Observability annotation queue. (required) + * @return CompletableFuture<LLMObsAnnotationQueueLabelSchemaResponse> + */ + public CompletableFuture + getLLMObsAnnotationQueueLabelSchemaAsync(String queueId) { + return getLLMObsAnnotationQueueLabelSchemaWithHttpInfoAsync(queueId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieve the label schema for a given annotation queue. + * + * @param queueId The ID of the LLM Observability annotation queue. (required) + * @return ApiResponse<LLMObsAnnotationQueueLabelSchemaResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
500 Internal Server Error -
+ */ + public ApiResponse + getLLMObsAnnotationQueueLabelSchemaWithHttpInfo(String queueId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getLLMObsAnnotationQueueLabelSchema"; + 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" + + " getLLMObsAnnotationQueueLabelSchema"); + } + // create path and map variables + String localVarPath = + "/api/v2/llm-obs/v1/annotation-queues/{queue_id}/label-schema" + .replaceAll("\\{" + "queue_id" + "\\}", apiClient.escapeString(queueId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.LlmObservabilityApi.getLLMObsAnnotationQueueLabelSchema", + 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 annotation queue label schema. + * + *

See {@link #getLLMObsAnnotationQueueLabelSchemaWithHttpInfo}. + * + * @param queueId The ID of the LLM Observability annotation queue. (required) + * @return CompletableFuture<ApiResponse<LLMObsAnnotationQueueLabelSchemaResponse>> + */ + public CompletableFuture> + getLLMObsAnnotationQueueLabelSchemaWithHttpInfoAsync(String queueId) { + // Check if unstable operation is enabled + String operationId = "getLLMObsAnnotationQueueLabelSchema"; + 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" + + " getLLMObsAnnotationQueueLabelSchema")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/llm-obs/v1/annotation-queues/{queue_id}/label-schema" + .replaceAll("\\{" + "queue_id" + "\\}", apiClient.escapeString(queueId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.LlmObservabilityApi.getLLMObsAnnotationQueueLabelSchema", + 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 a custom evaluator configuration. * @@ -4068,8 +4233,8 @@ public CompletableFuture updateLLMObsAnnotationQu } /** - * Partially update an annotation queue. Only name and description can - * be updated. + * Partially update an annotation queue. The name, description, and + * annotation_schema fields can be updated. * * @param queueId The ID of the LLM Observability annotation queue. (required) * @param body Update annotation queue payload. (required) @@ -4217,6 +4382,200 @@ public ApiResponse updateLLMObsAnnotationQueueWit new GenericType() {}); } + /** + * Update annotation queue label schema. + * + *

See {@link #updateLLMObsAnnotationQueueLabelSchemaWithHttpInfo}. + * + * @param queueId The ID of the LLM Observability annotation queue. (required) + * @param body Update label schema payload. (required) + * @return LLMObsAnnotationQueueLabelSchemaResponse + * @throws ApiException if fails to make API call + */ + public LLMObsAnnotationQueueLabelSchemaResponse updateLLMObsAnnotationQueueLabelSchema( + String queueId, LLMObsAnnotationQueueLabelSchemaUpdateRequest body) throws ApiException { + return updateLLMObsAnnotationQueueLabelSchemaWithHttpInfo(queueId, body).getData(); + } + + /** + * Update annotation queue label schema. + * + *

See {@link #updateLLMObsAnnotationQueueLabelSchemaWithHttpInfoAsync}. + * + * @param queueId The ID of the LLM Observability annotation queue. (required) + * @param body Update label schema payload. (required) + * @return CompletableFuture<LLMObsAnnotationQueueLabelSchemaResponse> + */ + public CompletableFuture + updateLLMObsAnnotationQueueLabelSchemaAsync( + String queueId, LLMObsAnnotationQueueLabelSchemaUpdateRequest body) { + return updateLLMObsAnnotationQueueLabelSchemaWithHttpInfoAsync(queueId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create or replace the label schema for a given annotation queue. The label schema defines the + * labels annotators can apply to interactions in the queue. Label names must be unique within the + * queue and match the pattern ^[a-zA-Z0-9_-]+$. Each label must have a valid type: + * score, categorical, boolean, or text. + * + * @param queueId The ID of the LLM Observability annotation queue. (required) + * @param body Update label schema payload. (required) + * @return ApiResponse<LLMObsAnnotationQueueLabelSchemaResponse> + * @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 -
500 Internal Server Error -
+ */ + public ApiResponse + updateLLMObsAnnotationQueueLabelSchemaWithHttpInfo( + String queueId, LLMObsAnnotationQueueLabelSchemaUpdateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateLLMObsAnnotationQueueLabelSchema"; + 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 = body; + + // verify the required parameter 'queueId' is set + if (queueId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'queueId' when calling" + + " updateLLMObsAnnotationQueueLabelSchema"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " updateLLMObsAnnotationQueueLabelSchema"); + } + // create path and map variables + String localVarPath = + "/api/v2/llm-obs/v1/annotation-queues/{queue_id}/label-schema" + .replaceAll("\\{" + "queue_id" + "\\}", apiClient.escapeString(queueId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.LlmObservabilityApi.updateLLMObsAnnotationQueueLabelSchema", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update annotation queue label schema. + * + *

See {@link #updateLLMObsAnnotationQueueLabelSchemaWithHttpInfo}. + * + * @param queueId The ID of the LLM Observability annotation queue. (required) + * @param body Update label schema payload. (required) + * @return CompletableFuture<ApiResponse<LLMObsAnnotationQueueLabelSchemaResponse>> + */ + public CompletableFuture> + updateLLMObsAnnotationQueueLabelSchemaWithHttpInfoAsync( + String queueId, LLMObsAnnotationQueueLabelSchemaUpdateRequest body) { + // Check if unstable operation is enabled + String operationId = "updateLLMObsAnnotationQueueLabelSchema"; + 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 = body; + + // 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" + + " updateLLMObsAnnotationQueueLabelSchema")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " updateLLMObsAnnotationQueueLabelSchema")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/llm-obs/v1/annotation-queues/{queue_id}/label-schema" + .replaceAll("\\{" + "queue_id" + "\\}", apiClient.escapeString(queueId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.LlmObservabilityApi.updateLLMObsAnnotationQueueLabelSchema", + 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( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Create or update a custom evaluator configuration. * diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueDataAttributesRequest.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueDataAttributesRequest.java index ff47dd0ec1a..b2d13e56bf6 100644 --- a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueDataAttributesRequest.java +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueDataAttributesRequest.java @@ -19,6 +19,7 @@ /** Attributes for creating an LLM Observability annotation queue. */ @JsonPropertyOrder({ + LLMObsAnnotationQueueDataAttributesRequest.JSON_PROPERTY_ANNOTATION_SCHEMA, LLMObsAnnotationQueueDataAttributesRequest.JSON_PROPERTY_DESCRIPTION, LLMObsAnnotationQueueDataAttributesRequest.JSON_PROPERTY_NAME, LLMObsAnnotationQueueDataAttributesRequest.JSON_PROPERTY_PROJECT_ID @@ -27,6 +28,9 @@ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class LLMObsAnnotationQueueDataAttributesRequest { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ANNOTATION_SCHEMA = "annotation_schema"; + private LLMObsAnnotationSchema annotationSchema; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; @@ -46,6 +50,29 @@ public LLMObsAnnotationQueueDataAttributesRequest( this.projectId = projectId; } + public LLMObsAnnotationQueueDataAttributesRequest annotationSchema( + LLMObsAnnotationSchema annotationSchema) { + this.annotationSchema = annotationSchema; + this.unparsed |= annotationSchema.unparsed; + return this; + } + + /** + * Schema defining the labels for an annotation queue. + * + * @return annotationSchema + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ANNOTATION_SCHEMA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsAnnotationSchema getAnnotationSchema() { + return annotationSchema; + } + + public void setAnnotationSchema(LLMObsAnnotationSchema annotationSchema) { + this.annotationSchema = annotationSchema; + } + public LLMObsAnnotationQueueDataAttributesRequest description(String description) { this.description = description; return this; @@ -165,7 +192,9 @@ public boolean equals(Object o) { } LLMObsAnnotationQueueDataAttributesRequest llmObsAnnotationQueueDataAttributesRequest = (LLMObsAnnotationQueueDataAttributesRequest) o; - return Objects.equals(this.description, llmObsAnnotationQueueDataAttributesRequest.description) + return Objects.equals( + this.annotationSchema, llmObsAnnotationQueueDataAttributesRequest.annotationSchema) + && Objects.equals(this.description, llmObsAnnotationQueueDataAttributesRequest.description) && Objects.equals(this.name, llmObsAnnotationQueueDataAttributesRequest.name) && Objects.equals(this.projectId, llmObsAnnotationQueueDataAttributesRequest.projectId) && Objects.equals( @@ -175,13 +204,14 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(description, name, projectId, additionalProperties); + return Objects.hash(annotationSchema, description, name, projectId, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class LLMObsAnnotationQueueDataAttributesRequest {\n"); + sb.append(" annotationSchema: ").append(toIndentedString(annotationSchema)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueDataAttributesResponse.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueDataAttributesResponse.java index aec8a34e1e8..28311d45a39 100644 --- a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueDataAttributesResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueDataAttributesResponse.java @@ -20,6 +20,7 @@ /** Attributes of an LLM Observability annotation queue. */ @JsonPropertyOrder({ + LLMObsAnnotationQueueDataAttributesResponse.JSON_PROPERTY_ANNOTATION_SCHEMA, LLMObsAnnotationQueueDataAttributesResponse.JSON_PROPERTY_CREATED_AT, LLMObsAnnotationQueueDataAttributesResponse.JSON_PROPERTY_CREATED_BY, LLMObsAnnotationQueueDataAttributesResponse.JSON_PROPERTY_DESCRIPTION, @@ -33,6 +34,9 @@ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class LLMObsAnnotationQueueDataAttributesResponse { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ANNOTATION_SCHEMA = "annotation_schema"; + private LLMObsAnnotationSchema annotationSchema; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; private OffsetDateTime createdAt; @@ -79,6 +83,29 @@ public LLMObsAnnotationQueueDataAttributesResponse( this.projectId = projectId; } + public LLMObsAnnotationQueueDataAttributesResponse annotationSchema( + LLMObsAnnotationSchema annotationSchema) { + this.annotationSchema = annotationSchema; + this.unparsed |= annotationSchema.unparsed; + return this; + } + + /** + * Schema defining the labels for an annotation queue. + * + * @return annotationSchema + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ANNOTATION_SCHEMA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsAnnotationSchema getAnnotationSchema() { + return annotationSchema; + } + + public void setAnnotationSchema(LLMObsAnnotationSchema annotationSchema) { + this.annotationSchema = annotationSchema; + } + public LLMObsAnnotationQueueDataAttributesResponse createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; return this; @@ -297,7 +324,9 @@ public boolean equals(Object o) { } LLMObsAnnotationQueueDataAttributesResponse llmObsAnnotationQueueDataAttributesResponse = (LLMObsAnnotationQueueDataAttributesResponse) o; - return Objects.equals(this.createdAt, llmObsAnnotationQueueDataAttributesResponse.createdAt) + return Objects.equals( + this.annotationSchema, llmObsAnnotationQueueDataAttributesResponse.annotationSchema) + && Objects.equals(this.createdAt, llmObsAnnotationQueueDataAttributesResponse.createdAt) && Objects.equals(this.createdBy, llmObsAnnotationQueueDataAttributesResponse.createdBy) && Objects.equals(this.description, llmObsAnnotationQueueDataAttributesResponse.description) && Objects.equals(this.modifiedAt, llmObsAnnotationQueueDataAttributesResponse.modifiedAt) @@ -313,6 +342,7 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( + annotationSchema, createdAt, createdBy, description, @@ -328,6 +358,7 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class LLMObsAnnotationQueueDataAttributesResponse {\n"); + sb.append(" annotationSchema: ").append(toIndentedString(annotationSchema)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueLabelSchemaAttributes.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueLabelSchemaAttributes.java new file mode 100644 index 00000000000..a7cfe1c76f9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueLabelSchemaAttributes.java @@ -0,0 +1,152 @@ +/* + * 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 of an annotation queue label schema. */ +@JsonPropertyOrder({LLMObsAnnotationQueueLabelSchemaAttributes.JSON_PROPERTY_ANNOTATION_SCHEMA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsAnnotationQueueLabelSchemaAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ANNOTATION_SCHEMA = "annotation_schema"; + private LLMObsAnnotationSchema annotationSchema; + + public LLMObsAnnotationQueueLabelSchemaAttributes() {} + + @JsonCreator + public LLMObsAnnotationQueueLabelSchemaAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ANNOTATION_SCHEMA) + LLMObsAnnotationSchema annotationSchema) { + this.annotationSchema = annotationSchema; + this.unparsed |= annotationSchema.unparsed; + } + + public LLMObsAnnotationQueueLabelSchemaAttributes annotationSchema( + LLMObsAnnotationSchema annotationSchema) { + this.annotationSchema = annotationSchema; + this.unparsed |= annotationSchema.unparsed; + return this; + } + + /** + * Schema defining the labels for an annotation queue. + * + * @return annotationSchema + */ + @JsonProperty(JSON_PROPERTY_ANNOTATION_SCHEMA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsAnnotationSchema getAnnotationSchema() { + return annotationSchema; + } + + public void setAnnotationSchema(LLMObsAnnotationSchema annotationSchema) { + this.annotationSchema = annotationSchema; + } + + /** + * 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 LLMObsAnnotationQueueLabelSchemaAttributes + */ + @JsonAnySetter + public LLMObsAnnotationQueueLabelSchemaAttributes 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 LLMObsAnnotationQueueLabelSchemaAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsAnnotationQueueLabelSchemaAttributes llmObsAnnotationQueueLabelSchemaAttributes = + (LLMObsAnnotationQueueLabelSchemaAttributes) o; + return Objects.equals( + this.annotationSchema, llmObsAnnotationQueueLabelSchemaAttributes.annotationSchema) + && Objects.equals( + this.additionalProperties, + llmObsAnnotationQueueLabelSchemaAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(annotationSchema, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsAnnotationQueueLabelSchemaAttributes {\n"); + sb.append(" annotationSchema: ").append(toIndentedString(annotationSchema)).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/LLMObsAnnotationQueueLabelSchemaData.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueLabelSchemaData.java new file mode 100644 index 00000000000..ac2cbb9970f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueLabelSchemaData.java @@ -0,0 +1,212 @@ +/* + * 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 an annotation queue label schema. */ +@JsonPropertyOrder({ + LLMObsAnnotationQueueLabelSchemaData.JSON_PROPERTY_ATTRIBUTES, + LLMObsAnnotationQueueLabelSchemaData.JSON_PROPERTY_ID, + LLMObsAnnotationQueueLabelSchemaData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsAnnotationQueueLabelSchemaData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private LLMObsAnnotationQueueLabelSchemaAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private LLMObsAnnotationQueueType type; + + public LLMObsAnnotationQueueLabelSchemaData() {} + + @JsonCreator + public LLMObsAnnotationQueueLabelSchemaData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + LLMObsAnnotationQueueLabelSchemaAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) LLMObsAnnotationQueueType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public LLMObsAnnotationQueueLabelSchemaData attributes( + LLMObsAnnotationQueueLabelSchemaAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an annotation queue label schema. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsAnnotationQueueLabelSchemaAttributes getAttributes() { + return attributes; + } + + public void setAttributes(LLMObsAnnotationQueueLabelSchemaAttributes attributes) { + this.attributes = attributes; + } + + public LLMObsAnnotationQueueLabelSchemaData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the annotation queue. + * + * @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 LLMObsAnnotationQueueLabelSchemaData type(LLMObsAnnotationQueueType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Resource type of an LLM Observability annotation queue. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsAnnotationQueueType getType() { + return type; + } + + public void setType(LLMObsAnnotationQueueType 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 LLMObsAnnotationQueueLabelSchemaData + */ + @JsonAnySetter + public LLMObsAnnotationQueueLabelSchemaData 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 LLMObsAnnotationQueueLabelSchemaData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsAnnotationQueueLabelSchemaData llmObsAnnotationQueueLabelSchemaData = + (LLMObsAnnotationQueueLabelSchemaData) o; + return Objects.equals(this.attributes, llmObsAnnotationQueueLabelSchemaData.attributes) + && Objects.equals(this.id, llmObsAnnotationQueueLabelSchemaData.id) + && Objects.equals(this.type, llmObsAnnotationQueueLabelSchemaData.type) + && Objects.equals( + this.additionalProperties, llmObsAnnotationQueueLabelSchemaData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsAnnotationQueueLabelSchemaData {\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/LLMObsAnnotationQueueLabelSchemaResponse.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueLabelSchemaResponse.java new file mode 100644 index 00000000000..da7aa3cbf18 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueLabelSchemaResponse.java @@ -0,0 +1,149 @@ +/* + * 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 the label schema of an annotation queue. */ +@JsonPropertyOrder({LLMObsAnnotationQueueLabelSchemaResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsAnnotationQueueLabelSchemaResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private LLMObsAnnotationQueueLabelSchemaData data; + + public LLMObsAnnotationQueueLabelSchemaResponse() {} + + @JsonCreator + public LLMObsAnnotationQueueLabelSchemaResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + LLMObsAnnotationQueueLabelSchemaData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public LLMObsAnnotationQueueLabelSchemaResponse data(LLMObsAnnotationQueueLabelSchemaData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for an annotation queue label schema. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsAnnotationQueueLabelSchemaData getData() { + return data; + } + + public void setData(LLMObsAnnotationQueueLabelSchemaData data) { + this.data = data; + } + + /** + * 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 LLMObsAnnotationQueueLabelSchemaResponse + */ + @JsonAnySetter + public LLMObsAnnotationQueueLabelSchemaResponse 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 LLMObsAnnotationQueueLabelSchemaResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsAnnotationQueueLabelSchemaResponse llmObsAnnotationQueueLabelSchemaResponse = + (LLMObsAnnotationQueueLabelSchemaResponse) o; + return Objects.equals(this.data, llmObsAnnotationQueueLabelSchemaResponse.data) + && Objects.equals( + this.additionalProperties, + llmObsAnnotationQueueLabelSchemaResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsAnnotationQueueLabelSchemaResponse {\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/LLMObsAnnotationQueueLabelSchemaUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueLabelSchemaUpdateAttributes.java new file mode 100644 index 00000000000..66b7525201d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueLabelSchemaUpdateAttributes.java @@ -0,0 +1,156 @@ +/* + * 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 for updating an annotation queue label schema. */ +@JsonPropertyOrder({ + LLMObsAnnotationQueueLabelSchemaUpdateAttributes.JSON_PROPERTY_ANNOTATION_SCHEMA +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsAnnotationQueueLabelSchemaUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ANNOTATION_SCHEMA = "annotation_schema"; + private LLMObsAnnotationSchema annotationSchema; + + public LLMObsAnnotationQueueLabelSchemaUpdateAttributes() {} + + @JsonCreator + public LLMObsAnnotationQueueLabelSchemaUpdateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ANNOTATION_SCHEMA) + LLMObsAnnotationSchema annotationSchema) { + this.annotationSchema = annotationSchema; + this.unparsed |= annotationSchema.unparsed; + } + + public LLMObsAnnotationQueueLabelSchemaUpdateAttributes annotationSchema( + LLMObsAnnotationSchema annotationSchema) { + this.annotationSchema = annotationSchema; + this.unparsed |= annotationSchema.unparsed; + return this; + } + + /** + * Schema defining the labels for an annotation queue. + * + * @return annotationSchema + */ + @JsonProperty(JSON_PROPERTY_ANNOTATION_SCHEMA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsAnnotationSchema getAnnotationSchema() { + return annotationSchema; + } + + public void setAnnotationSchema(LLMObsAnnotationSchema annotationSchema) { + this.annotationSchema = annotationSchema; + } + + /** + * 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 LLMObsAnnotationQueueLabelSchemaUpdateAttributes + */ + @JsonAnySetter + public LLMObsAnnotationQueueLabelSchemaUpdateAttributes 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 LLMObsAnnotationQueueLabelSchemaUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsAnnotationQueueLabelSchemaUpdateAttributes + llmObsAnnotationQueueLabelSchemaUpdateAttributes = + (LLMObsAnnotationQueueLabelSchemaUpdateAttributes) o; + return Objects.equals( + this.annotationSchema, + llmObsAnnotationQueueLabelSchemaUpdateAttributes.annotationSchema) + && Objects.equals( + this.additionalProperties, + llmObsAnnotationQueueLabelSchemaUpdateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(annotationSchema, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsAnnotationQueueLabelSchemaUpdateAttributes {\n"); + sb.append(" annotationSchema: ").append(toIndentedString(annotationSchema)).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/LLMObsAnnotationQueueLabelSchemaUpdateData.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueLabelSchemaUpdateData.java new file mode 100644 index 00000000000..633e739f090 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueLabelSchemaUpdateData.java @@ -0,0 +1,186 @@ +/* + * 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 updating an annotation queue label schema. */ +@JsonPropertyOrder({ + LLMObsAnnotationQueueLabelSchemaUpdateData.JSON_PROPERTY_ATTRIBUTES, + LLMObsAnnotationQueueLabelSchemaUpdateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsAnnotationQueueLabelSchemaUpdateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private LLMObsAnnotationQueueLabelSchemaUpdateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private LLMObsAnnotationQueueType type; + + public LLMObsAnnotationQueueLabelSchemaUpdateData() {} + + @JsonCreator + public LLMObsAnnotationQueueLabelSchemaUpdateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + LLMObsAnnotationQueueLabelSchemaUpdateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) LLMObsAnnotationQueueType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public LLMObsAnnotationQueueLabelSchemaUpdateData attributes( + LLMObsAnnotationQueueLabelSchemaUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for updating an annotation queue label schema. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsAnnotationQueueLabelSchemaUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(LLMObsAnnotationQueueLabelSchemaUpdateAttributes attributes) { + this.attributes = attributes; + } + + public LLMObsAnnotationQueueLabelSchemaUpdateData type(LLMObsAnnotationQueueType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Resource type of an LLM Observability annotation queue. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsAnnotationQueueType getType() { + return type; + } + + public void setType(LLMObsAnnotationQueueType 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 LLMObsAnnotationQueueLabelSchemaUpdateData + */ + @JsonAnySetter + public LLMObsAnnotationQueueLabelSchemaUpdateData 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 LLMObsAnnotationQueueLabelSchemaUpdateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsAnnotationQueueLabelSchemaUpdateData llmObsAnnotationQueueLabelSchemaUpdateData = + (LLMObsAnnotationQueueLabelSchemaUpdateData) o; + return Objects.equals(this.attributes, llmObsAnnotationQueueLabelSchemaUpdateData.attributes) + && Objects.equals(this.type, llmObsAnnotationQueueLabelSchemaUpdateData.type) + && Objects.equals( + this.additionalProperties, + llmObsAnnotationQueueLabelSchemaUpdateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsAnnotationQueueLabelSchemaUpdateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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/LLMObsAnnotationQueueLabelSchemaUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueLabelSchemaUpdateRequest.java new file mode 100644 index 00000000000..14616e75539 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueLabelSchemaUpdateRequest.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; + +/** Request to update the label schema of an annotation queue. */ +@JsonPropertyOrder({LLMObsAnnotationQueueLabelSchemaUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsAnnotationQueueLabelSchemaUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private LLMObsAnnotationQueueLabelSchemaUpdateData data; + + public LLMObsAnnotationQueueLabelSchemaUpdateRequest() {} + + @JsonCreator + public LLMObsAnnotationQueueLabelSchemaUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + LLMObsAnnotationQueueLabelSchemaUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public LLMObsAnnotationQueueLabelSchemaUpdateRequest data( + LLMObsAnnotationQueueLabelSchemaUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for updating an annotation queue label schema. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsAnnotationQueueLabelSchemaUpdateData getData() { + return data; + } + + public void setData(LLMObsAnnotationQueueLabelSchemaUpdateData data) { + this.data = data; + } + + /** + * 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 LLMObsAnnotationQueueLabelSchemaUpdateRequest + */ + @JsonAnySetter + public LLMObsAnnotationQueueLabelSchemaUpdateRequest 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 LLMObsAnnotationQueueLabelSchemaUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsAnnotationQueueLabelSchemaUpdateRequest llmObsAnnotationQueueLabelSchemaUpdateRequest = + (LLMObsAnnotationQueueLabelSchemaUpdateRequest) o; + return Objects.equals(this.data, llmObsAnnotationQueueLabelSchemaUpdateRequest.data) + && Objects.equals( + this.additionalProperties, + llmObsAnnotationQueueLabelSchemaUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsAnnotationQueueLabelSchemaUpdateRequest {\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/LLMObsAnnotationQueueUpdateDataAttributesRequest.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueUpdateDataAttributesRequest.java index f809e358b03..21620244415 100644 --- a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueUpdateDataAttributesRequest.java +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationQueueUpdateDataAttributesRequest.java @@ -18,6 +18,7 @@ /** Attributes for updating an LLM Observability annotation queue. All fields are optional. */ @JsonPropertyOrder({ + LLMObsAnnotationQueueUpdateDataAttributesRequest.JSON_PROPERTY_ANNOTATION_SCHEMA, LLMObsAnnotationQueueUpdateDataAttributesRequest.JSON_PROPERTY_DESCRIPTION, LLMObsAnnotationQueueUpdateDataAttributesRequest.JSON_PROPERTY_NAME }) @@ -25,12 +26,38 @@ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class LLMObsAnnotationQueueUpdateDataAttributesRequest { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ANNOTATION_SCHEMA = "annotation_schema"; + private LLMObsAnnotationSchema annotationSchema; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; public static final String JSON_PROPERTY_NAME = "name"; private String name; + public LLMObsAnnotationQueueUpdateDataAttributesRequest annotationSchema( + LLMObsAnnotationSchema annotationSchema) { + this.annotationSchema = annotationSchema; + this.unparsed |= annotationSchema.unparsed; + return this; + } + + /** + * Schema defining the labels for an annotation queue. + * + * @return annotationSchema + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ANNOTATION_SCHEMA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LLMObsAnnotationSchema getAnnotationSchema() { + return annotationSchema; + } + + public void setAnnotationSchema(LLMObsAnnotationSchema annotationSchema) { + this.annotationSchema = annotationSchema; + } + public LLMObsAnnotationQueueUpdateDataAttributesRequest description(String description) { this.description = description; return this; @@ -133,6 +160,9 @@ public boolean equals(Object o) { llmObsAnnotationQueueUpdateDataAttributesRequest = (LLMObsAnnotationQueueUpdateDataAttributesRequest) o; return Objects.equals( + this.annotationSchema, + llmObsAnnotationQueueUpdateDataAttributesRequest.annotationSchema) + && Objects.equals( this.description, llmObsAnnotationQueueUpdateDataAttributesRequest.description) && Objects.equals(this.name, llmObsAnnotationQueueUpdateDataAttributesRequest.name) && Objects.equals( @@ -142,13 +172,14 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(description, name, additionalProperties); + return Objects.hash(annotationSchema, description, name, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class LLMObsAnnotationQueueUpdateDataAttributesRequest {\n"); + sb.append(" annotationSchema: ").append(toIndentedString(annotationSchema)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" additionalProperties: ") diff --git a/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationSchema.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationSchema.java new file mode 100644 index 00000000000..6c92992ab32 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsAnnotationSchema.java @@ -0,0 +1,155 @@ +/* + * 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; + +/** Schema defining the labels for an annotation queue. */ +@JsonPropertyOrder({LLMObsAnnotationSchema.JSON_PROPERTY_LABEL_SCHEMAS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsAnnotationSchema { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_LABEL_SCHEMAS = "label_schemas"; + private List labelSchemas = new ArrayList<>(); + + public LLMObsAnnotationSchema() {} + + @JsonCreator + public LLMObsAnnotationSchema( + @JsonProperty(required = true, value = JSON_PROPERTY_LABEL_SCHEMAS) + List labelSchemas) { + this.labelSchemas = labelSchemas; + } + + public LLMObsAnnotationSchema labelSchemas(List labelSchemas) { + this.labelSchemas = labelSchemas; + for (LLMObsLabelSchema item : labelSchemas) { + this.unparsed |= item.unparsed; + } + return this; + } + + public LLMObsAnnotationSchema addLabelSchemasItem(LLMObsLabelSchema labelSchemasItem) { + this.labelSchemas.add(labelSchemasItem); + this.unparsed |= labelSchemasItem.unparsed; + return this; + } + + /** + * List of label schema definitions. + * + * @return labelSchemas + */ + @JsonProperty(JSON_PROPERTY_LABEL_SCHEMAS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getLabelSchemas() { + return labelSchemas; + } + + public void setLabelSchemas(List labelSchemas) { + this.labelSchemas = labelSchemas; + } + + /** + * 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 LLMObsAnnotationSchema + */ + @JsonAnySetter + public LLMObsAnnotationSchema 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 LLMObsAnnotationSchema object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsAnnotationSchema llmObsAnnotationSchema = (LLMObsAnnotationSchema) o; + return Objects.equals(this.labelSchemas, llmObsAnnotationSchema.labelSchemas) + && Objects.equals(this.additionalProperties, llmObsAnnotationSchema.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(labelSchemas, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsAnnotationSchema {\n"); + sb.append(" labelSchemas: ").append(toIndentedString(labelSchemas)).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/LLMObsLabelSchema.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsLabelSchema.java new file mode 100644 index 00000000000..4b9ad60ee99 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsLabelSchema.java @@ -0,0 +1,473 @@ +/* + * 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; + +/** Schema definition for a single label in an annotation queue. */ +@JsonPropertyOrder({ + LLMObsLabelSchema.JSON_PROPERTY_DESCRIPTION, + LLMObsLabelSchema.JSON_PROPERTY_HAS_ASSESSMENT, + LLMObsLabelSchema.JSON_PROPERTY_HAS_REASONING, + LLMObsLabelSchema.JSON_PROPERTY_ID, + LLMObsLabelSchema.JSON_PROPERTY_IS_ASSESSMENT, + LLMObsLabelSchema.JSON_PROPERTY_IS_INTEGER, + LLMObsLabelSchema.JSON_PROPERTY_IS_REQUIRED, + LLMObsLabelSchema.JSON_PROPERTY_MAX, + LLMObsLabelSchema.JSON_PROPERTY_MIN, + LLMObsLabelSchema.JSON_PROPERTY_NAME, + LLMObsLabelSchema.JSON_PROPERTY_TYPE, + LLMObsLabelSchema.JSON_PROPERTY_VALUES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LLMObsLabelSchema { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_HAS_ASSESSMENT = "has_assessment"; + private Boolean hasAssessment; + + public static final String JSON_PROPERTY_HAS_REASONING = "has_reasoning"; + private Boolean hasReasoning; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_IS_ASSESSMENT = "is_assessment"; + private Boolean isAssessment; + + public static final String JSON_PROPERTY_IS_INTEGER = "is_integer"; + private Boolean isInteger; + + public static final String JSON_PROPERTY_IS_REQUIRED = "is_required"; + private Boolean isRequired; + + public static final String JSON_PROPERTY_MAX = "max"; + private Double max; + + public static final String JSON_PROPERTY_MIN = "min"; + private Double min; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TYPE = "type"; + private LLMObsLabelSchemaType type; + + public static final String JSON_PROPERTY_VALUES = "values"; + private List values = null; + + public LLMObsLabelSchema() {} + + @JsonCreator + public LLMObsLabelSchema( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) LLMObsLabelSchemaType type) { + this.name = name; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public LLMObsLabelSchema description(String description) { + this.description = description; + return this; + } + + /** + * Description of the label. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public LLMObsLabelSchema hasAssessment(Boolean hasAssessment) { + this.hasAssessment = hasAssessment; + return this; + } + + /** + * Whether this label includes an assessment field. + * + * @return hasAssessment + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HAS_ASSESSMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasAssessment() { + return hasAssessment; + } + + public void setHasAssessment(Boolean hasAssessment) { + this.hasAssessment = hasAssessment; + } + + public LLMObsLabelSchema hasReasoning(Boolean hasReasoning) { + this.hasReasoning = hasReasoning; + return this; + } + + /** + * Whether this label includes a reasoning field. + * + * @return hasReasoning + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HAS_REASONING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasReasoning() { + return hasReasoning; + } + + public void setHasReasoning(Boolean hasReasoning) { + this.hasReasoning = hasReasoning; + } + + public LLMObsLabelSchema id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the label schema. Assigned by the server if not provided. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public LLMObsLabelSchema isAssessment(Boolean isAssessment) { + this.isAssessment = isAssessment; + return this; + } + + /** + * Whether the boolean label represents an assessment. Requires has_assessment to be + * true. + * + * @return isAssessment + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_ASSESSMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsAssessment() { + return isAssessment; + } + + public void setIsAssessment(Boolean isAssessment) { + this.isAssessment = isAssessment; + } + + public LLMObsLabelSchema isInteger(Boolean isInteger) { + this.isInteger = isInteger; + return this; + } + + /** + * Whether score values must be integers. Applicable to score-type labels. + * + * @return isInteger + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsInteger() { + return isInteger; + } + + public void setIsInteger(Boolean isInteger) { + this.isInteger = isInteger; + } + + public LLMObsLabelSchema isRequired(Boolean isRequired) { + this.isRequired = isRequired; + return this; + } + + /** + * Whether this label is required for an annotation. + * + * @return isRequired + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsRequired() { + return isRequired; + } + + public void setIsRequired(Boolean isRequired) { + this.isRequired = isRequired; + } + + public LLMObsLabelSchema max(Double max) { + this.max = max; + return this; + } + + /** + * Maximum value for score-type labels. + * + * @return max + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getMax() { + return max; + } + + public void setMax(Double max) { + this.max = max; + } + + public LLMObsLabelSchema min(Double min) { + this.min = min; + return this; + } + + /** + * Minimum value for score-type labels. + * + * @return min + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getMin() { + return min; + } + + public void setMin(Double min) { + this.min = min; + } + + public LLMObsLabelSchema name(String name) { + this.name = name; + return this; + } + + /** + * Name of the label. Must match the pattern ^[a-zA-Z0-9_-]+$ and be unique within + * the queue. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public LLMObsLabelSchema type(LLMObsLabelSchemaType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of a label in an annotation queue label schema. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LLMObsLabelSchemaType getType() { + return type; + } + + public void setType(LLMObsLabelSchemaType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public LLMObsLabelSchema values(List values) { + this.values = values; + return this; + } + + public LLMObsLabelSchema addValuesItem(String valuesItem) { + if (this.values == null) { + this.values = new ArrayList<>(); + } + this.values.add(valuesItem); + return this; + } + + /** + * Allowed values for categorical-type labels. Must contain at least one non-empty, unique value. + * + * @return values + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getValues() { + return values; + } + + public void setValues(List values) { + this.values = values; + } + + /** + * 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 LLMObsLabelSchema + */ + @JsonAnySetter + public LLMObsLabelSchema 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 LLMObsLabelSchema object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LLMObsLabelSchema llmObsLabelSchema = (LLMObsLabelSchema) o; + return Objects.equals(this.description, llmObsLabelSchema.description) + && Objects.equals(this.hasAssessment, llmObsLabelSchema.hasAssessment) + && Objects.equals(this.hasReasoning, llmObsLabelSchema.hasReasoning) + && Objects.equals(this.id, llmObsLabelSchema.id) + && Objects.equals(this.isAssessment, llmObsLabelSchema.isAssessment) + && Objects.equals(this.isInteger, llmObsLabelSchema.isInteger) + && Objects.equals(this.isRequired, llmObsLabelSchema.isRequired) + && Objects.equals(this.max, llmObsLabelSchema.max) + && Objects.equals(this.min, llmObsLabelSchema.min) + && Objects.equals(this.name, llmObsLabelSchema.name) + && Objects.equals(this.type, llmObsLabelSchema.type) + && Objects.equals(this.values, llmObsLabelSchema.values) + && Objects.equals(this.additionalProperties, llmObsLabelSchema.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + description, + hasAssessment, + hasReasoning, + id, + isAssessment, + isInteger, + isRequired, + max, + min, + name, + type, + values, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LLMObsLabelSchema {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" hasAssessment: ").append(toIndentedString(hasAssessment)).append("\n"); + sb.append(" hasReasoning: ").append(toIndentedString(hasReasoning)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" isAssessment: ").append(toIndentedString(isAssessment)).append("\n"); + sb.append(" isInteger: ").append(toIndentedString(isInteger)).append("\n"); + sb.append(" isRequired: ").append(toIndentedString(isRequired)).append("\n"); + sb.append(" max: ").append(toIndentedString(max)).append("\n"); + sb.append(" min: ").append(toIndentedString(min)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).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/LLMObsLabelSchemaType.java b/src/main/java/com/datadog/api/client/v2/model/LLMObsLabelSchemaType.java new file mode 100644 index 00000000000..e6e54dce9cc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LLMObsLabelSchemaType.java @@ -0,0 +1,58 @@ +/* + * 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 of a label in an annotation queue label schema. */ +@JsonSerialize(using = LLMObsLabelSchemaType.LLMObsLabelSchemaTypeSerializer.class) +public class LLMObsLabelSchemaType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("score", "categorical", "boolean", "text")); + + public static final LLMObsLabelSchemaType SCORE = new LLMObsLabelSchemaType("score"); + public static final LLMObsLabelSchemaType CATEGORICAL = new LLMObsLabelSchemaType("categorical"); + public static final LLMObsLabelSchemaType BOOLEAN = new LLMObsLabelSchemaType("boolean"); + public static final LLMObsLabelSchemaType TEXT = new LLMObsLabelSchemaType("text"); + + LLMObsLabelSchemaType(String value) { + super(value, allowedValues); + } + + public static class LLMObsLabelSchemaTypeSerializer extends StdSerializer { + public LLMObsLabelSchemaTypeSerializer(Class t) { + super(t); + } + + public LLMObsLabelSchemaTypeSerializer() { + this(null); + } + + @Override + public void serialize( + LLMObsLabelSchemaType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static LLMObsLabelSchemaType fromValue(String value) { + return new LLMObsLabelSchemaType(value); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/llm_observability.feature b/src/test/resources/com/datadog/api/client/v2/api/llm_observability.feature index dc0a15364b9..e9c054c7366 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/llm_observability.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/llm_observability.feature @@ -79,7 +79,7 @@ Feature: LLM Observability Scenario: Create an LLM Observability annotation queue returns "Bad Request" response Given operation "CreateLLMObsAnnotationQueue" enabled And new "CreateLLMObsAnnotationQueue" request - And body with value {"data": {"attributes": {"description": "Queue for annotating customer support traces", "name": "My annotation queue", "project_id": "a33671aa-24fd-4dcd-9b33-a8ec7dde7751"}, "type": "queues"}} + And body with value {"data": {"attributes": {"annotation_schema": {"label_schemas": [{"description": "Rating of the response quality.", "has_assessment": false, "has_reasoning": false, "id": "ab12cd34", "is_assessment": false, "is_integer": false, "is_required": true, "max": 5.0, "min": 0.0, "name": "quality", "type": "score", "values": ["good", "bad", "neutral"]}]}, "description": "Queue for annotating customer support traces", "name": "My annotation queue", "project_id": "a33671aa-24fd-4dcd-9b33-a8ec7dde7751"}, "type": "queues"}} When the request is sent Then the response status is 400 Bad Request @@ -87,7 +87,7 @@ Feature: LLM Observability Scenario: Create an LLM Observability annotation queue returns "Created" response Given operation "CreateLLMObsAnnotationQueue" enabled And new "CreateLLMObsAnnotationQueue" request - And body with value {"data": {"attributes": {"description": "Queue for annotating customer support traces", "name": "My annotation queue", "project_id": "a33671aa-24fd-4dcd-9b33-a8ec7dde7751"}, "type": "queues"}} + And body with value {"data": {"attributes": {"annotation_schema": {"label_schemas": [{"description": "Rating of the response quality.", "has_assessment": false, "has_reasoning": false, "id": "ab12cd34", "is_assessment": false, "is_integer": false, "is_required": true, "max": 5.0, "min": 0.0, "name": "quality", "type": "score", "values": ["good", "bad", "neutral"]}]}, "description": "Queue for annotating customer support traces", "name": "My annotation queue", "project_id": "a33671aa-24fd-4dcd-9b33-a8ec7dde7751"}, "type": "queues"}} When the request is sent Then the response status is 201 Created @@ -415,6 +415,22 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: Get annotation queue label schema returns "Not Found" response + Given operation "GetLLMObsAnnotationQueueLabelSchema" enabled + And new "GetLLMObsAnnotationQueueLabelSchema" request + And request contains "queue_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 annotation queue label schema returns "OK" response + Given operation "GetLLMObsAnnotationQueueLabelSchema" enabled + And new "GetLLMObsAnnotationQueueLabelSchema" request + And request contains "queue_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability annotation queues returns "Bad Request" response Given operation "ListLLMObsAnnotationQueues" enabled @@ -570,7 +586,7 @@ Feature: LLM Observability Given operation "UpdateLLMObsAnnotationQueue" enabled And new "UpdateLLMObsAnnotationQueue" request And request contains "queue_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"description": "Updated description", "name": "Updated queue name"}, "type": "queues"}} + And body with value {"data": {"attributes": {"annotation_schema": {"label_schemas": [{"description": "Rating of the response quality.", "has_assessment": false, "has_reasoning": false, "id": "ab12cd34", "is_assessment": false, "is_integer": false, "is_required": true, "max": 5.0, "min": 0.0, "name": "quality", "type": "score", "values": ["good", "bad", "neutral"]}]}, "description": "Updated description", "name": "Updated queue name"}, "type": "queues"}} When the request is sent Then the response status is 400 Bad Request @@ -579,7 +595,7 @@ Feature: LLM Observability Given operation "UpdateLLMObsAnnotationQueue" enabled And new "UpdateLLMObsAnnotationQueue" request And request contains "queue_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"description": "Updated description", "name": "Updated queue name"}, "type": "queues"}} + And body with value {"data": {"attributes": {"annotation_schema": {"label_schemas": [{"description": "Rating of the response quality.", "has_assessment": false, "has_reasoning": false, "id": "ab12cd34", "is_assessment": false, "is_integer": false, "is_required": true, "max": 5.0, "min": 0.0, "name": "quality", "type": "score", "values": ["good", "bad", "neutral"]}]}, "description": "Updated description", "name": "Updated queue name"}, "type": "queues"}} When the request is sent Then the response status is 404 Not Found @@ -588,7 +604,7 @@ Feature: LLM Observability Given operation "UpdateLLMObsAnnotationQueue" enabled And new "UpdateLLMObsAnnotationQueue" request And request contains "queue_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"description": "Updated description", "name": "Updated queue name"}, "type": "queues"}} + And body with value {"data": {"attributes": {"annotation_schema": {"label_schemas": [{"description": "Rating of the response quality.", "has_assessment": false, "has_reasoning": false, "id": "ab12cd34", "is_assessment": false, "is_integer": false, "is_required": true, "max": 5.0, "min": 0.0, "name": "quality", "type": "score", "values": ["good", "bad", "neutral"]}]}, "description": "Updated description", "name": "Updated queue name"}, "type": "queues"}} When the request is sent Then the response status is 200 OK @@ -675,3 +691,30 @@ Feature: LLM Observability And body with value {"data": {"attributes": {}, "type": "projects"}} When the request is sent Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: Update annotation queue label schema returns "Bad Request" response + Given operation "UpdateLLMObsAnnotationQueueLabelSchema" enabled + And new "UpdateLLMObsAnnotationQueueLabelSchema" request + And request contains "queue_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"annotation_schema": {"label_schemas": [{"description": "Rating of the response quality.", "has_assessment": false, "has_reasoning": false, "id": "ab12cd34", "is_assessment": false, "is_integer": false, "is_required": true, "max": 5.0, "min": 0.0, "name": "quality", "type": "score", "values": ["good", "bad", "neutral"]}]}}, "type": "queues"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Update annotation queue label schema returns "Not Found" response + Given operation "UpdateLLMObsAnnotationQueueLabelSchema" enabled + And new "UpdateLLMObsAnnotationQueueLabelSchema" request + And request contains "queue_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"annotation_schema": {"label_schemas": [{"description": "Rating of the response quality.", "has_assessment": false, "has_reasoning": false, "id": "ab12cd34", "is_assessment": false, "is_integer": false, "is_required": true, "max": 5.0, "min": 0.0, "name": "quality", "type": "score", "values": ["good", "bad", "neutral"]}]}}, "type": "queues"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Update annotation queue label schema returns "OK" response + Given operation "UpdateLLMObsAnnotationQueueLabelSchema" enabled + And new "UpdateLLMObsAnnotationQueueLabelSchema" request + And request contains "queue_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"annotation_schema": {"label_schemas": [{"description": "Rating of the response quality.", "has_assessment": false, "has_reasoning": false, "id": "ab12cd34", "is_assessment": false, "is_integer": false, "is_required": true, "max": 5.0, "min": 0.0, "name": "quality", "type": "score", "values": ["good", "bad", "neutral"]}]}}, "type": "queues"}} + When the request is sent + Then the response status is 200 OK 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 8c591eca8c2..f606e4a8658 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 @@ -3267,6 +3267,18 @@ "type": "idempotent" } }, + "GetLLMObsAnnotationQueueLabelSchema": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "UpdateLLMObsAnnotationQueueLabelSchema": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, "ListLLMObsExperiments": { "tag": "LLM Observability", "undo": {