Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
446 changes: 438 additions & 8 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions examples/v2/llm-observability/DeleteLLMObsAnnotations.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Delete annotations returns "OK — annotations deleted. Errors for annotations that could not be deleted are listed in
# `errors`." response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.delete_llm_obs_annotations".to_sym] = true
end
api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new

body = DatadogAPIClient::V2::LLMObsDeleteAnnotationsRequest.new({
data: DatadogAPIClient::V2::LLMObsDeleteAnnotationsDataRequest.new({
attributes: DatadogAPIClient::V2::LLMObsDeleteAnnotationsDataAttributesRequest.new({
annotation_ids: [
"00000000-0000-0000-0000-000000000000",
"00000000-0000-0000-0000-000000000001",
],
}),
type: DatadogAPIClient::V2::LLMObsAnnotationsType::ANNOTATIONS,
}),
})
p api_instance.delete_llm_obs_annotations("queue_id", body)
32 changes: 32 additions & 0 deletions examples/v2/llm-observability/UpsertLLMObsAnnotations.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Create or update annotations returns "OK — annotations created or updated. Per-item errors are listed in `errors`."
# response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.upsert_llm_obs_annotations".to_sym] = true
end
api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new

body = DatadogAPIClient::V2::LLMObsAnnotationsRequest.new({
data: DatadogAPIClient::V2::LLMObsAnnotationsDataRequest.new({
attributes: DatadogAPIClient::V2::LLMObsAnnotationsDataAttributesRequest.new({
annotations: [
DatadogAPIClient::V2::LLMObsUpsertAnnotationItem.new({
interaction_id: "00000000-0000-0000-0000-000000000001",
label_values: [
DatadogAPIClient::V2::LLMObsAnnotationLabelValue.new({
label_schema_id: "abc-123",
value: "good",
}),
DatadogAPIClient::V2::LLMObsAnnotationLabelValue.new({
label_schema_id: "ef56gh78",
value: "positive",
}),
],
}),
],
}),
type: DatadogAPIClient::V2::LLMObsAnnotationsType::ANNOTATIONS,
}),
})
p api_instance.upsert_llm_obs_annotations("queue_id", body)
8 changes: 8 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,14 @@
"v2.GetLLMObsAnnotatedInteractions" => {
"queue_id" => "String",
},
"v2.UpsertLLMObsAnnotations" => {
"queue_id" => "String",
"body" => "LLMObsAnnotationsRequest",
},
"v2.DeleteLLMObsAnnotations" => {
"queue_id" => "String",
"body" => "LLMObsDeleteAnnotationsRequest",
},
"v2.CreateLLMObsAnnotationQueueInteractions" => {
"queue_id" => "String",
"body" => "LLMObsAnnotationQueueInteractionsRequest",
Expand Down
54 changes: 54 additions & 0 deletions features/v2/llm_observability.feature
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,33 @@ Feature: LLM Observability
When the request is sent
Then the response status is 422 Unprocessable Entity

@generated @skip @team:DataDog/ml-observability
Scenario: Create or update annotations returns "Bad Request" response
Given operation "UpsertLLMObsAnnotations" enabled
And new "UpsertLLMObsAnnotations" request
And request contains "queue_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"annotations": [{"interaction_id": "00000000-0000-0000-0000-000000000001", "label_values": [{"label_schema_id": "abc-123", "value": "good"}, {"label_schema_id": "ef56gh78", "value": "positive"}]}]}, "type": "annotations"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/ml-observability
Scenario: Create or update annotations returns "Not Found — the queue does not exist." response
Given operation "UpsertLLMObsAnnotations" enabled
And new "UpsertLLMObsAnnotations" request
And request contains "queue_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"annotations": [{"interaction_id": "00000000-0000-0000-0000-000000000001", "label_values": [{"label_schema_id": "abc-123", "value": "good"}, {"label_schema_id": "ef56gh78", "value": "positive"}]}]}, "type": "annotations"}}
When the request is sent
Then the response status is 404 Not Found — the queue does not exist.

@generated @skip @team:DataDog/ml-observability
Scenario: Create or update annotations returns "OK — annotations created or updated. Per-item errors are listed in `errors`." response
Given operation "UpsertLLMObsAnnotations" enabled
And new "UpsertLLMObsAnnotations" request
And request contains "queue_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"annotations": [{"interaction_id": "00000000-0000-0000-0000-000000000001", "label_values": [{"label_schema_id": "abc-123", "value": "good"}, {"label_schema_id": "ef56gh78", "value": "positive"}]}]}, "type": "annotations"}}
When the request is sent
Then the response status is 200 OK — annotations created or updated. Per-item errors are listed in `errors`.

@generated @skip @team:DataDog/ml-observability
Scenario: Delete LLM Observability data returns "Accepted" response
Given operation "DeleteLLMObsData" enabled
Expand Down Expand Up @@ -487,6 +514,33 @@ Feature: LLM Observability
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/ml-observability
Scenario: Delete annotations returns "Bad Request" response
Given operation "DeleteLLMObsAnnotations" enabled
And new "DeleteLLMObsAnnotations" request
And request contains "queue_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"annotation_ids": ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001"]}, "type": "annotations"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/ml-observability
Scenario: Delete annotations returns "Not Found — the queue does not exist." response
Given operation "DeleteLLMObsAnnotations" enabled
And new "DeleteLLMObsAnnotations" request
And request contains "queue_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"annotation_ids": ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001"]}, "type": "annotations"}}
When the request is sent
Then the response status is 404 Not Found — the queue does not exist.

