Skip to content

Commit

Permalink
Add LLM Observability to ListStreamSource (#2054)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Oct 17, 2024
1 parent d5e3ae3 commit d942279
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
2 changes: 2 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4796,6 +4796,7 @@ components:
- logs_transaction_stream
- event_stream
- rum_stream
- llm_observability_stream
example: apm_issue_stream
type: string
x-enum-varnames:
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2024-10-15T21:46:06.749Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 65 additions & 0 deletions examples/v1/dashboards/CreateDashboard_3298564989.rb
Original file line number Diff line number Diff line change
@@ -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)
8 changes: 8 additions & 0 deletions features/v1/dashboards.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/datadog_api_client/v1/models/list_stream_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d942279

Please sign in to comment.