From 7172c01f13fe52709e6e44476419cc8a8d3b7f58 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 17 Oct 2024 14:16:20 +0000 Subject: [PATCH] Regenerate client from commit fb024a45 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 2 + .../CreateDashboard_3298564989.java | 91 +++++++++++++++++++ .../api/client/v1/model/ListStreamSource.java | 5 +- ...rvability_stream_list_stream_widget.freeze | 1 + ...servability_stream_list_stream_widget.json | 58 ++++++++++++ .../api/client/v1/api/dashboards.feature | 8 ++ 7 files changed, 168 insertions(+), 5 deletions(-) create mode 100644 examples/v1/dashboards/CreateDashboard_3298564989.java create mode 100644 src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_llm_observability_stream_list_stream_widget.freeze create mode 100644 src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_llm_observability_stream_list_stream_widget.json diff --git a/.apigentools-info b/.apigentools-info index b2343c9d8ca..43bb25550cf 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:17.471714", - "spec_repo_commit": "86072741" + "regenerated": "2024-10-17 14:14:39.709330", + "spec_repo_commit": "fb024a45" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-16 20:07:17.490312", - "spec_repo_commit": "86072741" + "regenerated": "2024-10-17 14:14:39.728219", + "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 e2eb404ab43..0ec2691c577 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/examples/v1/dashboards/CreateDashboard_3298564989.java b/examples/v1/dashboards/CreateDashboard_3298564989.java new file mode 100644 index 00000000000..74a8ec4b5bd --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_3298564989.java @@ -0,0 +1,91 @@ +// Create a new dashboard with llm_observability_stream list_stream widget + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v1.api.DashboardsApi; +import com.datadog.api.client.v1.model.Dashboard; +import com.datadog.api.client.v1.model.DashboardLayoutType; +import com.datadog.api.client.v1.model.ListStreamColumn; +import com.datadog.api.client.v1.model.ListStreamColumnWidth; +import com.datadog.api.client.v1.model.ListStreamQuery; +import com.datadog.api.client.v1.model.ListStreamResponseFormat; +import com.datadog.api.client.v1.model.ListStreamSource; +import com.datadog.api.client.v1.model.ListStreamWidgetDefinition; +import com.datadog.api.client.v1.model.ListStreamWidgetDefinitionType; +import com.datadog.api.client.v1.model.ListStreamWidgetRequest; +import com.datadog.api.client.v1.model.Widget; +import com.datadog.api.client.v1.model.WidgetDefinition; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + DashboardsApi apiInstance = new DashboardsApi(defaultClient); + + Dashboard body = + new Dashboard() + .layoutType(DashboardLayoutType.ORDERED) + .title("Example-Dashboard with list_stream widget") + .widgets( + Collections.singletonList( + new Widget() + .definition( + new WidgetDefinition( + new ListStreamWidgetDefinition() + .type(ListStreamWidgetDefinitionType.LIST_STREAM) + .requests( + Collections.singletonList( + new ListStreamWidgetRequest() + .responseFormat(ListStreamResponseFormat.EVENT_LIST) + .query( + new ListStreamQuery() + .dataSource( + ListStreamSource + .LLM_OBSERVABILITY_STREAM) + .queryString( + "@event_type:span" + + " @parent_id:undefined")) + .columns( + Arrays.asList( + new ListStreamColumn() + .field("@status") + .width(ListStreamColumnWidth.COMPACT), + new ListStreamColumn() + .field("@content.prompt") + .width(ListStreamColumnWidth.AUTO), + new ListStreamColumn() + .field("@content.response.content") + .width(ListStreamColumnWidth.AUTO), + new ListStreamColumn() + .field("timestamp") + .width(ListStreamColumnWidth.AUTO), + new ListStreamColumn() + .field("@ml_app") + .width(ListStreamColumnWidth.AUTO), + new ListStreamColumn() + .field("service") + .width(ListStreamColumnWidth.AUTO), + new ListStreamColumn() + .field("@meta.evaluations.quality") + .width(ListStreamColumnWidth.AUTO), + new ListStreamColumn() + .field("@meta.evaluations.security") + .width(ListStreamColumnWidth.AUTO), + new ListStreamColumn() + .field("@duration") + .width( + ListStreamColumnWidth.AUTO))))))))); + + try { + Dashboard result = apiInstance.createDashboard(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DashboardsApi#createDashboard"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/ListStreamSource.java b/src/main/java/com/datadog/api/client/v1/model/ListStreamSource.java index 1bce2f28968..a97672ff7b8 100644 --- a/src/main/java/com/datadog/api/client/v1/model/ListStreamSource.java +++ b/src/main/java/com/datadog/api/client/v1/model/ListStreamSource.java @@ -36,7 +36,8 @@ public class ListStreamSource extends ModelEnum { "logs_pattern_stream", "logs_transaction_stream", "event_stream", - "rum_stream")); + "rum_stream", + "llm_observability_stream")); public static final ListStreamSource LOGS_STREAM = new ListStreamSource("logs_stream"); public static final ListStreamSource AUDIT_STREAM = new ListStreamSource("audit_stream"); @@ -54,6 +55,8 @@ public class ListStreamSource extends ModelEnum { new ListStreamSource("logs_transaction_stream"); public static final ListStreamSource EVENT_STREAM = new ListStreamSource("event_stream"); public static final ListStreamSource RUM_STREAM = new ListStreamSource("rum_stream"); + public static final ListStreamSource LLM_OBSERVABILITY_STREAM = + new ListStreamSource("llm_observability_stream"); ListStreamSource(String value) { super(value, allowedValues); diff --git a/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_llm_observability_stream_list_stream_widget.freeze b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_llm_observability_stream_list_stream_widget.freeze new file mode 100644 index 00000000000..379a35d8336 --- /dev/null +++ b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_llm_observability_stream_list_stream_widget.freeze @@ -0,0 +1 @@ +2024-10-15T21:46:06.749Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_llm_observability_stream_list_stream_widget.json b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_llm_observability_stream_list_stream_widget.json new file mode 100644 index 00000000000..3892342c0c0 --- /dev/null +++ b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_llm_observability_stream_list_stream_widget.json @@ -0,0 +1,58 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "POST", + "path": "/api/v1/dashboard", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\":[]}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cf641f4f-8e4f-7935-f5b4-4afac4518e18" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v1/dashboard/k3w-qcg-ug8", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"deleted_dashboard_id\":\"k3w-qcg-ug8\"}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a917abb5-e304-8f7d-e7b8-bd4e3f095748" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v1/api/dashboards.feature b/src/test/resources/com/datadog/api/client/v1/api/dashboards.feature index 09231d8d789..0b4d397030a 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/dashboards.feature +++ b/src/test/resources/com/datadog/api/client/v1/api/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