From 1f069f5d83caf32091aa0dd6a09aab9867e7bedf Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 28 May 2026 19:39:00 +0000 Subject: [PATCH] Regenerate client from commit 15d471f of spec repo --- .generator/schemas/v2/openapi.yaml | 717 +++++++++++++++++- .../BatchUpdateLLMObsDataset.rb | 45 ++ .../llm-observability/CloneLLMObsDataset.rb | 19 + .../llm-observability/ExportLLMObsDataset.rb | 8 + .../RestoreLLMObsDatasetVersion.rb | 18 + .../UploadLLMObsDatasetRecordsFile.rb | 8 + features/scenarios_model_mapping.rb | 30 + features/v2/llm_observability.feature | 154 ++++ features/v2/undo.json | 32 + lib/datadog_api_client/configuration.rb | 5 + lib/datadog_api_client/inflector.rb | 14 + .../v2/api/llm_observability_api.rb | 431 +++++++++++ ...et_batch_update_data_attributes_request.rb | 153 ++++ ...m_obs_dataset_batch_update_data_request.rb | 165 ++++ ..._obs_dataset_batch_update_insert_record.rb | 166 ++++ .../llm_obs_dataset_batch_update_request.rb | 123 +++ ..._obs_dataset_batch_update_update_record.rb | 172 +++++ ...s_dataset_clone_data_attributes_request.rb | 133 ++++ .../llm_obs_dataset_clone_data_request.rb | 165 ++++ .../models/llm_obs_dataset_clone_request.rb | 123 +++ .../models/llm_obs_dataset_export_format.rb | 26 + .../llm_obs_dataset_record_tag_operations.rb | 131 ++++ .../llm_obs_dataset_records_upload_file.rb | 105 +++ ...restore_version_data_attributes_request.rb | 127 ++++ ...bs_dataset_restore_version_data_request.rb | 165 ++++ ...llm_obs_dataset_restore_version_request.rb | 123 +++ 26 files changed, 3340 insertions(+), 18 deletions(-) create mode 100644 examples/v2/llm-observability/BatchUpdateLLMObsDataset.rb create mode 100644 examples/v2/llm-observability/CloneLLMObsDataset.rb create mode 100644 examples/v2/llm-observability/ExportLLMObsDataset.rb create mode 100644 examples/v2/llm-observability/RestoreLLMObsDatasetVersion.rb create mode 100644 examples/v2/llm-observability/UploadLLMObsDatasetRecordsFile.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_insert_record.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_update_record.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_clone_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_clone_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_clone_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_export_format.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_record_tag_operations.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_records_upload_file.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_request.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4bc99f94bc1d..f1d433893461 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -45293,6 +45293,142 @@ components: type: string x-enum-varnames: - DELETION_REQUEST + LLMObsDatasetBatchUpdateDataAttributesRequest: + description: Attributes for batch-updating records in an LLM Observability dataset. + properties: + create_new_version: + description: Whether to create a new dataset version when applying the batch update. Defaults to `true`. + example: true + type: boolean + delete_records: + $ref: "#/components/schemas/LLMObsDatasetBatchUpdateDeleteRecords" + insert_records: + $ref: "#/components/schemas/LLMObsDatasetBatchUpdateInsertRecords" + tags: + $ref: "#/components/schemas/LLMObsDatasetRecordTagsList" + update_records: + $ref: "#/components/schemas/LLMObsDatasetBatchUpdateUpdateRecords" + type: object + LLMObsDatasetBatchUpdateDataRequest: + description: Data object for batch-updating records in an LLM Observability dataset. + properties: + attributes: + $ref: "#/components/schemas/LLMObsDatasetBatchUpdateDataAttributesRequest" + id: + description: Unique identifier of the dataset. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + type: string + type: + $ref: "#/components/schemas/LLMObsDatasetType" + required: + - id + - type + - attributes + type: object + LLMObsDatasetBatchUpdateDeleteRecords: + description: Record IDs to delete. + items: + description: A record ID to delete. + type: string + type: array + LLMObsDatasetBatchUpdateInsertRecord: + description: A record to insert as part of a batch update on an LLM Observability dataset. + properties: + expected_output: + $ref: "#/components/schemas/AnyValue" + id: + description: Optional user-provided identifier for the record. If omitted, the server generates an identifier. + example: "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c" + type: string + input: + $ref: "#/components/schemas/AnyValue" + metadata: + additionalProperties: {} + description: Arbitrary metadata associated with the record. + type: object + tag_operations: + $ref: "#/components/schemas/LLMObsDatasetRecordTagOperations" + tags: + $ref: "#/components/schemas/LLMObsDatasetRecordTagsList" + required: + - input + type: object + LLMObsDatasetBatchUpdateInsertRecords: + description: Records to insert. + items: + $ref: "#/components/schemas/LLMObsDatasetBatchUpdateInsertRecord" + type: array + LLMObsDatasetBatchUpdateRequest: + description: Request to batch-insert, update, and delete records in an LLM Observability dataset. + properties: + data: + $ref: "#/components/schemas/LLMObsDatasetBatchUpdateDataRequest" + required: + - data + type: object + LLMObsDatasetBatchUpdateUpdateRecord: + description: A record update payload as part of a batch update on an LLM Observability dataset. + properties: + expected_output: + $ref: "#/components/schemas/AnyValue" + id: + description: Unique identifier of the record to update. + example: "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c" + type: string + input: + $ref: "#/components/schemas/AnyValue" + metadata: + additionalProperties: {} + description: Updated metadata associated with the record. + type: object + tag_operations: + $ref: "#/components/schemas/LLMObsDatasetRecordTagOperations" + required: + - id + type: object + LLMObsDatasetBatchUpdateUpdateRecords: + description: Records to update by ID. + items: + $ref: "#/components/schemas/LLMObsDatasetBatchUpdateUpdateRecord" + type: array + LLMObsDatasetCloneDataAttributesRequest: + description: Attributes for cloning an LLM Observability dataset. + properties: + description: + description: Description of the cloned dataset. + example: "Clone of the original dataset for experimentation." + type: string + name: + description: Name of the cloned dataset. + example: "My cloned dataset" + type: string + required: + - name + type: object + LLMObsDatasetCloneDataRequest: + description: Data object for cloning an LLM Observability dataset. + properties: + attributes: + $ref: "#/components/schemas/LLMObsDatasetCloneDataAttributesRequest" + id: + description: Identifier of the source dataset to clone. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + type: string + type: + $ref: "#/components/schemas/LLMObsDatasetType" + required: + - id + - type + - attributes + type: object + LLMObsDatasetCloneRequest: + description: Request to clone an LLM Observability dataset. + properties: + data: + $ref: "#/components/schemas/LLMObsDatasetCloneDataRequest" + required: + - data + type: object LLMObsDatasetDataAttributesRequest: description: Attributes for creating an LLM Observability dataset. properties: @@ -45449,6 +45585,15 @@ components: required: - id type: object + LLMObsDatasetExportFormat: + default: csv + description: Supported export format for an LLM Observability dataset. + enum: + - csv + example: csv + type: string + x-enum-varnames: + - CSV LLMObsDatasetRecordDataResponse: description: A single LLM Observability dataset record. properties: @@ -45502,6 +45647,22 @@ components: required: - input type: object + LLMObsDatasetRecordTagOperations: + description: Explicit tag operations for updating records. Operations are applied in order, Remove then Add then Set. `set` is the final override; if specified, the result of `remove` and `add` is discarded. + properties: + add: + $ref: "#/components/schemas/LLMObsDatasetRecordTagsList" + remove: + $ref: "#/components/schemas/LLMObsDatasetRecordTagsList" + set: + $ref: "#/components/schemas/LLMObsDatasetRecordTagsList" + type: object + LLMObsDatasetRecordTagsList: + description: List of tag strings. + items: + description: A tag. + type: string + type: array LLMObsDatasetRecordUpdateItem: description: A record update payload for an LLM Observability dataset. properties: @@ -45618,6 +45779,14 @@ components: required: - data type: object + LLMObsDatasetRecordsUploadFile: + description: Multipart payload for uploading dataset records from a file. + properties: + file: + description: The records file to upload. Currently only CSV is supported. The file must include an `input` column. Optional columns include `id`, `expected_output`, `metadata`, and `tags`. + format: binary + type: string + type: object LLMObsDatasetRequest: description: Request to create an LLM Observability dataset. properties: @@ -45634,6 +45803,42 @@ components: required: - data type: object + LLMObsDatasetRestoreVersionDataAttributesRequest: + description: Attributes for restoring an LLM Observability dataset to a previous version. + properties: + dataset_version: + description: Version number of the dataset to restore. Must be between 0 and the current version of the dataset, inclusive. + example: 1 + format: int32 + maximum: 2147483647 + type: integer + required: + - dataset_version + type: object + LLMObsDatasetRestoreVersionDataRequest: + description: Data object for restoring an LLM Observability dataset to a previous version. + properties: + attributes: + $ref: "#/components/schemas/LLMObsDatasetRestoreVersionDataAttributesRequest" + id: + description: Unique identifier of the dataset to restore. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + type: string + type: + $ref: "#/components/schemas/LLMObsDatasetType" + required: + - id + - type + - attributes + type: object + LLMObsDatasetRestoreVersionRequest: + description: Request to restore an LLM Observability dataset to a previous version. + properties: + data: + $ref: "#/components/schemas/LLMObsDatasetRestoreVersionDataRequest" + required: + - data + type: object LLMObsDatasetType: description: Resource type of an LLM Observability dataset. enum: @@ -129604,10 +129809,10 @@ 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/{project_id}/datasets/{dataset_id}/draft_state: - get: - description: Retrieve the draft state of a dataset, including whether it is currently locked for editing and which user holds the lock. - operationId: GetLLMObsDatasetDraftState + /api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/batch_update: + post: + description: Insert, update, and delete records in a single dataset operation. By default, a new dataset version is created when the batch is applied. + operationId: BatchUpdateLLMObsDataset parameters: - description: The ID of the LLM Observability project. example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" @@ -129623,6 +129828,137 @@ paths: required: true schema: type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + create_new_version: true + delete_records: + - rec-old-record-1 + insert_records: + - expected_output: + answer: "Paris" + input: + question: "What is the capital of France?" + tags: + - "topic:geography" + update_records: + - expected_output: + answer: "Paris, France" + id: rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c + id: 9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d + type: datasets + schema: + $ref: "#/components/schemas/LLMObsDatasetBatchUpdateRequest" + description: Batch update payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - records: + - created_at: "2024-01-15T10:30:00Z" + dataset_id: 9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d + expected_output: + answer: "Paris, France" + id: rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c + input: + question: "What is the capital of France?" + metadata: + updated_at: "2024-01-15T10:30:00Z" + schema: + $ref: "#/components/schemas/LLMObsDatasetRecordsMutationResponse" + 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 + "413": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Payload Too Large + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Batch update LLM Observability dataset records + 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/{project_id}/datasets/{dataset_id}/clone: + post: + description: Clone a dataset, copying its current records into a new dataset within the same project. + operationId: CloneLLMObsDataset + parameters: + - description: The ID of the LLM Observability project. + example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" + in: path + name: project_id + required: true + schema: + type: string + - description: The ID of the source LLM Observability dataset to clone. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + in: path + name: dataset_id + required: true + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: "Clone of the original dataset for experimentation." + name: "My cloned dataset" + id: 9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d + type: datasets + schema: + $ref: "#/components/schemas/LLMObsDatasetCloneRequest" + description: Clone dataset payload. + required: true responses: "200": content: @@ -129632,16 +129968,16 @@ paths: value: data: attributes: - drafting_since: "2024-01-15T10:30:00Z" - user: - email: jane.doe@example.com - handle: jane.doe@example.com - id: 00000000-0000-0000-0000-000000000010 - name: Jane Doe - id: 9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d - type: draft_state_data + created_at: "2024-01-15T10:30:00Z" + current_version: 0 + description: "Clone of the original dataset for experimentation." + metadata: + name: "My cloned dataset" + updated_at: "2024-01-15T10:30:00Z" + id: 7c8d4e9a-1234-5678-9abc-def012345678 + type: datasets schema: - $ref: "#/components/schemas/LLMObsDatasetDraftStateResponse" + $ref: "#/components/schemas/LLMObsDatasetResponse" description: OK "400": content: @@ -129678,16 +130014,96 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Get LLM Observability dataset draft state + summary: Clone an LLM Observability dataset 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/{project_id}/datasets/{dataset_id}/draft_state/lock: - patch: - description: Acquire the draft lock on a dataset for the calling user. The lock prevents other users from concurrently editing the dataset draft. - operationId: LockLLMObsDatasetDraftState + /api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/draft_state: + get: + description: Retrieve the draft state of a dataset, including whether it is currently locked for editing and which user holds the lock. + operationId: GetLLMObsDatasetDraftState + parameters: + - description: The ID of the LLM Observability project. + example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" + in: path + name: project_id + required: true + schema: + type: string + - description: The ID of the LLM Observability dataset. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + in: path + name: dataset_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + drafting_since: "2024-01-15T10:30:00Z" + user: + email: jane.doe@example.com + handle: jane.doe@example.com + id: 00000000-0000-0000-0000-000000000010 + name: Jane Doe + id: 9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d + type: draft_state_data + schema: + $ref: "#/components/schemas/LLMObsDatasetDraftStateResponse" + 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: Get LLM Observability dataset draft state + 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/{project_id}/datasets/{dataset_id}/draft_state/lock: + patch: + description: Acquire the draft lock on a dataset for the calling user. The lock prevents other users from concurrently editing the dataset draft. + operationId: LockLLMObsDatasetDraftState parameters: - description: The ID of the LLM Observability project. example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" @@ -129827,6 +130243,88 @@ 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/{project_id}/datasets/{dataset_id}/export: + get: + description: Download the contents of a dataset as a CSV file. The download is streamed and includes one row per dataset record. + operationId: ExportLLMObsDataset + parameters: + - description: The ID of the LLM Observability project. + example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" + in: path + name: project_id + required: true + schema: + type: string + - description: The ID of the LLM Observability dataset. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + in: path + name: dataset_id + required: true + schema: + type: string + - description: Export format for the dataset contents. Only `csv` is currently supported. + in: query + name: format + schema: + $ref: "#/components/schemas/LLMObsDatasetExportFormat" + - description: Version of the dataset to export. If omitted, the current version is used. Must be between 0 and the current version of the dataset, inclusive. + in: query + name: version + schema: + format: int64 + maximum: 2147483647 + type: integer + responses: + "200": + content: + text/csv: + examples: + default: + value: "id,input,expected_output,metadata,tags\nrec-1,\"What is 2+2?\",\"4\",{},\"\"" + schema: + type: string + 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: Export an LLM Observability dataset + 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/{project_id}/datasets/{dataset_id}/records: get: description: List all records in an LLM Observability dataset, sorted by creation date, newest first. @@ -130137,6 +130635,84 @@ 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/{project_id}/datasets/{dataset_id}/restore: + post: + description: Restore a dataset to a previous version. The dataset's current version is bumped, and its records are replaced with the records from the specified prior version. + operationId: RestoreLLMObsDatasetVersion + parameters: + - description: The ID of the LLM Observability project. + example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" + in: path + name: project_id + required: true + schema: + type: string + - description: The ID of the LLM Observability dataset. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + in: path + name: dataset_id + required: true + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + dataset_version: 1 + id: 9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d + type: datasets + schema: + $ref: "#/components/schemas/LLMObsDatasetRestoreVersionRequest" + description: Restore dataset version payload. + required: true + responses: + "200": + 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: Restore an LLM Observability dataset version + 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/{project_id}/datasets/{dataset_id}/versions: get: description: List the active versions of a dataset. A version is created each time a dataset is referenced by an experiment run. @@ -130220,6 +130796,111 @@ 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/v2/{project_id}/datasets/{dataset_id}/records/upload: + post: + description: |- + Upload records to a dataset from a file. The request is a `multipart/form-data` upload containing a single `file` part. + Currently only CSV is supported. The CSV must include an `input` column. Optional columns are `id`, `expected_output`, `metadata`, and `tags`. + + The response is a Server-Sent Events stream (`text/event-stream`) emitting progress updates while records are processed. The stream emits the following named events: + - `progress`: incremental record counts written so far. + - `completed`: terminal event with a JSON body containing `records_created`. + - `error`: terminal event with a JSON body containing an error `message`. + operationId: UploadLLMObsDatasetRecordsFile + parameters: + - description: The ID of the LLM Observability project. + example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" + in: path + name: project_id + required: true + schema: + type: string + - description: The ID of the LLM Observability dataset. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + in: path + name: dataset_id + required: true + schema: + type: string + - description: Whether to skip records whose `input` already exists in the dataset. Defaults to `false`. + in: query + name: deduplicate + schema: + default: false + type: boolean + - description: Whether to overwrite existing records that share the same user-provided `id`. Defaults to `true`. + in: query + name: overwrite + schema: + default: true + type: boolean + - description: Tags to apply to every uploaded record, in addition to any tags defined on individual rows. Can be repeated, e.g. `tags=env:prod&tags=team:ai`. + in: query + name: tags + schema: + items: + type: string + type: array + - description: Whether to enrich the response with user metadata. + in: query + name: "include[user_data]" + schema: + type: boolean + requestBody: + content: + multipart/form-data: + examples: + default: + value: + file: records.csv + schema: + $ref: "#/components/schemas/LLMObsDatasetRecordsUploadFile" + description: Multipart upload payload containing the records file. + required: true + responses: + "200": + 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: Upload records to an LLM Observability dataset + 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/v3/experiments/{experiment_id}/events: get: description: Retrieve spans and experiment-level summary metrics for a given experiment with cursor-based pagination. diff --git a/examples/v2/llm-observability/BatchUpdateLLMObsDataset.rb b/examples/v2/llm-observability/BatchUpdateLLMObsDataset.rb new file mode 100644 index 000000000000..d892f110fddd --- /dev/null +++ b/examples/v2/llm-observability/BatchUpdateLLMObsDataset.rb @@ -0,0 +1,45 @@ +# Batch update LLM Observability dataset records returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.batch_update_llm_obs_dataset".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +body = DatadogAPIClient::V2::LLMObsDatasetBatchUpdateRequest.new({ + data: DatadogAPIClient::V2::LLMObsDatasetBatchUpdateDataRequest.new({ + attributes: DatadogAPIClient::V2::LLMObsDatasetBatchUpdateDataAttributesRequest.new({ + create_new_version: true, + delete_records: [], + insert_records: [ + DatadogAPIClient::V2::LLMObsDatasetBatchUpdateInsertRecord.new({ + expected_output: nil, + id: "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c", + input: nil, + tag_operations: DatadogAPIClient::V2::LLMObsDatasetRecordTagOperations.new({ + add: [], + remove: [], + set: [], + }), + tags: [], + }), + ], + tags: [], + update_records: [ + DatadogAPIClient::V2::LLMObsDatasetBatchUpdateUpdateRecord.new({ + expected_output: nil, + id: "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c", + input: nil, + tag_operations: DatadogAPIClient::V2::LLMObsDatasetRecordTagOperations.new({ + add: [], + remove: [], + set: [], + }), + }), + ], + }), + id: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", + type: DatadogAPIClient::V2::LLMObsDatasetType::DATASETS, + }), +}) +p api_instance.batch_update_llm_obs_dataset("project_id", "dataset_id", body) diff --git a/examples/v2/llm-observability/CloneLLMObsDataset.rb b/examples/v2/llm-observability/CloneLLMObsDataset.rb new file mode 100644 index 000000000000..b425735a79b0 --- /dev/null +++ b/examples/v2/llm-observability/CloneLLMObsDataset.rb @@ -0,0 +1,19 @@ +# Clone an LLM Observability dataset returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.clone_llm_obs_dataset".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +body = DatadogAPIClient::V2::LLMObsDatasetCloneRequest.new({ + data: DatadogAPIClient::V2::LLMObsDatasetCloneDataRequest.new({ + attributes: DatadogAPIClient::V2::LLMObsDatasetCloneDataAttributesRequest.new({ + description: "Clone of the original dataset for experimentation.", + name: "My cloned dataset", + }), + id: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", + type: DatadogAPIClient::V2::LLMObsDatasetType::DATASETS, + }), +}) +p api_instance.clone_llm_obs_dataset("project_id", "dataset_id", body) diff --git a/examples/v2/llm-observability/ExportLLMObsDataset.rb b/examples/v2/llm-observability/ExportLLMObsDataset.rb new file mode 100644 index 000000000000..ef1cfac8fa6b --- /dev/null +++ b/examples/v2/llm-observability/ExportLLMObsDataset.rb @@ -0,0 +1,8 @@ +# Export an LLM Observability dataset returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.export_llm_obs_dataset".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new +p api_instance.export_llm_obs_dataset("project_id", "dataset_id") diff --git a/examples/v2/llm-observability/RestoreLLMObsDatasetVersion.rb b/examples/v2/llm-observability/RestoreLLMObsDatasetVersion.rb new file mode 100644 index 000000000000..d9c702378916 --- /dev/null +++ b/examples/v2/llm-observability/RestoreLLMObsDatasetVersion.rb @@ -0,0 +1,18 @@ +# Restore an LLM Observability dataset version returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.restore_llm_obs_dataset_version".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +body = DatadogAPIClient::V2::LLMObsDatasetRestoreVersionRequest.new({ + data: DatadogAPIClient::V2::LLMObsDatasetRestoreVersionDataRequest.new({ + attributes: DatadogAPIClient::V2::LLMObsDatasetRestoreVersionDataAttributesRequest.new({ + dataset_version: 1, + }), + id: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", + type: DatadogAPIClient::V2::LLMObsDatasetType::DATASETS, + }), +}) +p api_instance.restore_llm_obs_dataset_version("project_id", "dataset_id", body) diff --git a/examples/v2/llm-observability/UploadLLMObsDatasetRecordsFile.rb b/examples/v2/llm-observability/UploadLLMObsDatasetRecordsFile.rb new file mode 100644 index 000000000000..9701f51caa04 --- /dev/null +++ b/examples/v2/llm-observability/UploadLLMObsDatasetRecordsFile.rb @@ -0,0 +1,8 @@ +# Upload records to an LLM Observability dataset returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.upload_llm_obs_dataset_records_file".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new +p api_instance.upload_llm_obs_dataset_records_file("project_id", "dataset_id") diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index fb9b295c7eca..b9b3e48f825d 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1054,6 +1054,16 @@ "dataset_id" => "String", "body" => "LLMObsDatasetUpdateRequest", }, + "v2.BatchUpdateLLMObsDataset" => { + "project_id" => "String", + "dataset_id" => "String", + "body" => "LLMObsDatasetBatchUpdateRequest", + }, + "v2.CloneLLMObsDataset" => { + "project_id" => "String", + "dataset_id" => "String", + "body" => "LLMObsDatasetCloneRequest", + }, "v2.GetLLMObsDatasetDraftState" => { "project_id" => "String", "dataset_id" => "String", @@ -1066,6 +1076,12 @@ "project_id" => "String", "dataset_id" => "String", }, + "v2.ExportLLMObsDataset" => { + "project_id" => "String", + "dataset_id" => "String", + "format" => "LLMObsDatasetExportFormat", + "version" => "Integer", + }, "v2.ListLLMObsDatasetRecords" => { "project_id" => "String", "dataset_id" => "String", @@ -1088,10 +1104,24 @@ "dataset_id" => "String", "body" => "LLMObsDeleteDatasetRecordsRequest", }, + "v2.RestoreLLMObsDatasetVersion" => { + "project_id" => "String", + "dataset_id" => "String", + "body" => "LLMObsDatasetRestoreVersionRequest", + }, "v2.ListLLMObsDatasetVersions" => { "project_id" => "String", "dataset_id" => "String", }, + "v2.UploadLLMObsDatasetRecordsFile" => { + "project_id" => "String", + "dataset_id" => "String", + "deduplicate" => "Boolean", + "overwrite" => "Boolean", + "tags" => "Array", + "include_user_data" => "Boolean", + "file" => "File", + }, "v2.ListLLMObsExperimentEvents" => { "experiment_id" => "String", "page_limit" => "Integer", diff --git a/features/v2/llm_observability.feature b/features/v2/llm_observability.feature index 63b64631db28..ea384fa8ed44 100644 --- a/features/v2/llm_observability.feature +++ b/features/v2/llm_observability.feature @@ -109,6 +109,76 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: Batch update LLM Observability dataset records returns "Bad Request" response + Given operation "BatchUpdateLLMObsDataset" enabled + And new "BatchUpdateLLMObsDataset" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"create_new_version": true, "delete_records": [], "insert_records": [{"expected_output": null, "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c", "input": null, "tag_operations": {"add": [], "remove": [], "set": []}, "tags": []}], "tags": [], "update_records": [{"expected_output": null, "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c", "input": null, "tag_operations": {"add": [], "remove": [], "set": []}}]}, "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "type": "datasets"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Batch update LLM Observability dataset records returns "Not Found" response + Given operation "BatchUpdateLLMObsDataset" enabled + And new "BatchUpdateLLMObsDataset" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"create_new_version": true, "delete_records": [], "insert_records": [{"expected_output": null, "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c", "input": null, "tag_operations": {"add": [], "remove": [], "set": []}, "tags": []}], "tags": [], "update_records": [{"expected_output": null, "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c", "input": null, "tag_operations": {"add": [], "remove": [], "set": []}}]}, "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "type": "datasets"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Batch update LLM Observability dataset records returns "OK" response + Given operation "BatchUpdateLLMObsDataset" enabled + And new "BatchUpdateLLMObsDataset" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"create_new_version": true, "delete_records": [], "insert_records": [{"expected_output": null, "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c", "input": null, "tag_operations": {"add": [], "remove": [], "set": []}, "tags": []}], "tags": [], "update_records": [{"expected_output": null, "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c", "input": null, "tag_operations": {"add": [], "remove": [], "set": []}}]}, "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "type": "datasets"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: Batch update LLM Observability dataset records returns "Payload Too Large" response + Given operation "BatchUpdateLLMObsDataset" enabled + And new "BatchUpdateLLMObsDataset" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"create_new_version": true, "delete_records": [], "insert_records": [{"expected_output": null, "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c", "input": null, "tag_operations": {"add": [], "remove": [], "set": []}, "tags": []}], "tags": [], "update_records": [{"expected_output": null, "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c", "input": null, "tag_operations": {"add": [], "remove": [], "set": []}}]}, "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "type": "datasets"}} + When the request is sent + Then the response status is 413 Payload Too Large + + @generated @skip @team:DataDog/ml-observability + Scenario: Clone an LLM Observability dataset returns "Bad Request" response + Given operation "CloneLLMObsDataset" enabled + And new "CloneLLMObsDataset" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Clone of the original dataset for experimentation.", "name": "My cloned dataset"}, "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "type": "datasets"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Clone an LLM Observability dataset returns "Not Found" response + Given operation "CloneLLMObsDataset" enabled + And new "CloneLLMObsDataset" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Clone of the original dataset for experimentation.", "name": "My cloned dataset"}, "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "type": "datasets"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Clone an LLM Observability dataset returns "OK" response + Given operation "CloneLLMObsDataset" enabled + And new "CloneLLMObsDataset" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Clone of the original dataset for experimentation.", "name": "My cloned dataset"}, "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "type": "datasets"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Create an LLM Observability annotation queue returns "Bad Request" response Given operation "CreateLLMObsAnnotationQueue" enabled @@ -417,6 +487,33 @@ Feature: LLM Observability When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/ml-observability + Scenario: Export an LLM Observability dataset returns "Bad Request" response + Given operation "ExportLLMObsDataset" enabled + And new "ExportLLMObsDataset" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Export an LLM Observability dataset returns "Not Found" response + Given operation "ExportLLMObsDataset" enabled + And new "ExportLLMObsDataset" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_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: Export an LLM Observability dataset returns "OK" response + Given operation "ExportLLMObsDataset" enabled + And new "ExportLLMObsDataset" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Get LLM Observability dataset draft state returns "Bad Request" response Given operation "GetLLMObsDatasetDraftState" enabled @@ -770,6 +867,36 @@ Feature: LLM Observability When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/ml-observability + Scenario: Restore an LLM Observability dataset version returns "Bad Request" response + Given operation "RestoreLLMObsDatasetVersion" enabled + And new "RestoreLLMObsDatasetVersion" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"dataset_version": 1}, "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "type": "datasets"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Restore an LLM Observability dataset version returns "Not Found" response + Given operation "RestoreLLMObsDatasetVersion" enabled + And new "RestoreLLMObsDatasetVersion" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"dataset_version": 1}, "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "type": "datasets"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Restore an LLM Observability dataset version returns "OK" response + Given operation "RestoreLLMObsDatasetVersion" enabled + And new "RestoreLLMObsDatasetVersion" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"dataset_version": 1}, "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "type": "datasets"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Run an LLM inference returns "Bad Request" response Given operation "CreateLLMObsIntegrationInference" enabled @@ -1040,3 +1167,30 @@ Feature: LLM Observability And body with value {"data": {"attributes": {"annotation_schema": {"label_schemas": [{"description": "Rating of the response quality.", "has_assessment": false, "has_reasoning": false, "id": "abc-123", "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 + + @generated @skip @team:DataDog/ml-observability + Scenario: Upload records to an LLM Observability dataset returns "Bad Request" response + Given operation "UploadLLMObsDatasetRecordsFile" enabled + And new "UploadLLMObsDatasetRecordsFile" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Upload records to an LLM Observability dataset returns "Not Found" response + Given operation "UploadLLMObsDatasetRecordsFile" enabled + And new "UploadLLMObsDatasetRecordsFile" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_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: Upload records to an LLM Observability dataset returns "OK" response + Given operation "UploadLLMObsDatasetRecordsFile" enabled + And new "UploadLLMObsDatasetRecordsFile" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index b6003df86834..33b907421860 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4016,6 +4016,20 @@ "type": "idempotent" } }, + "BatchUpdateLLMObsDataset": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, + "CloneLLMObsDataset": { + "tag": "LLM Observability", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, "GetLLMObsDatasetDraftState": { "tag": "LLM Observability", "undo": { @@ -4034,6 +4048,12 @@ "type": "idempotent" } }, + "ExportLLMObsDataset": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, "ListLLMObsDatasetRecords": { "tag": "LLM Observability", "undo": { @@ -4071,12 +4091,24 @@ "type": "unsafe" } }, + "RestoreLLMObsDatasetVersion": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, "ListLLMObsDatasetVersions": { "tag": "LLM Observability", "undo": { "type": "safe" } }, + "UploadLLMObsDatasetRecordsFile": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, "ListLLMObsExperimentEvents": { "tag": "LLM Observability", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 926289b770a4..eeeec9db856f 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -208,6 +208,8 @@ def initialize "v2.trigger_fleet_schedule": false, "v2.update_fleet_schedule": false, "v2.aggregate_llm_obs_experimentation": false, + "v2.batch_update_llm_obs_dataset": false, + "v2.clone_llm_obs_dataset": false, "v2.create_llm_obs_annotation_queue": false, "v2.create_llm_obs_annotation_queue_interactions": false, "v2.create_llm_obs_dataset": false, @@ -224,6 +226,7 @@ def initialize "v2.delete_llm_obs_datasets": false, "v2.delete_llm_obs_experiments": false, "v2.delete_llm_obs_projects": false, + "v2.export_llm_obs_dataset": false, "v2.get_llm_obs_annotated_interactions": false, "v2.get_llm_obs_annotated_interactions_by_trace_i_ds": false, "v2.get_llm_obs_annotation_queue_label_schema": false, @@ -240,6 +243,7 @@ def initialize "v2.list_llm_obs_projects": false, "v2.list_llm_obs_spans": false, "v2.lock_llm_obs_dataset_draft_state": false, + "v2.restore_llm_obs_dataset_version": false, "v2.search_llm_obs_experimentation": false, "v2.search_llm_obs_spans": false, "v2.simple_search_llm_obs_experimentation": false, @@ -251,6 +255,7 @@ def initialize "v2.update_llm_obs_dataset_records": false, "v2.update_llm_obs_experiment": false, "v2.update_llm_obs_project": false, + "v2.upload_llm_obs_dataset_records_file": false, "v2.create_annotation": false, "v2.delete_annotation": false, "v2.get_page_annotations": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 6ed9f06191bc..6eaf688c435b 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3905,6 +3905,14 @@ def overrides "v2.llm_obs_data_deletion_response_attributes" => "LLMObsDataDeletionResponseAttributes", "v2.llm_obs_data_deletion_response_data" => "LLMObsDataDeletionResponseData", "v2.llm_obs_data_deletion_response_type" => "LLMObsDataDeletionResponseType", + "v2.llm_obs_dataset_batch_update_data_attributes_request" => "LLMObsDatasetBatchUpdateDataAttributesRequest", + "v2.llm_obs_dataset_batch_update_data_request" => "LLMObsDatasetBatchUpdateDataRequest", + "v2.llm_obs_dataset_batch_update_insert_record" => "LLMObsDatasetBatchUpdateInsertRecord", + "v2.llm_obs_dataset_batch_update_request" => "LLMObsDatasetBatchUpdateRequest", + "v2.llm_obs_dataset_batch_update_update_record" => "LLMObsDatasetBatchUpdateUpdateRecord", + "v2.llm_obs_dataset_clone_data_attributes_request" => "LLMObsDatasetCloneDataAttributesRequest", + "v2.llm_obs_dataset_clone_data_request" => "LLMObsDatasetCloneDataRequest", + "v2.llm_obs_dataset_clone_request" => "LLMObsDatasetCloneRequest", "v2.llm_obs_dataset_data_attributes_request" => "LLMObsDatasetDataAttributesRequest", "v2.llm_obs_dataset_data_attributes_response" => "LLMObsDatasetDataAttributesResponse", "v2.llm_obs_dataset_data_request" => "LLMObsDatasetDataRequest", @@ -3914,6 +3922,7 @@ def overrides "v2.llm_obs_dataset_draft_state_response" => "LLMObsDatasetDraftStateResponse", "v2.llm_obs_dataset_draft_state_type" => "LLMObsDatasetDraftStateType", "v2.llm_obs_dataset_draft_state_user" => "LLMObsDatasetDraftStateUser", + "v2.llm_obs_dataset_export_format" => "LLMObsDatasetExportFormat", "v2.llm_obs_dataset_record_data_response" => "LLMObsDatasetRecordDataResponse", "v2.llm_obs_dataset_record_item" => "LLMObsDatasetRecordItem", "v2.llm_obs_dataset_records_data_attributes_request" => "LLMObsDatasetRecordsDataAttributesRequest", @@ -3925,9 +3934,14 @@ def overrides "v2.llm_obs_dataset_records_update_data_attributes_request" => "LLMObsDatasetRecordsUpdateDataAttributesRequest", "v2.llm_obs_dataset_records_update_data_request" => "LLMObsDatasetRecordsUpdateDataRequest", "v2.llm_obs_dataset_records_update_request" => "LLMObsDatasetRecordsUpdateRequest", + "v2.llm_obs_dataset_records_upload_file" => "LLMObsDatasetRecordsUploadFile", + "v2.llm_obs_dataset_record_tag_operations" => "LLMObsDatasetRecordTagOperations", "v2.llm_obs_dataset_record_update_item" => "LLMObsDatasetRecordUpdateItem", "v2.llm_obs_dataset_request" => "LLMObsDatasetRequest", "v2.llm_obs_dataset_response" => "LLMObsDatasetResponse", + "v2.llm_obs_dataset_restore_version_data_attributes_request" => "LLMObsDatasetRestoreVersionDataAttributesRequest", + "v2.llm_obs_dataset_restore_version_data_request" => "LLMObsDatasetRestoreVersionDataRequest", + "v2.llm_obs_dataset_restore_version_request" => "LLMObsDatasetRestoreVersionRequest", "v2.llm_obs_datasets_response" => "LLMObsDatasetsResponse", "v2.llm_obs_dataset_type" => "LLMObsDatasetType", "v2.llm_obs_dataset_update_data_attributes_request" => "LLMObsDatasetUpdateDataAttributesRequest", diff --git a/lib/datadog_api_client/v2/api/llm_observability_api.rb b/lib/datadog_api_client/v2/api/llm_observability_api.rb index 64031b0dcacc..4e8a60da520b 100644 --- a/lib/datadog_api_client/v2/api/llm_observability_api.rb +++ b/lib/datadog_api_client/v2/api/llm_observability_api.rb @@ -99,6 +99,172 @@ def aggregate_llm_obs_experimentation_with_http_info(body, opts = {}) return data, status_code, headers end + # Batch update LLM Observability dataset records. + # + # @see #batch_update_llm_obs_dataset_with_http_info + def batch_update_llm_obs_dataset(project_id, dataset_id, body, opts = {}) + data, _status_code, _headers = batch_update_llm_obs_dataset_with_http_info(project_id, dataset_id, body, opts) + data + end + + # Batch update LLM Observability dataset records. + # + # Insert, update, and delete records in a single dataset operation. By default, a new dataset version is created when the batch is applied. + # + # @param project_id [String] The ID of the LLM Observability project. + # @param dataset_id [String] The ID of the LLM Observability dataset. + # @param body [LLMObsDatasetBatchUpdateRequest] Batch update payload. + # @param opts [Hash] the optional parameters + # @return [Array<(LLMObsDatasetRecordsMutationResponse, Integer, Hash)>] LLMObsDatasetRecordsMutationResponse data, response status code and response headers + def batch_update_llm_obs_dataset_with_http_info(project_id, dataset_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.batch_update_llm_obs_dataset".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.batch_update_llm_obs_dataset") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.batch_update_llm_obs_dataset")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.batch_update_llm_obs_dataset ...' + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling LLMObservabilityAPI.batch_update_llm_obs_dataset" + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling LLMObservabilityAPI.batch_update_llm_obs_dataset" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling LLMObservabilityAPI.batch_update_llm_obs_dataset" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/batch_update'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{dataset_id}', CGI.escape(dataset_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'LLMObsDatasetRecordsMutationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :batch_update_llm_obs_dataset, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#batch_update_llm_obs_dataset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Clone an LLM Observability dataset. + # + # @see #clone_llm_obs_dataset_with_http_info + def clone_llm_obs_dataset(project_id, dataset_id, body, opts = {}) + data, _status_code, _headers = clone_llm_obs_dataset_with_http_info(project_id, dataset_id, body, opts) + data + end + + # Clone an LLM Observability dataset. + # + # Clone a dataset, copying its current records into a new dataset within the same project. + # + # @param project_id [String] The ID of the LLM Observability project. + # @param dataset_id [String] The ID of the source LLM Observability dataset to clone. + # @param body [LLMObsDatasetCloneRequest] Clone dataset payload. + # @param opts [Hash] the optional parameters + # @return [Array<(LLMObsDatasetResponse, Integer, Hash)>] LLMObsDatasetResponse data, response status code and response headers + def clone_llm_obs_dataset_with_http_info(project_id, dataset_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.clone_llm_obs_dataset".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.clone_llm_obs_dataset") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.clone_llm_obs_dataset")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.clone_llm_obs_dataset ...' + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling LLMObservabilityAPI.clone_llm_obs_dataset" + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling LLMObservabilityAPI.clone_llm_obs_dataset" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling LLMObservabilityAPI.clone_llm_obs_dataset" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/clone'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{dataset_id}', CGI.escape(dataset_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'LLMObsDatasetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :clone_llm_obs_dataset, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#clone_llm_obs_dataset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create an LLM Observability annotation queue. # # @see #create_llm_obs_annotation_queue_with_http_info @@ -1335,6 +1501,93 @@ def delete_llm_obs_projects_with_http_info(body, opts = {}) return data, status_code, headers end + # Export an LLM Observability dataset. + # + # @see #export_llm_obs_dataset_with_http_info + def export_llm_obs_dataset(project_id, dataset_id, opts = {}) + data, _status_code, _headers = export_llm_obs_dataset_with_http_info(project_id, dataset_id, opts) + data + end + + # Export an LLM Observability dataset. + # + # Download the contents of a dataset as a CSV file. The download is streamed and includes one row per dataset record. + # + # @param project_id [String] The ID of the LLM Observability project. + # @param dataset_id [String] The ID of the LLM Observability dataset. + # @param opts [Hash] the optional parameters + # @option opts [LLMObsDatasetExportFormat] :format Export format for the dataset contents. Only `csv` is currently supported. + # @option opts [Integer] :version Version of the dataset to export. If omitted, the current version is used. Must be between 0 and the current version of the dataset, inclusive. + # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers + def export_llm_obs_dataset_with_http_info(project_id, dataset_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.export_llm_obs_dataset".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.export_llm_obs_dataset") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.export_llm_obs_dataset")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.export_llm_obs_dataset ...' + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling LLMObservabilityAPI.export_llm_obs_dataset" + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling LLMObservabilityAPI.export_llm_obs_dataset" + end + allowable_values = ['csv'] + if @api_client.config.client_side_validation && opts[:'format'] && !allowable_values.include?(opts[:'format']) + fail ArgumentError, "invalid value for \"format\", must be one of #{allowable_values}" + end + if @api_client.config.client_side_validation && !opts[:'version'].nil? && opts[:'version'] > 2147483647 + fail ArgumentError, 'invalid value for "opts[:"version"]" when calling LLMObservabilityAPI.export_llm_obs_dataset, must be smaller than or equal to 2147483647.' + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/export'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{dataset_id}', CGI.escape(dataset_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'format'] = opts[:'format'] if !opts[:'format'].nil? + query_params[:'version'] = opts[:'version'] if !opts[:'version'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['text/csv', 'application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'String' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :export_llm_obs_dataset, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#export_llm_obs_dataset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get annotated queue interactions. # # @see #get_llm_obs_annotated_interactions_with_http_info @@ -2570,6 +2823,89 @@ def lock_llm_obs_dataset_draft_state_with_http_info(project_id, dataset_id, opts return data, status_code, headers end + # Restore an LLM Observability dataset version. + # + # @see #restore_llm_obs_dataset_version_with_http_info + def restore_llm_obs_dataset_version(project_id, dataset_id, body, opts = {}) + restore_llm_obs_dataset_version_with_http_info(project_id, dataset_id, body, opts) + nil + end + + # Restore an LLM Observability dataset version. + # + # Restore a dataset to a previous version. The dataset's current version is bumped, and its records are replaced with the records from the specified prior version. + # + # @param project_id [String] The ID of the LLM Observability project. + # @param dataset_id [String] The ID of the LLM Observability dataset. + # @param body [LLMObsDatasetRestoreVersionRequest] Restore dataset version payload. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def restore_llm_obs_dataset_version_with_http_info(project_id, dataset_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.restore_llm_obs_dataset_version".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.restore_llm_obs_dataset_version") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.restore_llm_obs_dataset_version")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.restore_llm_obs_dataset_version ...' + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling LLMObservabilityAPI.restore_llm_obs_dataset_version" + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling LLMObservabilityAPI.restore_llm_obs_dataset_version" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling LLMObservabilityAPI.restore_llm_obs_dataset_version" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/restore'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{dataset_id}', CGI.escape(dataset_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :restore_llm_obs_dataset_version, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#restore_llm_obs_dataset_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Search LLM Observability experimentation entities. # # @see #search_llm_obs_experimentation_with_http_info @@ -3430,5 +3766,100 @@ def update_llm_obs_project_with_http_info(project_id, body, opts = {}) end return data, status_code, headers end + + # Upload records to an LLM Observability dataset. + # + # @see #upload_llm_obs_dataset_records_file_with_http_info + def upload_llm_obs_dataset_records_file(project_id, dataset_id, opts = {}) + upload_llm_obs_dataset_records_file_with_http_info(project_id, dataset_id, opts) + nil + end + + # Upload records to an LLM Observability dataset. + # + # Upload records to a dataset from a file. The request is a `multipart/form-data` upload containing a single `file` part. + # Currently only CSV is supported. The CSV must include an `input` column. Optional columns are `id`, `expected_output`, `metadata`, and `tags`. + # + # The response is a Server-Sent Events stream (`text/event-stream`) emitting progress updates while records are processed. The stream emits the following named events: + # - `progress`: incremental record counts written so far. + # - `completed`: terminal event with a JSON body containing `records_created`. + # - `error`: terminal event with a JSON body containing an error `message`. + # + # @param project_id [String] The ID of the LLM Observability project. + # @param dataset_id [String] The ID of the LLM Observability dataset. + # @param opts [Hash] the optional parameters + # @option opts [Boolean] :deduplicate Whether to skip records whose `input` already exists in the dataset. Defaults to `false`. + # @option opts [Boolean] :overwrite Whether to overwrite existing records that share the same user-provided `id`. Defaults to `true`. + # @option opts [Array] :tags Tags to apply to every uploaded record, in addition to any tags defined on individual rows. Can be repeated, e.g. `tags=env:prod&tags=team:ai`. + # @option opts [Boolean] :include_user_data Whether to enrich the response with user metadata. + # @option opts [File] :file The records file to upload. Currently only CSV is supported. The file must include an `input` column. Optional columns include `id`, `expected_output`, `metadata`, and `tags`. + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def upload_llm_obs_dataset_records_file_with_http_info(project_id, dataset_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.upload_llm_obs_dataset_records_file".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.upload_llm_obs_dataset_records_file") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.upload_llm_obs_dataset_records_file")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.upload_llm_obs_dataset_records_file ...' + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling LLMObservabilityAPI.upload_llm_obs_dataset_records_file" + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling LLMObservabilityAPI.upload_llm_obs_dataset_records_file" + end + # resource path + local_var_path = '/api/v2/llm-obs/v2/{project_id}/datasets/{dataset_id}/records/upload'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{dataset_id}', CGI.escape(dataset_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'deduplicate'] = opts[:'deduplicate'] if !opts[:'deduplicate'].nil? + query_params[:'overwrite'] = opts[:'overwrite'] if !opts[:'overwrite'].nil? + query_params[:'tags'] = @api_client.build_collection_param(opts[:'tags'], :multi) if !opts[:'tags'].nil? + query_params[:'include[user_data]'] = opts[:'include_user_data'] if !opts[:'include_user_data'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) + + # form parameters + form_params = opts[:form_params] || {} + form_params['file'] = opts[:'file'] if !opts[:'file'].nil? + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :upload_llm_obs_dataset_records_file, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#upload_llm_obs_dataset_records_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_data_attributes_request.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_data_attributes_request.rb new file mode 100644 index 000000000000..8616ccb38b13 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_data_attributes_request.rb @@ -0,0 +1,153 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for batch-updating records in an LLM Observability dataset. + class LLMObsDatasetBatchUpdateDataAttributesRequest + include BaseGenericModel + + # Whether to create a new dataset version when applying the batch update. Defaults to `true`. + attr_accessor :create_new_version + + # Record IDs to delete. + attr_accessor :delete_records + + # Records to insert. + attr_accessor :insert_records + + # List of tag strings. + attr_accessor :tags + + # Records to update by ID. + attr_accessor :update_records + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'create_new_version' => :'create_new_version', + :'delete_records' => :'delete_records', + :'insert_records' => :'insert_records', + :'tags' => :'tags', + :'update_records' => :'update_records' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'create_new_version' => :'Boolean', + :'delete_records' => :'Array', + :'insert_records' => :'Array', + :'tags' => :'Array', + :'update_records' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDatasetBatchUpdateDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'create_new_version') + self.create_new_version = attributes[:'create_new_version'] + end + + if attributes.key?(:'delete_records') + if (value = attributes[:'delete_records']).is_a?(Array) + self.delete_records = value + end + end + + if attributes.key?(:'insert_records') + if (value = attributes[:'insert_records']).is_a?(Array) + self.insert_records = value + end + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'update_records') + if (value = attributes[:'update_records']).is_a?(Array) + self.update_records = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + create_new_version == o.create_new_version && + delete_records == o.delete_records && + insert_records == o.insert_records && + tags == o.tags && + update_records == o.update_records && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [create_new_version, delete_records, insert_records, tags, update_records, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_data_request.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_data_request.rb new file mode 100644 index 000000000000..17f9342f9e1a --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_data_request.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for batch-updating records in an LLM Observability dataset. + class LLMObsDatasetBatchUpdateDataRequest + include BaseGenericModel + + # Attributes for batch-updating records in an LLM Observability dataset. + attr_reader :attributes + + # Unique identifier of the dataset. + attr_reader :id + + # Resource type of an LLM Observability dataset. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'LLMObsDatasetBatchUpdateDataAttributesRequest', + :'id' => :'String', + :'type' => :'LLMObsDatasetType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDatasetBatchUpdateDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_insert_record.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_insert_record.rb new file mode 100644 index 000000000000..c62390142111 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_insert_record.rb @@ -0,0 +1,166 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A record to insert as part of a batch update on an LLM Observability dataset. + class LLMObsDatasetBatchUpdateInsertRecord + include BaseGenericModel + + # Represents any valid JSON value. + attr_accessor :expected_output + + # Optional user-provided identifier for the record. If omitted, the server generates an identifier. + attr_accessor :id + + # Represents any valid JSON value. + attr_accessor :input + + # Arbitrary metadata associated with the record. + attr_accessor :metadata + + # Explicit tag operations for updating records. Operations are applied in order, Remove then Add then Set. `set` is the final override; if specified, the result of `remove` and `add` is discarded. + attr_accessor :tag_operations + + # List of tag strings. + attr_accessor :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'expected_output' => :'expected_output', + :'id' => :'id', + :'input' => :'input', + :'metadata' => :'metadata', + :'tag_operations' => :'tag_operations', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'expected_output' => :'AnyValue', + :'id' => :'String', + :'input' => :'AnyValue', + :'metadata' => :'Hash', + :'tag_operations' => :'LLMObsDatasetRecordTagOperations', + :'tags' => :'Array' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'expected_output', + :'input', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDatasetBatchUpdateInsertRecord` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'expected_output') + self.expected_output = attributes[:'expected_output'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'input') + self.input = attributes[:'input'] + end + + if attributes.key?(:'metadata') + self.metadata = attributes[:'metadata'] + end + + if attributes.key?(:'tag_operations') + self.tag_operations = attributes[:'tag_operations'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + expected_output == o.expected_output && + id == o.id && + input == o.input && + metadata == o.metadata && + tag_operations == o.tag_operations && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [expected_output, id, input, metadata, tag_operations, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_request.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_request.rb new file mode 100644 index 000000000000..c6d485ea22ec --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to batch-insert, update, and delete records in an LLM Observability dataset. + class LLMObsDatasetBatchUpdateRequest + include BaseGenericModel + + # Data object for batch-updating records in an LLM Observability dataset. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'LLMObsDatasetBatchUpdateDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDatasetBatchUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_update_record.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_update_record.rb new file mode 100644 index 000000000000..66ee0be8b426 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_update_record.rb @@ -0,0 +1,172 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A record update payload as part of a batch update on an LLM Observability dataset. + class LLMObsDatasetBatchUpdateUpdateRecord + include BaseGenericModel + + # Represents any valid JSON value. + attr_accessor :expected_output + + # Unique identifier of the record to update. + attr_reader :id + + # Represents any valid JSON value. + attr_accessor :input + + # Updated metadata associated with the record. + attr_accessor :metadata + + # Explicit tag operations for updating records. Operations are applied in order, Remove then Add then Set. `set` is the final override; if specified, the result of `remove` and `add` is discarded. + attr_accessor :tag_operations + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'expected_output' => :'expected_output', + :'id' => :'id', + :'input' => :'input', + :'metadata' => :'metadata', + :'tag_operations' => :'tag_operations' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'expected_output' => :'AnyValue', + :'id' => :'String', + :'input' => :'AnyValue', + :'metadata' => :'Hash', + :'tag_operations' => :'LLMObsDatasetRecordTagOperations' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'expected_output', + :'input', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDatasetBatchUpdateUpdateRecord` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'expected_output') + self.expected_output = attributes[:'expected_output'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'input') + self.input = attributes[:'input'] + end + + if attributes.key?(:'metadata') + self.metadata = attributes[:'metadata'] + end + + if attributes.key?(:'tag_operations') + self.tag_operations = attributes[:'tag_operations'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + expected_output == o.expected_output && + id == o.id && + input == o.input && + metadata == o.metadata && + tag_operations == o.tag_operations && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [expected_output, id, input, metadata, tag_operations, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_clone_data_attributes_request.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_clone_data_attributes_request.rb new file mode 100644 index 000000000000..ccb45631dd3c --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_clone_data_attributes_request.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for cloning an LLM Observability dataset. + class LLMObsDatasetCloneDataAttributesRequest + include BaseGenericModel + + # Description of the cloned dataset. + attr_accessor :description + + # Name of the cloned dataset. + attr_reader :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDatasetCloneDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_clone_data_request.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_clone_data_request.rb new file mode 100644 index 000000000000..65091ebc93e7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_clone_data_request.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for cloning an LLM Observability dataset. + class LLMObsDatasetCloneDataRequest + include BaseGenericModel + + # Attributes for cloning an LLM Observability dataset. + attr_reader :attributes + + # Identifier of the source dataset to clone. + attr_reader :id + + # Resource type of an LLM Observability dataset. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'LLMObsDatasetCloneDataAttributesRequest', + :'id' => :'String', + :'type' => :'LLMObsDatasetType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDatasetCloneDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_clone_request.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_clone_request.rb new file mode 100644 index 000000000000..0a8a93e40d4c --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_clone_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to clone an LLM Observability dataset. + class LLMObsDatasetCloneRequest + include BaseGenericModel + + # Data object for cloning an LLM Observability dataset. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'LLMObsDatasetCloneDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDatasetCloneRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_export_format.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_export_format.rb new file mode 100644 index 000000000000..a677ede43a28 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_export_format.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Supported export format for an LLM Observability dataset. + class LLMObsDatasetExportFormat + include BaseEnumModel + + CSV = "csv".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_record_tag_operations.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_record_tag_operations.rb new file mode 100644 index 000000000000..e68caaca5fd9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_record_tag_operations.rb @@ -0,0 +1,131 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Explicit tag operations for updating records. Operations are applied in order, Remove then Add then Set. `set` is the final override; if specified, the result of `remove` and `add` is discarded. + class LLMObsDatasetRecordTagOperations + include BaseGenericModel + + # List of tag strings. + attr_accessor :add + + # List of tag strings. + attr_accessor :remove + + # List of tag strings. + attr_accessor :set + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'add' => :'add', + :'remove' => :'remove', + :'set' => :'set' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'add' => :'Array', + :'remove' => :'Array', + :'set' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDatasetRecordTagOperations` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'add') + if (value = attributes[:'add']).is_a?(Array) + self.add = value + end + end + + if attributes.key?(:'remove') + if (value = attributes[:'remove']).is_a?(Array) + self.remove = value + end + end + + if attributes.key?(:'set') + if (value = attributes[:'set']).is_a?(Array) + self.set = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + add == o.add && + remove == o.remove && + set == o.set && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [add, remove, set, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_records_upload_file.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_records_upload_file.rb new file mode 100644 index 000000000000..090c6587cc1c --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_records_upload_file.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Multipart payload for uploading dataset records from a file. + class LLMObsDatasetRecordsUploadFile + include BaseGenericModel + + # The records file to upload. Currently only CSV is supported. The file must include an `input` column. Optional columns include `id`, `expected_output`, `metadata`, and `tags`. + attr_accessor :file + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'file' => :'file' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'file' => :'File' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDatasetRecordsUploadFile` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'file') + self.file = attributes[:'file'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + file == o.file && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [file, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_data_attributes_request.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_data_attributes_request.rb new file mode 100644 index 000000000000..39976cae2a41 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_data_attributes_request.rb @@ -0,0 +1,127 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for restoring an LLM Observability dataset to a previous version. + class LLMObsDatasetRestoreVersionDataAttributesRequest + include BaseGenericModel + + # Version number of the dataset to restore. Must be between 0 and the current version of the dataset, inclusive. + attr_reader :dataset_version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dataset_version' => :'dataset_version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dataset_version' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDatasetRestoreVersionDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'dataset_version') + self.dataset_version = attributes[:'dataset_version'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @dataset_version.nil? + return false if @dataset_version > 2147483647 + true + end + + # Custom attribute writer method with validation + # @param dataset_version [Object] Object to be assigned + # @!visibility private + def dataset_version=(dataset_version) + if dataset_version.nil? + fail ArgumentError, 'invalid value for "dataset_version", dataset_version cannot be nil.' + end + if dataset_version > 2147483647 + fail ArgumentError, 'invalid value for "dataset_version", must be smaller than or equal to 2147483647.' + end + @dataset_version = dataset_version + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + dataset_version == o.dataset_version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dataset_version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_data_request.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_data_request.rb new file mode 100644 index 000000000000..3297e3813d62 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_data_request.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for restoring an LLM Observability dataset to a previous version. + class LLMObsDatasetRestoreVersionDataRequest + include BaseGenericModel + + # Attributes for restoring an LLM Observability dataset to a previous version. + attr_reader :attributes + + # Unique identifier of the dataset to restore. + attr_reader :id + + # Resource type of an LLM Observability dataset. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'LLMObsDatasetRestoreVersionDataAttributesRequest', + :'id' => :'String', + :'type' => :'LLMObsDatasetType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDatasetRestoreVersionDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_request.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_request.rb new file mode 100644 index 000000000000..9bbbcba5833e --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to restore an LLM Observability dataset to a previous version. + class LLMObsDatasetRestoreVersionRequest + include BaseGenericModel + + # Data object for restoring an LLM Observability dataset to a previous version. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'LLMObsDatasetRestoreVersionDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDatasetRestoreVersionRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end