@generated @skip @team:DataDog/ml-observability
Scenario: Delete annotations returns "OK — annotations deleted. Errors for annotations that could not be deleted are listed in `errors`." response
Given operation "DeleteLLMObsAnnotations" enabled
And new "DeleteLLMObsAnnotations" request
And request contains "queue_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"annotation_ids": ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001"]}, "type": "annotations"}}
When the request is sent
Then the response status is 200 OK — annotations deleted. Errors for annotations that could not be deleted are listed in `errors`.

@generated @skip @team:DataDog/ml-observability
Scenario: Export an LLM Observability dataset returns "Bad Request" response
Given operation "ExportLLMObsDataset" enabled
Expand Down
23 changes: 23 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3962,6 +3962,29 @@
"type": "safe"
}
},
"UpsertLLMObsAnnotations": {
"tag": "LLM Observability",
"undo": {
"operationId": "DeleteLLMObsAnnotations",
"parameters": [
{
"name": "queue_id",
"source": "path.queue_id"
},
{
"name": "body",
"template": "{\"data\": {\"type\": \"annotations\", \"attributes\": {\"annotation_ids\": [\"{{ data.attributes.annotations[0].id }}\"]}}}"
}
],
"type": "unsafe"
}
},
"DeleteLLMObsAnnotations": {
"tag": "LLM Observability",
"undo": {
"type": "idempotent"
}
},
"CreateLLMObsAnnotationQueueInteractions": {
"tag": "LLM Observability",
"undo": {
Expand Down
2 changes: 2 additions & 0 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ def initialize
"v2.create_llm_obs_project": false,
"v2.delete_llm_obs_annotation_queue": false,
"v2.delete_llm_obs_annotation_queue_interactions": false,
"v2.delete_llm_obs_annotations": false,
"v2.delete_llm_obs_custom_eval_config": false,
"v2.delete_llm_obs_data": false,
"v2.delete_llm_obs_dataset_records": false,
Expand Down Expand Up @@ -256,6 +257,7 @@ def initialize
"v2.update_llm_obs_experiment": false,
"v2.update_llm_obs_project": false,
"v2.upload_llm_obs_dataset_records_file": false,
"v2.upsert_llm_obs_annotations": false,
"v2.create_annotation": false,
"v2.delete_annotation": false,
"v2.get_page_annotations": false,
Expand Down
19 changes: 19 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3852,7 +3852,11 @@ def overrides
"v2.llm_obs_annotated_interactions_data_response" => "LLMObsAnnotatedInteractionsDataResponse",
"v2.llm_obs_annotated_interactions_response" => "LLMObsAnnotatedInteractionsResponse",
"v2.llm_obs_annotated_interactions_type" => "LLMObsAnnotatedInteractionsType",
"v2.llm_obs_annotation_assessment" => "LLMObsAnnotationAssessment",
"v2.llm_obs_annotation_error" => "LLMObsAnnotationError",
"v2.llm_obs_annotation_item" => "LLMObsAnnotationItem",
"v2.llm_obs_annotation_label_value" => "LLMObsAnnotationLabelValue",
"v2.llm_obs_annotation_label_value_value" => "LLMObsAnnotationLabelValueValue",
"v2.llm_obs_annotation_queue_data_attributes_request" => "LLMObsAnnotationQueueDataAttributesRequest",
"v2.llm_obs_annotation_queue_data_attributes_response" => "LLMObsAnnotationQueueDataAttributesResponse",
"v2.llm_obs_annotation_queue_data_request" => "LLMObsAnnotationQueueDataRequest",
Expand Down Expand Up @@ -3880,6 +3884,13 @@ def overrides
"v2.llm_obs_annotation_queue_update_data_request" => "LLMObsAnnotationQueueUpdateDataRequest",
"v2.llm_obs_annotation_queue_update_request" => "LLMObsAnnotationQueueUpdateRequest",
"v2.llm_obs_annotation_schema" => "LLMObsAnnotationSchema",
"v2.llm_obs_annotations_data_attributes_request" => "LLMObsAnnotationsDataAttributesRequest",
"v2.llm_obs_annotations_data_attributes_response" => "LLMObsAnnotationsDataAttributesResponse",
"v2.llm_obs_annotations_data_request" => "LLMObsAnnotationsDataRequest",
"v2.llm_obs_annotations_data_response" => "LLMObsAnnotationsDataResponse",
"v2.llm_obs_annotations_request" => "LLMObsAnnotationsRequest",
"v2.llm_obs_annotations_response" => "LLMObsAnnotationsResponse",
"v2.llm_obs_annotations_type" => "LLMObsAnnotationsType",
"v2.llm_obs_anthropic_effort" => "LLMObsAnthropicEffort",
"v2.llm_obs_anthropic_metadata" => "LLMObsAnthropicMetadata",
"v2.llm_obs_anthropic_thinking_config" => "LLMObsAnthropicThinkingConfig",
Expand Down Expand Up @@ -3970,9 +3981,16 @@ def overrides
"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_error" => "LLMObsDeleteAnnotationError",
"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",
"v2.llm_obs_delete_annotations_data_attributes_request" => "LLMObsDeleteAnnotationsDataAttributesRequest",
"v2.llm_obs_delete_annotations_data_attributes_response" => "LLMObsDeleteAnnotationsDataAttributesResponse",
"v2.llm_obs_delete_annotations_data_request" => "LLMObsDeleteAnnotationsDataRequest",
"v2.llm_obs_delete_annotations_data_response" => "LLMObsDeleteAnnotationsDataResponse",
"v2.llm_obs_delete_annotations_request" => "LLMObsDeleteAnnotationsRequest",
"v2.llm_obs_delete_annotations_response" => "LLMObsDeleteAnnotationsResponse",
"v2.llm_obs_delete_dataset_records_data_attributes_request" => "LLMObsDeleteDatasetRecordsDataAttributesRequest",
"v2.llm_obs_delete_dataset_records_data_request" => "LLMObsDeleteDatasetRecordsDataRequest",
"v2.llm_obs_delete_dataset_records_request" => "LLMObsDeleteDatasetRecordsRequest",
Expand Down Expand Up @@ -4110,6 +4128,7 @@ def overrides
"v2.llm_obs_trace_interaction_item" => "LLMObsTraceInteractionItem",
"v2.llm_obs_trace_interaction_response_item" => "LLMObsTraceInteractionResponseItem",
"v2.llm_obs_trace_interaction_type" => "LLMObsTraceInteractionType",
"v2.llm_obs_upsert_annotation_item" => "LLMObsUpsertAnnotationItem",
"v2.llm_obs_vertex_ai_metadata" => "LLMObsVertexAIMetadata",
"v2.log" => "Log",
"v2.log_attributes" => "LogAttributes",
Expand Down
Loading
Loading