diff --git a/.apigentools-info b/.apigentools-info index b02cfcb3623b..8df24b0f1158 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-16 20:07:14.122500", - "spec_repo_commit": "86072741" + "regenerated": "2024-10-17 14:10:53.037283", + "spec_repo_commit": "fb024a45" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-16 20:07:14.140655", - "spec_repo_commit": "86072741" + "regenerated": "2024-10-17 14:10:53.055232", + "spec_repo_commit": "fb024a45" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index e2eb404ab435..0ec2691c5775 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -4796,6 +4796,7 @@ components: - logs_transaction_stream - event_stream - rum_stream + - llm_observability_stream example: apm_issue_stream type: string x-enum-varnames: @@ -4811,6 +4812,7 @@ components: - LOGS_TRANSACTION_STREAM - EVENT_STREAM - RUM_STREAM + - LLM_OBSERVABILITY_STREAM ListStreamWidgetDefinition: description: 'The list stream visualization displays a table of recent events in your application that diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-llm-observability-stream-list-stream-widget.frozen b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-llm-observability-stream-list-stream-widget.frozen new file mode 100644 index 000000000000..379a35d83360 --- /dev/null +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-llm-observability-stream-list-stream-widget.frozen @@ -0,0 +1 @@ +2024-10-15T21:46:06.749Z \ No newline at end of file diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-llm-observability-stream-list-stream-widget.yml b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-llm-observability-stream-list-stream-widget.yml new file mode 100644 index 000000000000..63cda46fb839 --- /dev/null +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-llm-observability-stream-list-stream-widget.yml @@ -0,0 +1,51 @@ +http_interactions: +- recorded_at: Tue, 15 Oct 2024 21:46:06 GMT + request: + body: + encoding: UTF-8 + string: '{"layout_type":"ordered","title":"Test-Create_a_new_dashboard_with_llm_observability_stream_list_stream_widget-1729028766 + with list_stream widget","widgets":[{"definition":{"requests":[{"columns":[{"field":"@status","width":"compact"},{"field":"@content.prompt","width":"auto"},{"field":"@content.response.content","width":"auto"},{"field":"timestamp","width":"auto"},{"field":"@ml_app","width":"auto"},{"field":"service","width":"auto"},{"field":"@meta.evaluations.quality","width":"auto"},{"field":"@meta.evaluations.security","width":"auto"},{"field":"@duration","width":"auto"}],"query":{"data_source":"llm_observability_stream","indexes":[],"query_string":"@event_type:span + @parent_id:undefined"},"response_format":"event_list"}],"type":"list_stream"}}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/dashboard + response: + body: + encoding: UTF-8 + string: '{"id":"k3w-qcg-ug8","title":"Test-Create_a_new_dashboard_with_llm_observability_stream_list_stream_widget-1729028766 + with list_stream widget","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI + Account","layout_type":"ordered","url":"/dashboard/k3w-qcg-ug8/test-createanewdashboardwithllmobservabilitystreamliststreamwidget-1729028766-wi","is_read_only":false,"template_variables":null,"widgets":[{"definition":{"requests":[{"columns":[{"field":"@status","width":"compact"},{"field":"@content.prompt","width":"auto"},{"field":"@content.response.content","width":"auto"},{"field":"timestamp","width":"auto"},{"field":"@ml_app","width":"auto"},{"field":"service","width":"auto"},{"field":"@meta.evaluations.quality","width":"auto"},{"field":"@meta.evaluations.security","width":"auto"},{"field":"@duration","width":"auto"}],"query":{"data_source":"llm_observability_stream","indexes":[],"query_string":"@event_type:span + @parent_id:undefined"},"response_format":"event_list"}],"type":"list_stream"},"id":8221646523831060}],"notify_list":null,"created_at":"2024-10-15T21:46:06.954265+00:00","modified_at":"2024-10-15T21:46:06.954265+00:00","restricted_roles":[]} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Tue, 15 Oct 2024 21:46:06 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/dashboard/k3w-qcg-ug8 + response: + body: + encoding: UTF-8 + string: '{"deleted_dashboard_id":"k3w-qcg-ug8"} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v1/dashboards/CreateDashboard_3298564989.rb b/examples/v1/dashboards/CreateDashboard_3298564989.rb new file mode 100644 index 000000000000..227ccf009560 --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_3298564989.rb @@ -0,0 +1,65 @@ +# Create a new dashboard with llm_observability_stream list_stream widget + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::DashboardsAPI.new + +body = DatadogAPIClient::V1::Dashboard.new({ + layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED, + title: "Example-Dashboard with list_stream widget", + widgets: [ + DatadogAPIClient::V1::Widget.new({ + definition: DatadogAPIClient::V1::ListStreamWidgetDefinition.new({ + type: DatadogAPIClient::V1::ListStreamWidgetDefinitionType::LIST_STREAM, + requests: [ + DatadogAPIClient::V1::ListStreamWidgetRequest.new({ + response_format: DatadogAPIClient::V1::ListStreamResponseFormat::EVENT_LIST, + query: DatadogAPIClient::V1::ListStreamQuery.new({ + data_source: DatadogAPIClient::V1::ListStreamSource::LLM_OBSERVABILITY_STREAM, + query_string: "@event_type:span @parent_id:undefined", + indexes: [], + }), + columns: [ + DatadogAPIClient::V1::ListStreamColumn.new({ + field: "@status", + width: DatadogAPIClient::V1::ListStreamColumnWidth::COMPACT, + }), + DatadogAPIClient::V1::ListStreamColumn.new({ + field: "@content.prompt", + width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO, + }), + DatadogAPIClient::V1::ListStreamColumn.new({ + field: "@content.response.content", + width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO, + }), + DatadogAPIClient::V1::ListStreamColumn.new({ + field: "timestamp", + width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO, + }), + DatadogAPIClient::V1::ListStreamColumn.new({ + field: "@ml_app", + width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO, + }), + DatadogAPIClient::V1::ListStreamColumn.new({ + field: "service", + width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO, + }), + DatadogAPIClient::V1::ListStreamColumn.new({ + field: "@meta.evaluations.quality", + width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO, + }), + DatadogAPIClient::V1::ListStreamColumn.new({ + field: "@meta.evaluations.security", + width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO, + }), + DatadogAPIClient::V1::ListStreamColumn.new({ + field: "@duration", + width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO, + }), + ], + }), + ], + }), + }), + ], +}) +p api_instance.create_dashboard(body) diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index 09231d8d7893..0b4d397030a1 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -500,6 +500,14 @@ Feature: Dashboards And the response "widgets[0].definition.requests[0].query.sort.column" is equal to "timestamp" And the response "widgets[0].definition.requests[0].query.sort.order" is equal to "desc" + @team:DataDog/dashboards-backend + Scenario: Create a new dashboard with llm_observability_stream list_stream widget + Given new "CreateDashboard" request + And body with value {"layout_type":"ordered","title":"{{ unique }} with list_stream widget","widgets":[{"definition":{"type":"list_stream","requests":[{"response_format":"event_list","query":{"data_source":"llm_observability_stream","query_string":"@event_type:span @parent_id:undefined","indexes":[]},"columns":[{"field":"@status","width":"compact"},{"field":"@content.prompt","width":"auto"},{"field":"@content.response.content","width":"auto"},{"field":"timestamp","width":"auto"},{"field":"@ml_app","width":"auto"},{"field":"service","width":"auto"},{"field":"@meta.evaluations.quality","width":"auto"},{"field":"@meta.evaluations.security","width":"auto"},{"field":"@duration","width":"auto"}]}]}}]} + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.requests[0].query.data_source" is equal to "llm_observability_stream" + @team:DataDog/dashboards-backend Scenario: Create a new dashboard with log_stream widget Given new "CreateDashboard" request diff --git a/lib/datadog_api_client/v1/models/list_stream_source.rb b/lib/datadog_api_client/v1/models/list_stream_source.rb index ee704b2c0075..419955d2d14d 100644 --- a/lib/datadog_api_client/v1/models/list_stream_source.rb +++ b/lib/datadog_api_client/v1/models/list_stream_source.rb @@ -33,5 +33,6 @@ class ListStreamSource LOGS_TRANSACTION_STREAM = "logs_transaction_stream".freeze EVENT_STREAM = "event_stream".freeze RUM_STREAM = "rum_stream".freeze + LLM_OBSERVABILITY_STREAM = "llm_observability_stream".freeze end end