diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 60ae5f285781..0334b3475418 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -43111,6 +43111,78 @@ components: - type - attributes type: object + LLMObsDatasetDraftStateData: + description: Data object for an LLM Observability dataset draft state. + properties: + attributes: + $ref: "#/components/schemas/LLMObsDatasetDraftStateDataAttributes" + id: + description: Unique identifier of the dataset draft state. Matches the dataset ID. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + type: string + type: + $ref: "#/components/schemas/LLMObsDatasetDraftStateType" + required: + - id + - type + - attributes + type: object + LLMObsDatasetDraftStateDataAttributes: + description: Attributes of an LLM Observability dataset draft state. + properties: + drafting_since: + description: Timestamp when the dataset draft session started. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + user: + $ref: "#/components/schemas/LLMObsDatasetDraftStateUser" + required: + - user + - drafting_since + type: object + LLMObsDatasetDraftStateResponse: + description: Response containing the draft state of an LLM Observability dataset. + properties: + data: + $ref: "#/components/schemas/LLMObsDatasetDraftStateData" + required: + - data + type: object + LLMObsDatasetDraftStateType: + description: Resource type of an LLM Observability dataset draft state. + enum: + - draft_state_data + example: draft_state_data + type: string + x-enum-varnames: + - DRAFT_STATE_DATA + LLMObsDatasetDraftStateUser: + description: User information associated with a dataset draft state. + properties: + email: + description: Email address of the user. + example: "jane.doe@example.com" + type: string + handle: + description: Handle of the user. + example: "jane.doe@example.com" + type: string + icon: + description: Icon for the user. + example: "" + type: string + id: + description: Unique identifier of the user holding the draft lock. + example: "00000000-0000-0000-0000-000000000010" + type: string + name: + description: Display name of the user. + example: "Jane Doe" + type: string + required: + - id + type: object LLMObsDatasetRecordDataResponse: description: A single LLM Observability dataset record. properties: @@ -43337,6 +43409,67 @@ components: required: - data type: object + LLMObsDatasetVersionData: + description: Data object for an LLM Observability dataset version. + properties: + attributes: + $ref: "#/components/schemas/LLMObsDatasetVersionDataAttributes" + id: + description: Unique identifier of the dataset version. + example: "3fd6b5e0-8910-4b1c-a7d0-5b84de329012" + type: string + type: + $ref: "#/components/schemas/LLMObsDatasetVersionType" + required: + - id + - type + - attributes + type: object + LLMObsDatasetVersionDataAttributes: + description: Attributes of an LLM Observability dataset version. + properties: + dataset_id: + description: Unique identifier of the dataset this version belongs to. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + type: string + last_used: + description: Timestamp when this dataset version was last referenced. Null if the version has never been used. + example: "2024-01-15T10:30:00Z" + format: date-time + nullable: true + type: string + version_number: + description: Sequential version number for this dataset version. + example: 1 + format: int32 + maximum: 2147483647 + type: integer + required: + - dataset_id + - version_number + - last_used + type: object + LLMObsDatasetVersionType: + description: Resource type of an LLM Observability dataset version. + enum: + - dataset_version + example: dataset_version + type: string + x-enum-varnames: + - DATASET_VERSION + LLMObsDatasetVersionsResponse: + description: Response containing the active versions of an LLM Observability dataset. + properties: + data: + $ref: "#/components/schemas/LLMObsDatasetVersionsResponseData" + required: + - data + type: object + LLMObsDatasetVersionsResponseData: + description: List of dataset versions. + items: + $ref: "#/components/schemas/LLMObsDatasetVersionData" + type: array LLMObsDatasetsResponse: description: Response containing a list of LLM Observability datasets. properties: @@ -125122,6 +125255,229 @@ 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 + 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" + 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: Lock 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/unlock: + patch: + description: Release the draft lock on a dataset held by the calling user, allowing other users to edit the dataset draft. + operationId: UnlockLLMObsDatasetDraftState + 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": + 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: Unlock 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}/records: get: description: List all records in an LLM Observability dataset, sorted by creation date, newest first. @@ -125432,6 +125788,89 @@ 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}/versions: + get: + description: List the active versions of a dataset. A version is created each time a dataset is referenced by an experiment run. + operationId: ListLLMObsDatasetVersions + 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: + dataset_id: 9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d + last_used: "2024-01-15T10:30:00Z" + version_number: 1 + id: 3fd6b5e0-8910-4b1c-a7d0-5b84de329012 + type: dataset_version + - attributes: + dataset_id: 9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d + last_used: "2024-02-20T14:45:00Z" + version_number: 2 + id: 4ee7c6f1-9a01-5c2d-b8e1-6c95ef43a123 + type: dataset_version + schema: + $ref: "#/components/schemas/LLMObsDatasetVersionsResponse" + 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: List LLM Observability dataset versions + 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/GetLLMObsDatasetDraftState.rb b/examples/v2/llm-observability/GetLLMObsDatasetDraftState.rb new file mode 100644 index 000000000000..d29bf89eab35 --- /dev/null +++ b/examples/v2/llm-observability/GetLLMObsDatasetDraftState.rb @@ -0,0 +1,8 @@ +# Get LLM Observability dataset draft state returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_llm_obs_dataset_draft_state".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new +p api_instance.get_llm_obs_dataset_draft_state("project_id", "dataset_id") diff --git a/examples/v2/llm-observability/ListLLMObsDatasetVersions.rb b/examples/v2/llm-observability/ListLLMObsDatasetVersions.rb new file mode 100644 index 000000000000..dd608de96e4a --- /dev/null +++ b/examples/v2/llm-observability/ListLLMObsDatasetVersions.rb @@ -0,0 +1,8 @@ +# List LLM Observability dataset versions returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_llm_obs_dataset_versions".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new +p api_instance.list_llm_obs_dataset_versions("project_id", "dataset_id") diff --git a/examples/v2/llm-observability/LockLLMObsDatasetDraftState.rb b/examples/v2/llm-observability/LockLLMObsDatasetDraftState.rb new file mode 100644 index 000000000000..2857210dce43 --- /dev/null +++ b/examples/v2/llm-observability/LockLLMObsDatasetDraftState.rb @@ -0,0 +1,8 @@ +# Lock LLM Observability dataset draft state returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.lock_llm_obs_dataset_draft_state".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new +p api_instance.lock_llm_obs_dataset_draft_state("project_id", "dataset_id") diff --git a/examples/v2/llm-observability/UnlockLLMObsDatasetDraftState.rb b/examples/v2/llm-observability/UnlockLLMObsDatasetDraftState.rb new file mode 100644 index 000000000000..20e0c6f44b32 --- /dev/null +++ b/examples/v2/llm-observability/UnlockLLMObsDatasetDraftState.rb @@ -0,0 +1,8 @@ +# Unlock LLM Observability dataset draft state returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.unlock_llm_obs_dataset_draft_state".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new +p api_instance.unlock_llm_obs_dataset_draft_state("project_id", "dataset_id") diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 89ac9711f850..a55ffa547b65 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1054,6 +1054,18 @@ "dataset_id" => "String", "body" => "LLMObsDatasetUpdateRequest", }, + "v2.GetLLMObsDatasetDraftState" => { + "project_id" => "String", + "dataset_id" => "String", + }, + "v2.LockLLMObsDatasetDraftState" => { + "project_id" => "String", + "dataset_id" => "String", + }, + "v2.UnlockLLMObsDatasetDraftState" => { + "project_id" => "String", + "dataset_id" => "String", + }, "v2.ListLLMObsDatasetRecords" => { "project_id" => "String", "dataset_id" => "String", @@ -1076,6 +1088,10 @@ "dataset_id" => "String", "body" => "LLMObsDeleteDatasetRecordsRequest", }, + "v2.ListLLMObsDatasetVersions" => { + "project_id" => "String", + "dataset_id" => "String", + }, "v2.ListLLMObsExperimentEvents" => { "experiment_id" => "String", "page_limit" => "Integer", diff --git a/features/v2/llm_observability.feature b/features/v2/llm_observability.feature index d21a1f8048c5..63b64631db28 100644 --- a/features/v2/llm_observability.feature +++ b/features/v2/llm_observability.feature @@ -417,6 +417,33 @@ Feature: LLM Observability When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/ml-observability + Scenario: Get LLM Observability dataset draft state returns "Bad Request" response + Given operation "GetLLMObsDatasetDraftState" enabled + And new "GetLLMObsDatasetDraftState" 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: Get LLM Observability dataset draft state returns "Not Found" response + Given operation "GetLLMObsDatasetDraftState" enabled + And new "GetLLMObsDatasetDraftState" 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: Get LLM Observability dataset draft state returns "OK" response + Given operation "GetLLMObsDatasetDraftState" enabled + And new "GetLLMObsDatasetDraftState" 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 a custom evaluator configuration returns "Bad Request" response Given operation "GetLLMObsCustomEvalConfig" enabled @@ -538,6 +565,33 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM Observability dataset versions returns "Bad Request" response + Given operation "ListLLMObsDatasetVersions" enabled + And new "ListLLMObsDatasetVersions" 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: List LLM Observability dataset versions returns "Not Found" response + Given operation "ListLLMObsDatasetVersions" enabled + And new "ListLLMObsDatasetVersions" 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: List LLM Observability dataset versions returns "OK" response + Given operation "ListLLMObsDatasetVersions" enabled + And new "ListLLMObsDatasetVersions" 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: List LLM Observability datasets returns "Bad Request" response Given operation "ListLLMObsDatasets" enabled @@ -662,6 +716,33 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: Lock LLM Observability dataset draft state returns "Bad Request" response + Given operation "LockLLMObsDatasetDraftState" enabled + And new "LockLLMObsDatasetDraftState" 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: Lock LLM Observability dataset draft state returns "Not Found" response + Given operation "LockLLMObsDatasetDraftState" enabled + And new "LockLLMObsDatasetDraftState" 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: Lock LLM Observability dataset draft state returns "OK" response + Given operation "LockLLMObsDatasetDraftState" enabled + And new "LockLLMObsDatasetDraftState" 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: Push events for an LLM Observability experiment returns "Accepted" response Given operation "CreateLLMObsExperimentEvents" enabled @@ -765,6 +846,33 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: Unlock LLM Observability dataset draft state returns "Bad Request" response + Given operation "UnlockLLMObsDatasetDraftState" enabled + And new "UnlockLLMObsDatasetDraftState" 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: Unlock LLM Observability dataset draft state returns "Not Found" response + Given operation "UnlockLLMObsDatasetDraftState" enabled + And new "UnlockLLMObsDatasetDraftState" 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: Unlock LLM Observability dataset draft state returns "OK" response + Given operation "UnlockLLMObsDatasetDraftState" enabled + And new "UnlockLLMObsDatasetDraftState" 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: Update LLM Observability dataset records returns "Bad Request" response Given operation "UpdateLLMObsDatasetRecords" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index e93351a7e237..f452679baf1d 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3925,6 +3925,24 @@ "type": "idempotent" } }, + "GetLLMObsDatasetDraftState": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "LockLLMObsDatasetDraftState": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, + "UnlockLLMObsDatasetDraftState": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, "ListLLMObsDatasetRecords": { "tag": "LLM Observability", "undo": { @@ -3962,6 +3980,12 @@ "type": "unsafe" } }, + "ListLLMObsDatasetVersions": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, "ListLLMObsExperimentEvents": { "tag": "LLM Observability", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index bc3da069651c..f42fa5c6374a 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -228,18 +228,22 @@ def initialize "v2.get_llm_obs_annotated_interactions_by_trace_i_ds": false, "v2.get_llm_obs_annotation_queue_label_schema": false, "v2.get_llm_obs_custom_eval_config": false, + "v2.get_llm_obs_dataset_draft_state": false, "v2.list_llm_obs_annotation_queues": false, "v2.list_llm_obs_dataset_records": false, "v2.list_llm_obs_datasets": false, + "v2.list_llm_obs_dataset_versions": false, "v2.list_llm_obs_experiment_events": false, "v2.list_llm_obs_experiments": false, "v2.list_llm_obs_integration_accounts": false, "v2.list_llm_obs_integration_models": false, "v2.list_llm_obs_projects": false, "v2.list_llm_obs_spans": false, + "v2.lock_llm_obs_dataset_draft_state": false, "v2.search_llm_obs_experimentation": false, "v2.search_llm_obs_spans": false, "v2.simple_search_llm_obs_experimentation": false, + "v2.unlock_llm_obs_dataset_draft_state": false, "v2.update_llm_obs_annotation_queue": false, "v2.update_llm_obs_annotation_queue_label_schema": false, "v2.update_llm_obs_custom_eval_config": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index cbdb4303667a..05a99dc2ffca 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3788,6 +3788,11 @@ def overrides "v2.llm_obs_dataset_data_attributes_response" => "LLMObsDatasetDataAttributesResponse", "v2.llm_obs_dataset_data_request" => "LLMObsDatasetDataRequest", "v2.llm_obs_dataset_data_response" => "LLMObsDatasetDataResponse", + "v2.llm_obs_dataset_draft_state_data" => "LLMObsDatasetDraftStateData", + "v2.llm_obs_dataset_draft_state_data_attributes" => "LLMObsDatasetDraftStateDataAttributes", + "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_record_data_response" => "LLMObsDatasetRecordDataResponse", "v2.llm_obs_dataset_record_item" => "LLMObsDatasetRecordItem", "v2.llm_obs_dataset_records_data_attributes_request" => "LLMObsDatasetRecordsDataAttributesRequest", @@ -3807,6 +3812,10 @@ def overrides "v2.llm_obs_dataset_update_data_attributes_request" => "LLMObsDatasetUpdateDataAttributesRequest", "v2.llm_obs_dataset_update_data_request" => "LLMObsDatasetUpdateDataRequest", "v2.llm_obs_dataset_update_request" => "LLMObsDatasetUpdateRequest", + "v2.llm_obs_dataset_version_data" => "LLMObsDatasetVersionData", + "v2.llm_obs_dataset_version_data_attributes" => "LLMObsDatasetVersionDataAttributes", + "v2.llm_obs_dataset_versions_response" => "LLMObsDatasetVersionsResponse", + "v2.llm_obs_dataset_version_type" => "LLMObsDatasetVersionType", "v2.llm_obs_delete_annotation_queue_interactions_data_attributes_request" => "LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest", "v2.llm_obs_delete_annotation_queue_interactions_data_request" => "LLMObsDeleteAnnotationQueueInteractionsDataRequest", "v2.llm_obs_delete_annotation_queue_interactions_request" => "LLMObsDeleteAnnotationQueueInteractionsRequest", 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 b6e0f54ee607..64031b0dcacc 100644 --- a/lib/datadog_api_client/v2/api/llm_observability_api.rb +++ b/lib/datadog_api_client/v2/api/llm_observability_api.rb @@ -1637,6 +1637,82 @@ def get_llm_obs_custom_eval_config_with_http_info(eval_name, opts = {}) return data, status_code, headers end + # Get LLM Observability dataset draft state. + # + # @see #get_llm_obs_dataset_draft_state_with_http_info + def get_llm_obs_dataset_draft_state(project_id, dataset_id, opts = {}) + data, _status_code, _headers = get_llm_obs_dataset_draft_state_with_http_info(project_id, dataset_id, opts) + data + end + + # Get LLM Observability dataset draft state. + # + # Retrieve the draft state of a dataset, including whether it is currently locked for editing and which user holds the lock. + # + # @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 + # @return [Array<(LLMObsDatasetDraftStateResponse, Integer, Hash)>] LLMObsDatasetDraftStateResponse data, response status code and response headers + def get_llm_obs_dataset_draft_state_with_http_info(project_id, dataset_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_llm_obs_dataset_draft_state".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_llm_obs_dataset_draft_state") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_llm_obs_dataset_draft_state")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.get_llm_obs_dataset_draft_state ...' + 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.get_llm_obs_dataset_draft_state" + 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.get_llm_obs_dataset_draft_state" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/draft_state'.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']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'LLMObsDatasetDraftStateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_llm_obs_dataset_draft_state, + :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#get_llm_obs_dataset_draft_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List LLM Observability annotation queues. # # @see #list_llm_obs_annotation_queues_with_http_info @@ -1870,6 +1946,82 @@ def list_llm_obs_datasets_with_http_info(project_id, opts = {}) return data, status_code, headers end + # List LLM Observability dataset versions. + # + # @see #list_llm_obs_dataset_versions_with_http_info + def list_llm_obs_dataset_versions(project_id, dataset_id, opts = {}) + data, _status_code, _headers = list_llm_obs_dataset_versions_with_http_info(project_id, dataset_id, opts) + data + end + + # List LLM Observability dataset versions. + # + # List the active versions of a dataset. A version is created each time a dataset is referenced by an experiment run. + # + # @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 + # @return [Array<(LLMObsDatasetVersionsResponse, Integer, Hash)>] LLMObsDatasetVersionsResponse data, response status code and response headers + def list_llm_obs_dataset_versions_with_http_info(project_id, dataset_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_llm_obs_dataset_versions".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_llm_obs_dataset_versions") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_llm_obs_dataset_versions")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.list_llm_obs_dataset_versions ...' + 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.list_llm_obs_dataset_versions" + 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.list_llm_obs_dataset_versions" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/versions'.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']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'LLMObsDatasetVersionsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_llm_obs_dataset_versions, + :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#list_llm_obs_dataset_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List events for an LLM Observability experiment. # # @see #list_llm_obs_experiment_events_with_http_info @@ -2342,6 +2494,82 @@ def list_llm_obs_spans_with_http_info(opts = {}) return data, status_code, headers end + # Lock LLM Observability dataset draft state. + # + # @see #lock_llm_obs_dataset_draft_state_with_http_info + def lock_llm_obs_dataset_draft_state(project_id, dataset_id, opts = {}) + data, _status_code, _headers = lock_llm_obs_dataset_draft_state_with_http_info(project_id, dataset_id, opts) + data + end + + # Lock LLM Observability dataset draft state. + # + # Acquire the draft lock on a dataset for the calling user. The lock prevents other users from concurrently editing the dataset draft. + # + # @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 + # @return [Array<(LLMObsDatasetDraftStateResponse, Integer, Hash)>] LLMObsDatasetDraftStateResponse data, response status code and response headers + def lock_llm_obs_dataset_draft_state_with_http_info(project_id, dataset_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.lock_llm_obs_dataset_draft_state".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.lock_llm_obs_dataset_draft_state") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.lock_llm_obs_dataset_draft_state")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.lock_llm_obs_dataset_draft_state ...' + 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.lock_llm_obs_dataset_draft_state" + 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.lock_llm_obs_dataset_draft_state" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/draft_state/lock'.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']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'LLMObsDatasetDraftStateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :lock_llm_obs_dataset_draft_state, + :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::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#lock_llm_obs_dataset_draft_state\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 @@ -2568,6 +2796,82 @@ def simple_search_llm_obs_experimentation_with_http_info(body, opts = {}) return data, status_code, headers end + # Unlock LLM Observability dataset draft state. + # + # @see #unlock_llm_obs_dataset_draft_state_with_http_info + def unlock_llm_obs_dataset_draft_state(project_id, dataset_id, opts = {}) + unlock_llm_obs_dataset_draft_state_with_http_info(project_id, dataset_id, opts) + nil + end + + # Unlock LLM Observability dataset draft state. + # + # Release the draft lock on a dataset held by the calling user, allowing other users to edit the dataset draft. + # + # @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 + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def unlock_llm_obs_dataset_draft_state_with_http_info(project_id, dataset_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.unlock_llm_obs_dataset_draft_state".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.unlock_llm_obs_dataset_draft_state") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.unlock_llm_obs_dataset_draft_state")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.unlock_llm_obs_dataset_draft_state ...' + 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.unlock_llm_obs_dataset_draft_state" + 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.unlock_llm_obs_dataset_draft_state" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/draft_state/unlock'.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(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # 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 => :unlock_llm_obs_dataset_draft_state, + :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::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#unlock_llm_obs_dataset_draft_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update an LLM Observability annotation queue. # # @see #update_llm_obs_annotation_queue_with_http_info diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_data.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_data.rb new file mode 100644 index 000000000000..71b925e6c19c --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_data.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 an LLM Observability dataset draft state. + class LLMObsDatasetDraftStateData + include BaseGenericModel + + # Attributes of an LLM Observability dataset draft state. + attr_reader :attributes + + # Unique identifier of the dataset draft state. Matches the dataset ID. + attr_reader :id + + # Resource type of an LLM Observability dataset draft state. + 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' => :'LLMObsDatasetDraftStateDataAttributes', + :'id' => :'String', + :'type' => :'LLMObsDatasetDraftStateType' + } + 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::LLMObsDatasetDraftStateData` 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_draft_state_data_attributes.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_data_attributes.rb new file mode 100644 index 000000000000..b6973ca4ff60 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_data_attributes.rb @@ -0,0 +1,144 @@ +=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 of an LLM Observability dataset draft state. + class LLMObsDatasetDraftStateDataAttributes + include BaseGenericModel + + # Timestamp when the dataset draft session started. + attr_reader :drafting_since + + # User information associated with a dataset draft state. + attr_reader :user + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'drafting_since' => :'drafting_since', + :'user' => :'user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'drafting_since' => :'Time', + :'user' => :'LLMObsDatasetDraftStateUser' + } + 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::LLMObsDatasetDraftStateDataAttributes` 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?(:'drafting_since') + self.drafting_since = attributes[:'drafting_since'] + end + + if attributes.key?(:'user') + self.user = attributes[:'user'] + 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 @drafting_since.nil? + return false if @user.nil? + true + end + + # Custom attribute writer method with validation + # @param drafting_since [Object] Object to be assigned + # @!visibility private + def drafting_since=(drafting_since) + if drafting_since.nil? + fail ArgumentError, 'invalid value for "drafting_since", drafting_since cannot be nil.' + end + @drafting_since = drafting_since + end + + # Custom attribute writer method with validation + # @param user [Object] Object to be assigned + # @!visibility private + def user=(user) + if user.nil? + fail ArgumentError, 'invalid value for "user", user cannot be nil.' + end + @user = user + 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 && + drafting_since == o.drafting_since && + user == o.user && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [drafting_since, user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_response.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_response.rb new file mode 100644 index 000000000000..145d689044b6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_response.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 + # Response containing the draft state of an LLM Observability dataset. + class LLMObsDatasetDraftStateResponse + include BaseGenericModel + + # Data object for an LLM Observability dataset draft state. + 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' => :'LLMObsDatasetDraftStateData' + } + 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::LLMObsDatasetDraftStateResponse` 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_draft_state_type.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_type.rb new file mode 100644 index 000000000000..97ce4ee4e2d5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_type.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 + # Resource type of an LLM Observability dataset draft state. + class LLMObsDatasetDraftStateType + include BaseEnumModel + + DRAFT_STATE_DATA = "draft_state_data".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_user.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_user.rb new file mode 100644 index 000000000000..6b3b133809f4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_user.rb @@ -0,0 +1,163 @@ +=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 + # User information associated with a dataset draft state. + class LLMObsDatasetDraftStateUser + include BaseGenericModel + + # Email address of the user. + attr_accessor :email + + # Handle of the user. + attr_accessor :handle + + # Icon for the user. + attr_accessor :icon + + # Unique identifier of the user holding the draft lock. + attr_reader :id + + # Display name of the user. + attr_accessor :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'email' => :'email', + :'handle' => :'handle', + :'icon' => :'icon', + :'id' => :'id', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'email' => :'String', + :'handle' => :'String', + :'icon' => :'String', + :'id' => :'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::LLMObsDatasetDraftStateUser` 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?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'handle') + self.handle = attributes[:'handle'] + end + + if attributes.key?(:'icon') + self.icon = attributes[:'icon'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + 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 @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 && + email == o.email && + handle == o.handle && + icon == o.icon && + id == o.id && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [email, handle, icon, id, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_version_data.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_version_data.rb new file mode 100644 index 000000000000..4c42260a82c6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_version_data.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 an LLM Observability dataset version. + class LLMObsDatasetVersionData + include BaseGenericModel + + # Attributes of an LLM Observability dataset version. + attr_reader :attributes + + # Unique identifier of the dataset version. + attr_reader :id + + # Resource type of an LLM Observability dataset version. + 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' => :'LLMObsDatasetVersionDataAttributes', + :'id' => :'String', + :'type' => :'LLMObsDatasetVersionType' + } + 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::LLMObsDatasetVersionData` 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_version_data_attributes.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_version_data_attributes.rb new file mode 100644 index 000000000000..f45ae7dd8ed5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_version_data_attributes.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 + # Attributes of an LLM Observability dataset version. + class LLMObsDatasetVersionDataAttributes + include BaseGenericModel + + # Unique identifier of the dataset this version belongs to. + attr_reader :dataset_id + + # Timestamp when this dataset version was last referenced. Null if the version has never been used. + attr_accessor :last_used + + # Sequential version number for this dataset version. + attr_reader :version_number + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dataset_id' => :'dataset_id', + :'last_used' => :'last_used', + :'version_number' => :'version_number' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dataset_id' => :'String', + :'last_used' => :'Time', + :'version_number' => :'Integer' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'last_used', + ]) + 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::LLMObsDatasetVersionDataAttributes` 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_id') + self.dataset_id = attributes[:'dataset_id'] + end + + if attributes.key?(:'last_used') + self.last_used = attributes[:'last_used'] + end + + if attributes.key?(:'version_number') + self.version_number = attributes[:'version_number'] + 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_id.nil? + return false if @version_number.nil? + return false if @version_number > 2147483647 + true + end + + # Custom attribute writer method with validation + # @param dataset_id [Object] Object to be assigned + # @!visibility private + def dataset_id=(dataset_id) + if dataset_id.nil? + fail ArgumentError, 'invalid value for "dataset_id", dataset_id cannot be nil.' + end + @dataset_id = dataset_id + end + + # Custom attribute writer method with validation + # @param version_number [Object] Object to be assigned + # @!visibility private + def version_number=(version_number) + if version_number.nil? + fail ArgumentError, 'invalid value for "version_number", version_number cannot be nil.' + end + if version_number > 2147483647 + fail ArgumentError, 'invalid value for "version_number", must be smaller than or equal to 2147483647.' + end + @version_number = version_number + 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_id == o.dataset_id && + last_used == o.last_used && + version_number == o.version_number && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dataset_id, last_used, version_number, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_version_type.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_version_type.rb new file mode 100644 index 000000000000..f3f7baa282da --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_version_type.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 + # Resource type of an LLM Observability dataset version. + class LLMObsDatasetVersionType + include BaseEnumModel + + DATASET_VERSION = "dataset_version".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_versions_response.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_versions_response.rb new file mode 100644 index 000000000000..45b1a9399e3b --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_versions_response.rb @@ -0,0 +1,125 @@ +=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 + # Response containing the active versions of an LLM Observability dataset. + class LLMObsDatasetVersionsResponse + include BaseGenericModel + + # List of dataset versions. + 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' => :'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::LLMObsDatasetVersionsResponse` 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') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + 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