# Evaluation Dashboards

## Create Evaluation Dashboard

`client.EvaluationDashboards.New(ctx, body) (*EvaluationDashboard, error)`

**post** `/v5/evaluation-dashboards`

Create a dashboard bound to exactly one evaluation or evaluation group.

The request must set exactly one of `evaluation_id` or `evaluation_group_id`
(enforced as XOR) — supplying both or neither is rejected, and the referenced
evaluation or group must already exist in the caller's account or the call fails
with a not-found error. If `template_dashboard_id` is provided, the new dashboard
copies that template's `widget_order` and synchronously computes a result for each
of those widgets against the new dashboard's evaluation data before returning. Any
`widget_order` supplied is validated to contain only existing, non-duplicate widget
IDs. The dashboard is created and returned immediately; individual widgets are added
afterward through the widget sub-endpoints.

### Parameters

- `body EvaluationDashboardNewParams`

  - `Name param.Field[string]`

    Dashboard name

  - `Description param.Field[string]`

    Optional description of the dashboard

  - `EvaluationGroupID param.Field[string]`

    Evaluation group ID (XOR with evaluation_id)

  - `EvaluationID param.Field[string]`

    Evaluation ID (XOR with evaluation_group_id)

  - `Tags param.Field[[]string]`

    The tags associated with the entity

  - `TemplateDashboardID param.Field[string]`

    Optional dashboard ID to use as template. Copies widget_order from template.

  - `WidgetOrder param.Field[[]string]`

    Ordered array of widget IDs to display on this dashboard

### Returns

- `type EvaluationDashboard struct{…}`

  - `ID string`

    Unique identifier of the dashboard

  - `AccountID string`

    Account that owns this dashboard

  - `CreatedAt Time`

    When the dashboard was created

  - `CreatedBy Identity`

    The identity that created the entity.

    - `ID string`

    - `Type IdentityType`

      - `const IdentityTypeUser IdentityType = "user"`

      - `const IdentityTypeServiceAccount IdentityType = "service_account"`

    - `Object IdentityObject`

      - `const IdentityObjectIdentity IdentityObject = "identity"`

  - `Name string`

    Dashboard name

  - `Tags []string`

    The tags associated with the entity

  - `UpdatedAt Time`

    When the dashboard was last updated

  - `ArchivedAt Time`

    When the dashboard was archived (soft-deleted)

  - `Description string`

    Dashboard description

  - `ErrorMessage string`

    Error message if computation failed

  - `EvaluationGroupID string`

    Evaluation group ID

  - `EvaluationID string`

    Evaluation ID

  - `Object EvaluationDashboardObject`

    - `const EvaluationDashboardObjectEvaluationDashboard EvaluationDashboardObject = "evaluation_dashboard"`

  - `WidgetOrder []string`

    Ordered array of widget IDs

  - `WidgetResults []EvaluationDashboardWidgetResult`

    Widget results for this dashboard. Populated with 'widget_results' view.

    - `ID string`

      Unique identifier of the widget result

    - `AccountID string`

      Account that owns this widget result

    - `ComputationStatus EvaluationDashboardWidgetResultComputationStatus`

      Status of the computation

      - `const EvaluationDashboardWidgetResultComputationStatusPending EvaluationDashboardWidgetResultComputationStatus = "pending"`

      - `const EvaluationDashboardWidgetResultComputationStatusCompleted EvaluationDashboardWidgetResultComputationStatus = "completed"`

      - `const EvaluationDashboardWidgetResultComputationStatusFailed EvaluationDashboardWidgetResultComputationStatus = "failed"`

    - `CreatedAt Time`

      When the widget result was created

    - `WidgetID string`

      Unique identifier of the widget

    - `ComputationJobID string`

      Temporal workflow ID or job ID for async computation tracking

    - `ComputedAt Time`

      Timestamp when computation completed successfully

    - `ComputedResult map[string, any]`

      Cached computation results

    - `ErrorMessage string`

      Error message if computation failed

    - `EvaluationGroupID string`

      FK to evaluation_groups. Null if result is for a single evaluation.

    - `EvaluationID string`

      FK to evaluations. Null if result is for an evaluation group.

    - `Object EvaluationDashboardWidgetResultObject`

      - `const EvaluationDashboardWidgetResultObjectEvaluationDashboardWidgetResult EvaluationDashboardWidgetResultObject = "evaluation_dashboard_widget_result"`

    - `Widget EvaluationDashboardWidget`

      Widget that this result is for

      - `ID string`

        Unique identifier of the widget

      - `AccountID string`

        Account that owns this widget

      - `CreatedAt Time`

        When the widget was created

      - `Title string`

        Widget title

      - `Type EvaluationWidgetTypeEnum`

        Widget type

        - `const EvaluationWidgetTypeEnumBar EvaluationWidgetTypeEnum = "bar"`

        - `const EvaluationWidgetTypeEnumHistogram EvaluationWidgetTypeEnum = "histogram"`

        - `const EvaluationWidgetTypeEnumDonut EvaluationWidgetTypeEnum = "donut"`

        - `const EvaluationWidgetTypeEnumScatter EvaluationWidgetTypeEnum = "scatter"`

        - `const EvaluationWidgetTypeEnumMetric EvaluationWidgetTypeEnum = "metric"`

        - `const EvaluationWidgetTypeEnumTable EvaluationWidgetTypeEnum = "table"`

        - `const EvaluationWidgetTypeEnumMarkdown EvaluationWidgetTypeEnum = "markdown"`

        - `const EvaluationWidgetTypeEnumHeading EvaluationWidgetTypeEnum = "heading"`

        - `const EvaluationWidgetTypeEnumTimeseries EvaluationWidgetTypeEnum = "timeseries"`

      - `ArchivedAt Time`

        When the widget was archived (soft-deleted)

      - `Config map[string, any]`

        Chart-specific display configuration

      - `Object EvaluationDashboardWidgetObject`

        - `const EvaluationDashboardWidgetObjectEvaluationDashboardWidget EvaluationDashboardWidgetObject = "evaluation_dashboard_widget"`

      - `Query EvaluationDashboardWidgetQueryUnion`

        Structured query AST for metric computation (SeriesQuery or MetricQuery)

        - `type SeriesQuery struct{…}`

          Query that returns a series of records (used for table/bar/histogram/donut/scatter widgets).

          Used for widget types: table, bar, histogram, donut, scatter.
          Returns: {"type": "series", "data": [...]}

          Example SQL equivalent:
          SELECT category, AVG(score) as avg_score, COUNT(*) as count
          FROM evaluation_items
          WHERE score > 0.5 AND category = 'test'
          GROUP BY category
          ORDER BY avg_score DESC
          LIMIT 100

          - `Select []SelectItem`

            - `Expression SelectItemExpressionUnion`

              Reference to a column from evaluation_items.data

              Example:
              {"type": "COLUMN", "column": "category"}

              - `type SelectItemExpressionColumn struct{…}`

                Reference to a column from evaluation_items.data

                Example:
                {"type": "COLUMN", "column": "category"}

                - `Column string`

                  Column name from evaluation_items.data

                - `Source string`

                  Column source: 'data' or 'task_result_cache'

                - `Type string`

                  - `const SelectItemExpressionColumnTypeColumn SelectItemExpressionColumnType = "COLUMN"`

              - `type SelectItemExpressionAggregation struct{…}`

                Aggregation function to apply

                Examples:
                {"type": "AGGREGATION", "function": "AVG", "column": "score"}
                {"type": "AGGREGATION", "function": "COUNT", "column": "*"}
                {"type": "AGGREGATION", "function": "PERCENTILE", "column": "score", "params": {"percentile": 95}}

                - `Column string`

                  Column to aggregate, or '*' for COUNT(*)

                - `Function string`

                  Supported aggregation functions

                  - `const SelectItemExpressionAggregationFunctionCount SelectItemExpressionAggregationFunction = "COUNT"`

                  - `const SelectItemExpressionAggregationFunctionSum SelectItemExpressionAggregationFunction = "SUM"`

                  - `const SelectItemExpressionAggregationFunctionAvg SelectItemExpressionAggregationFunction = "AVG"`

                  - `const SelectItemExpressionAggregationFunctionMin SelectItemExpressionAggregationFunction = "MIN"`

                  - `const SelectItemExpressionAggregationFunctionMax SelectItemExpressionAggregationFunction = "MAX"`

                  - `const SelectItemExpressionAggregationFunctionStddev SelectItemExpressionAggregationFunction = "STDDEV"`

                  - `const SelectItemExpressionAggregationFunctionVariance SelectItemExpressionAggregationFunction = "VARIANCE"`

                  - `const SelectItemExpressionAggregationFunctionPercentile SelectItemExpressionAggregationFunction = "PERCENTILE"`

                  - `const SelectItemExpressionAggregationFunctionCountDistinct SelectItemExpressionAggregationFunction = "COUNT_DISTINCT"`

                  - `const SelectItemExpressionAggregationFunctionPercentage SelectItemExpressionAggregationFunction = "PERCENTAGE"`

                - `EvaluationIDs []string`

                  Optional subset of evaluation IDs for per-aggregation filtering in evaluation group dashboards.

                - `Params map[string, any]`

                  Function parameters (e.g., {'percentile': 95} for PERCENTILE, {'percentage_filters': Filter} for PERCENTAGE)

                - `Source string`

                  Column source: 'data' or 'task_result_cache'

                - `Type string`

                  - `const SelectItemExpressionAggregationTypeAggregation SelectItemExpressionAggregationType = "AGGREGATION"`

            - `Alias string`

              Optional alias for the selected item

          - `EvaluationIDs []string`

            Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

          - `Filter Filter`

            Filter conditions (WHERE clause)

            - `Conditions []FilterCondition`

              - `Column string`

                Column name to filter on

              - `Operator string`

                Comparison operator

                - `const FilterConditionOperatorEquals FilterConditionOperator = "="`

                - `const FilterConditionOperatorNotEquals FilterConditionOperator = "!="`

                - `const FilterConditionOperatorGreater FilterConditionOperator = ">"`

                - `const FilterConditionOperatorLess FilterConditionOperator = "<"`

                - `const FilterConditionOperatorGreaterOrEquals FilterConditionOperator = ">="`

                - `const FilterConditionOperatorLessOrEquals FilterConditionOperator = "<="`

                - `const FilterConditionOperatorIn FilterConditionOperator = "IN"`

                - `const FilterConditionOperatorNotIn FilterConditionOperator = "NOT IN"`

                - `const FilterConditionOperatorLike FilterConditionOperator = "LIKE"`

                - `const FilterConditionOperatorNotLike FilterConditionOperator = "NOT LIKE"`

                - `const FilterConditionOperatorIsNull FilterConditionOperator = "IS NULL"`

                - `const FilterConditionOperatorIsNotNull FilterConditionOperator = "IS NOT NULL"`

              - `Source string`

                Column source: 'data' or 'task_result_cache'

              - `Value FilterConditionValueUnion`

                Value to compare against. Not required for IS NULL / IS NOT NULL operators.

                - `string`

                - `float64`

                - `bool`

                - `type FilterConditionValueArray []any`

            - `LogicalOperators []string`

              Logical operators connecting conditions. Length must be len(conditions) - 1

              - `const FilterLogicalOperatorAnd FilterLogicalOperator = "AND"`

              - `const FilterLogicalOperatorOr FilterLogicalOperator = "OR"`

          - `GroupBy []string`

            Columns to group by

          - `LatestOnly bool`

            When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

          - `Limit int64`

            Max rows to return

          - `OrderBy []SeriesQueryOrderBy`

            Sort order

            - `Column string`

              Column name to sort by

            - `Direction string`

              Sort direction

              - `const SeriesQueryOrderByDirectionAsc SeriesQueryOrderByDirection = "ASC"`

              - `const SeriesQueryOrderByDirectionDesc SeriesQueryOrderByDirection = "DESC"`

            - `Source string`

              Column source: 'data' or 'task_result_cache'

        - `type MetricQuery struct{…}`

          Query that returns a single metric value (used for metric widgets).

          Used for widget type: metric.
          Enforces exactly 1 aggregation in select.
          Returns: {"type": "metric", "data": ...}

          Example SQL equivalent:
          SELECT AVG(score) as average_score
          FROM evaluation_items

          - `Select []SelectItem`

            - `Expression SelectItemExpressionUnion`

              Reference to a column from evaluation_items.data

              Example:
              {"type": "COLUMN", "column": "category"}

            - `Alias string`

              Optional alias for the selected item

          - `EvaluationIDs []string`

            Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

          - `Filter Filter`

            Filter conditions (WHERE clause)

          - `LatestOnly bool`

            When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

  - `Widgets []EvaluationDashboardWidget`

    Widgets associated with this dashboard. Populated with 'widgets' view.

    - `ID string`

      Unique identifier of the widget

    - `AccountID string`

      Account that owns this widget

    - `CreatedAt Time`

      When the widget was created

    - `Title string`

      Widget title

    - `Type EvaluationWidgetTypeEnum`

      Widget type

    - `ArchivedAt Time`

      When the widget was archived (soft-deleted)

    - `Config map[string, any]`

      Chart-specific display configuration

    - `Object EvaluationDashboardWidgetObject`

    - `Query EvaluationDashboardWidgetQueryUnion`

      Structured query AST for metric computation (SeriesQuery or MetricQuery)

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/scaleapi/sgp-dev-go"
  "github.com/scaleapi/sgp-dev-go/option"
)

func main() {
  client := sgpdev.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithAccountID("My Account ID"),
  )
  evaluationDashboard, err := client.EvaluationDashboards.New(context.TODO(), sgpdev.EvaluationDashboardNewParams{
    Name: "x",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", evaluationDashboard.ID)
}
```

#### Response

```json
{
  "id": "id",
  "account_id": "account_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": {
    "id": "id",
    "type": "user",
    "object": "identity"
  },
  "name": "name",
  "tags": [
    "string"
  ],
  "updated_at": "2019-12-27T18:11:19.117Z",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "error_message": "error_message",
  "evaluation_group_id": "evaluation_group_id",
  "evaluation_id": "evaluation_id",
  "object": "evaluation_dashboard",
  "widget_order": [
    "string"
  ],
  "widget_results": [
    {
      "id": "id",
      "account_id": "account_id",
      "computation_status": "pending",
      "created_at": "2019-12-27T18:11:19.117Z",
      "widget_id": "widget_id",
      "computation_job_id": "computation_job_id",
      "computed_at": "2019-12-27T18:11:19.117Z",
      "computed_result": {
        "foo": "bar"
      },
      "error_message": "error_message",
      "evaluation_group_id": "evaluation_group_id",
      "evaluation_id": "evaluation_id",
      "object": "evaluation_dashboard_widget_result",
      "widget": {
        "id": "id",
        "account_id": "account_id",
        "created_at": "2019-12-27T18:11:19.117Z",
        "title": "title",
        "type": "bar",
        "archived_at": "2019-12-27T18:11:19.117Z",
        "config": {
          "foo": "bar"
        },
        "object": "evaluation_dashboard_widget",
        "query": {
          "select": [
            {
              "expression": {
                "column": "column",
                "source": "source",
                "type": "COLUMN"
              },
              "alias": "alias"
            }
          ],
          "evaluation_ids": [
            "string"
          ],
          "filter": {
            "conditions": [
              {
                "column": "column",
                "operator": "=",
                "source": "source",
                "value": "string"
              }
            ],
            "logicalOperators": [
              "AND"
            ]
          },
          "groupBy": [
            "string"
          ],
          "latest_only": true,
          "limit": 1,
          "orderBy": [
            {
              "column": "column",
              "direction": "ASC",
              "source": "source"
            }
          ]
        }
      }
    }
  ],
  "widgets": [
    {
      "id": "id",
      "account_id": "account_id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "title": "title",
      "type": "bar",
      "archived_at": "2019-12-27T18:11:19.117Z",
      "config": {
        "foo": "bar"
      },
      "object": "evaluation_dashboard_widget",
      "query": {
        "select": [
          {
            "expression": {
              "column": "column",
              "source": "source",
              "type": "COLUMN"
            },
            "alias": "alias"
          }
        ],
        "evaluation_ids": [
          "string"
        ],
        "filter": {
          "conditions": [
            {
              "column": "column",
              "operator": "=",
              "source": "source",
              "value": "string"
            }
          ],
          "logicalOperators": [
            "AND"
          ]
        },
        "groupBy": [
          "string"
        ],
        "latest_only": true,
        "limit": 1,
        "orderBy": [
          {
            "column": "column",
            "direction": "ASC",
            "source": "source"
          }
        ]
      }
    }
  ]
}
```

## List Evaluation Dashboards

`client.EvaluationDashboards.List(ctx, query) (*CursorPage[EvaluationDashboard], error)`

**get** `/v5/evaluation-dashboards`

List dashboards in the caller's account, paginated, with optional filters.

Filter to a single evaluation with `evaluation_id` or to a group with
`evaluation_group_id`; passing both is rejected, since a dashboard is bound to one
or the other. `tags` matches case-insensitively (values are lowercased before
lookup), `created_by_ids` filters by creator identity, and `search` matches the
dashboard name and tags. Archived dashboards are excluded unless `include_archived`
is true. The returned items carry only the dashboards' own fields — widgets and
widget results are never embedded here; use the get-by-id endpoint with the
`widgets`/`widget_results` views to load those.

### Parameters

- `query EvaluationDashboardListParams`

  - `CreatedByIDs param.Field[[]string]`

    Filter by creator user IDs

  - `EndingBefore param.Field[string]`

  - `EvaluationGroupID param.Field[string]`

  - `EvaluationID param.Field[string]`

  - `IncludeArchived param.Field[bool]`

  - `Limit param.Field[int64]`

  - `Search param.Field[string]`

    Search in name and tags

  - `SortBy param.Field[string]`

  - `SortOrder param.Field[SortOrder]`

  - `StartingAfter param.Field[string]`

  - `Tags param.Field[[]string]`

    Filter by tags (case-insensitive)

### Returns

- `type EvaluationDashboard struct{…}`

  - `ID string`

    Unique identifier of the dashboard

  - `AccountID string`

    Account that owns this dashboard

  - `CreatedAt Time`

    When the dashboard was created

  - `CreatedBy Identity`

    The identity that created the entity.

    - `ID string`

    - `Type IdentityType`

      - `const IdentityTypeUser IdentityType = "user"`

      - `const IdentityTypeServiceAccount IdentityType = "service_account"`

    - `Object IdentityObject`

      - `const IdentityObjectIdentity IdentityObject = "identity"`

  - `Name string`

    Dashboard name

  - `Tags []string`

    The tags associated with the entity

  - `UpdatedAt Time`

    When the dashboard was last updated

  - `ArchivedAt Time`

    When the dashboard was archived (soft-deleted)

  - `Description string`

    Dashboard description

  - `ErrorMessage string`

    Error message if computation failed

  - `EvaluationGroupID string`

    Evaluation group ID

  - `EvaluationID string`

    Evaluation ID

  - `Object EvaluationDashboardObject`

    - `const EvaluationDashboardObjectEvaluationDashboard EvaluationDashboardObject = "evaluation_dashboard"`

  - `WidgetOrder []string`

    Ordered array of widget IDs

  - `WidgetResults []EvaluationDashboardWidgetResult`

    Widget results for this dashboard. Populated with 'widget_results' view.

    - `ID string`

      Unique identifier of the widget result

    - `AccountID string`

      Account that owns this widget result

    - `ComputationStatus EvaluationDashboardWidgetResultComputationStatus`

      Status of the computation

      - `const EvaluationDashboardWidgetResultComputationStatusPending EvaluationDashboardWidgetResultComputationStatus = "pending"`

      - `const EvaluationDashboardWidgetResultComputationStatusCompleted EvaluationDashboardWidgetResultComputationStatus = "completed"`

      - `const EvaluationDashboardWidgetResultComputationStatusFailed EvaluationDashboardWidgetResultComputationStatus = "failed"`

    - `CreatedAt Time`

      When the widget result was created

    - `WidgetID string`

      Unique identifier of the widget

    - `ComputationJobID string`

      Temporal workflow ID or job ID for async computation tracking

    - `ComputedAt Time`

      Timestamp when computation completed successfully

    - `ComputedResult map[string, any]`

      Cached computation results

    - `ErrorMessage string`

      Error message if computation failed

    - `EvaluationGroupID string`

      FK to evaluation_groups. Null if result is for a single evaluation.

    - `EvaluationID string`

      FK to evaluations. Null if result is for an evaluation group.

    - `Object EvaluationDashboardWidgetResultObject`

      - `const EvaluationDashboardWidgetResultObjectEvaluationDashboardWidgetResult EvaluationDashboardWidgetResultObject = "evaluation_dashboard_widget_result"`

    - `Widget EvaluationDashboardWidget`

      Widget that this result is for

      - `ID string`

        Unique identifier of the widget

      - `AccountID string`

        Account that owns this widget

      - `CreatedAt Time`

        When the widget was created

      - `Title string`

        Widget title

      - `Type EvaluationWidgetTypeEnum`

        Widget type

        - `const EvaluationWidgetTypeEnumBar EvaluationWidgetTypeEnum = "bar"`

        - `const EvaluationWidgetTypeEnumHistogram EvaluationWidgetTypeEnum = "histogram"`

        - `const EvaluationWidgetTypeEnumDonut EvaluationWidgetTypeEnum = "donut"`

        - `const EvaluationWidgetTypeEnumScatter EvaluationWidgetTypeEnum = "scatter"`

        - `const EvaluationWidgetTypeEnumMetric EvaluationWidgetTypeEnum = "metric"`

        - `const EvaluationWidgetTypeEnumTable EvaluationWidgetTypeEnum = "table"`

        - `const EvaluationWidgetTypeEnumMarkdown EvaluationWidgetTypeEnum = "markdown"`

        - `const EvaluationWidgetTypeEnumHeading EvaluationWidgetTypeEnum = "heading"`

        - `const EvaluationWidgetTypeEnumTimeseries EvaluationWidgetTypeEnum = "timeseries"`

      - `ArchivedAt Time`

        When the widget was archived (soft-deleted)

      - `Config map[string, any]`

        Chart-specific display configuration

      - `Object EvaluationDashboardWidgetObject`

        - `const EvaluationDashboardWidgetObjectEvaluationDashboardWidget EvaluationDashboardWidgetObject = "evaluation_dashboard_widget"`

      - `Query EvaluationDashboardWidgetQueryUnion`

        Structured query AST for metric computation (SeriesQuery or MetricQuery)

        - `type SeriesQuery struct{…}`

          Query that returns a series of records (used for table/bar/histogram/donut/scatter widgets).

          Used for widget types: table, bar, histogram, donut, scatter.
          Returns: {"type": "series", "data": [...]}

          Example SQL equivalent:
          SELECT category, AVG(score) as avg_score, COUNT(*) as count
          FROM evaluation_items
          WHERE score > 0.5 AND category = 'test'
          GROUP BY category
          ORDER BY avg_score DESC
          LIMIT 100

          - `Select []SelectItem`

            - `Expression SelectItemExpressionUnion`

              Reference to a column from evaluation_items.data

              Example:
              {"type": "COLUMN", "column": "category"}

              - `type SelectItemExpressionColumn struct{…}`

                Reference to a column from evaluation_items.data

                Example:
                {"type": "COLUMN", "column": "category"}

                - `Column string`

                  Column name from evaluation_items.data

                - `Source string`

                  Column source: 'data' or 'task_result_cache'

                - `Type string`

                  - `const SelectItemExpressionColumnTypeColumn SelectItemExpressionColumnType = "COLUMN"`

              - `type SelectItemExpressionAggregation struct{…}`

                Aggregation function to apply

                Examples:
                {"type": "AGGREGATION", "function": "AVG", "column": "score"}
                {"type": "AGGREGATION", "function": "COUNT", "column": "*"}
                {"type": "AGGREGATION", "function": "PERCENTILE", "column": "score", "params": {"percentile": 95}}

                - `Column string`

                  Column to aggregate, or '*' for COUNT(*)

                - `Function string`

                  Supported aggregation functions

                  - `const SelectItemExpressionAggregationFunctionCount SelectItemExpressionAggregationFunction = "COUNT"`

                  - `const SelectItemExpressionAggregationFunctionSum SelectItemExpressionAggregationFunction = "SUM"`

                  - `const SelectItemExpressionAggregationFunctionAvg SelectItemExpressionAggregationFunction = "AVG"`

                  - `const SelectItemExpressionAggregationFunctionMin SelectItemExpressionAggregationFunction = "MIN"`

                  - `const SelectItemExpressionAggregationFunctionMax SelectItemExpressionAggregationFunction = "MAX"`

                  - `const SelectItemExpressionAggregationFunctionStddev SelectItemExpressionAggregationFunction = "STDDEV"`

                  - `const SelectItemExpressionAggregationFunctionVariance SelectItemExpressionAggregationFunction = "VARIANCE"`

                  - `const SelectItemExpressionAggregationFunctionPercentile SelectItemExpressionAggregationFunction = "PERCENTILE"`

                  - `const SelectItemExpressionAggregationFunctionCountDistinct SelectItemExpressionAggregationFunction = "COUNT_DISTINCT"`

                  - `const SelectItemExpressionAggregationFunctionPercentage SelectItemExpressionAggregationFunction = "PERCENTAGE"`

                - `EvaluationIDs []string`

                  Optional subset of evaluation IDs for per-aggregation filtering in evaluation group dashboards.

                - `Params map[string, any]`

                  Function parameters (e.g., {'percentile': 95} for PERCENTILE, {'percentage_filters': Filter} for PERCENTAGE)

                - `Source string`

                  Column source: 'data' or 'task_result_cache'

                - `Type string`

                  - `const SelectItemExpressionAggregationTypeAggregation SelectItemExpressionAggregationType = "AGGREGATION"`

            - `Alias string`

              Optional alias for the selected item

          - `EvaluationIDs []string`

            Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

          - `Filter Filter`

            Filter conditions (WHERE clause)

            - `Conditions []FilterCondition`

              - `Column string`

                Column name to filter on

              - `Operator string`

                Comparison operator

                - `const FilterConditionOperatorEquals FilterConditionOperator = "="`

                - `const FilterConditionOperatorNotEquals FilterConditionOperator = "!="`

                - `const FilterConditionOperatorGreater FilterConditionOperator = ">"`

                - `const FilterConditionOperatorLess FilterConditionOperator = "<"`

                - `const FilterConditionOperatorGreaterOrEquals FilterConditionOperator = ">="`

                - `const FilterConditionOperatorLessOrEquals FilterConditionOperator = "<="`

                - `const FilterConditionOperatorIn FilterConditionOperator = "IN"`

                - `const FilterConditionOperatorNotIn FilterConditionOperator = "NOT IN"`

                - `const FilterConditionOperatorLike FilterConditionOperator = "LIKE"`

                - `const FilterConditionOperatorNotLike FilterConditionOperator = "NOT LIKE"`

                - `const FilterConditionOperatorIsNull FilterConditionOperator = "IS NULL"`

                - `const FilterConditionOperatorIsNotNull FilterConditionOperator = "IS NOT NULL"`

              - `Source string`

                Column source: 'data' or 'task_result_cache'

              - `Value FilterConditionValueUnion`

                Value to compare against. Not required for IS NULL / IS NOT NULL operators.

                - `string`

                - `float64`

                - `bool`

                - `type FilterConditionValueArray []any`

            - `LogicalOperators []string`

              Logical operators connecting conditions. Length must be len(conditions) - 1

              - `const FilterLogicalOperatorAnd FilterLogicalOperator = "AND"`

              - `const FilterLogicalOperatorOr FilterLogicalOperator = "OR"`

          - `GroupBy []string`

            Columns to group by

          - `LatestOnly bool`

            When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

          - `Limit int64`

            Max rows to return

          - `OrderBy []SeriesQueryOrderBy`

            Sort order

            - `Column string`

              Column name to sort by

            - `Direction string`

              Sort direction

              - `const SeriesQueryOrderByDirectionAsc SeriesQueryOrderByDirection = "ASC"`

              - `const SeriesQueryOrderByDirectionDesc SeriesQueryOrderByDirection = "DESC"`

            - `Source string`

              Column source: 'data' or 'task_result_cache'

        - `type MetricQuery struct{…}`

          Query that returns a single metric value (used for metric widgets).

          Used for widget type: metric.
          Enforces exactly 1 aggregation in select.
          Returns: {"type": "metric", "data": ...}

          Example SQL equivalent:
          SELECT AVG(score) as average_score
          FROM evaluation_items

          - `Select []SelectItem`

            - `Expression SelectItemExpressionUnion`

              Reference to a column from evaluation_items.data

              Example:
              {"type": "COLUMN", "column": "category"}

            - `Alias string`

              Optional alias for the selected item

          - `EvaluationIDs []string`

            Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

          - `Filter Filter`

            Filter conditions (WHERE clause)

          - `LatestOnly bool`

            When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

  - `Widgets []EvaluationDashboardWidget`

    Widgets associated with this dashboard. Populated with 'widgets' view.

    - `ID string`

      Unique identifier of the widget

    - `AccountID string`

      Account that owns this widget

    - `CreatedAt Time`

      When the widget was created

    - `Title string`

      Widget title

    - `Type EvaluationWidgetTypeEnum`

      Widget type

    - `ArchivedAt Time`

      When the widget was archived (soft-deleted)

    - `Config map[string, any]`

      Chart-specific display configuration

    - `Object EvaluationDashboardWidgetObject`

    - `Query EvaluationDashboardWidgetQueryUnion`

      Structured query AST for metric computation (SeriesQuery or MetricQuery)

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/scaleapi/sgp-dev-go"
  "github.com/scaleapi/sgp-dev-go/option"
)

func main() {
  client := sgpdev.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithAccountID("My Account ID"),
  )
  page, err := client.EvaluationDashboards.List(context.TODO(), sgpdev.EvaluationDashboardListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
```

#### Response

```json
{
  "has_more": true,
  "items": [
    {
      "id": "id",
      "account_id": "account_id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by": {
        "id": "id",
        "type": "user",
        "object": "identity"
      },
      "name": "name",
      "tags": [
        "string"
      ],
      "updated_at": "2019-12-27T18:11:19.117Z",
      "archived_at": "2019-12-27T18:11:19.117Z",
      "description": "description",
      "error_message": "error_message",
      "evaluation_group_id": "evaluation_group_id",
      "evaluation_id": "evaluation_id",
      "object": "evaluation_dashboard",
      "widget_order": [
        "string"
      ],
      "widget_results": [
        {
          "id": "id",
          "account_id": "account_id",
          "computation_status": "pending",
          "created_at": "2019-12-27T18:11:19.117Z",
          "widget_id": "widget_id",
          "computation_job_id": "computation_job_id",
          "computed_at": "2019-12-27T18:11:19.117Z",
          "computed_result": {
            "foo": "bar"
          },
          "error_message": "error_message",
          "evaluation_group_id": "evaluation_group_id",
          "evaluation_id": "evaluation_id",
          "object": "evaluation_dashboard_widget_result",
          "widget": {
            "id": "id",
            "account_id": "account_id",
            "created_at": "2019-12-27T18:11:19.117Z",
            "title": "title",
            "type": "bar",
            "archived_at": "2019-12-27T18:11:19.117Z",
            "config": {
              "foo": "bar"
            },
            "object": "evaluation_dashboard_widget",
            "query": {
              "select": [
                {
                  "expression": {
                    "column": "column",
                    "source": "source",
                    "type": "COLUMN"
                  },
                  "alias": "alias"
                }
              ],
              "evaluation_ids": [
                "string"
              ],
              "filter": {
                "conditions": [
                  {
                    "column": "column",
                    "operator": "=",
                    "source": "source",
                    "value": "string"
                  }
                ],
                "logicalOperators": [
                  "AND"
                ]
              },
              "groupBy": [
                "string"
              ],
              "latest_only": true,
              "limit": 1,
              "orderBy": [
                {
                  "column": "column",
                  "direction": "ASC",
                  "source": "source"
                }
              ]
            }
          }
        }
      ],
      "widgets": [
        {
          "id": "id",
          "account_id": "account_id",
          "created_at": "2019-12-27T18:11:19.117Z",
          "title": "title",
          "type": "bar",
          "archived_at": "2019-12-27T18:11:19.117Z",
          "config": {
            "foo": "bar"
          },
          "object": "evaluation_dashboard_widget",
          "query": {
            "select": [
              {
                "expression": {
                  "column": "column",
                  "source": "source",
                  "type": "COLUMN"
                },
                "alias": "alias"
              }
            ],
            "evaluation_ids": [
              "string"
            ],
            "filter": {
              "conditions": [
                {
                  "column": "column",
                  "operator": "=",
                  "source": "source",
                  "value": "string"
                }
              ],
              "logicalOperators": [
                "AND"
              ]
            },
            "groupBy": [
              "string"
            ],
            "latest_only": true,
            "limit": 1,
            "orderBy": [
              {
                "column": "column",
                "direction": "ASC",
                "source": "source"
              }
            ]
          }
        }
      ]
    }
  ],
  "total": 0,
  "limit": 0,
  "object": "list"
}
```

## Get Evaluation Dashboard

`client.EvaluationDashboards.Get(ctx, dashboardID, query) (*EvaluationDashboard, error)`

**get** `/v5/evaluation-dashboards/{dashboard_id}`

Fetch a single dashboard by ID within the caller's account.

By default only the dashboard's own fields are returned. Pass `views=widgets`
and/or `views=widget_results` to eagerly load the dashboard's widgets and their
last-computed results as nested relationships; without those views the `widgets`
and `widget_results` fields are omitted from the response entirely. Set
`include_archived=true` to retrieve a soft-deleted dashboard. Returns a not-found
error if no matching dashboard exists in the account.

### Parameters

- `dashboardID string`

- `query EvaluationDashboardGetParams`

  - `IncludeArchived param.Field[bool]`

  - `Views param.Field[[]string]`

    Optional relationships to include: 'widgets', 'widget_results'

    - `const EvaluationDashboardGetParamsViewWidgets EvaluationDashboardGetParamsView = "widgets"`

    - `const EvaluationDashboardGetParamsViewWidgetResults EvaluationDashboardGetParamsView = "widget_results"`

### Returns

- `type EvaluationDashboard struct{…}`

  - `ID string`

    Unique identifier of the dashboard

  - `AccountID string`

    Account that owns this dashboard

  - `CreatedAt Time`

    When the dashboard was created

  - `CreatedBy Identity`

    The identity that created the entity.

    - `ID string`

    - `Type IdentityType`

      - `const IdentityTypeUser IdentityType = "user"`

      - `const IdentityTypeServiceAccount IdentityType = "service_account"`

    - `Object IdentityObject`

      - `const IdentityObjectIdentity IdentityObject = "identity"`

  - `Name string`

    Dashboard name

  - `Tags []string`

    The tags associated with the entity

  - `UpdatedAt Time`

    When the dashboard was last updated

  - `ArchivedAt Time`

    When the dashboard was archived (soft-deleted)

  - `Description string`

    Dashboard description

  - `ErrorMessage string`

    Error message if computation failed

  - `EvaluationGroupID string`

    Evaluation group ID

  - `EvaluationID string`

    Evaluation ID

  - `Object EvaluationDashboardObject`

    - `const EvaluationDashboardObjectEvaluationDashboard EvaluationDashboardObject = "evaluation_dashboard"`

  - `WidgetOrder []string`

    Ordered array of widget IDs

  - `WidgetResults []EvaluationDashboardWidgetResult`

    Widget results for this dashboard. Populated with 'widget_results' view.

    - `ID string`

      Unique identifier of the widget result

    - `AccountID string`

      Account that owns this widget result

    - `ComputationStatus EvaluationDashboardWidgetResultComputationStatus`

      Status of the computation

      - `const EvaluationDashboardWidgetResultComputationStatusPending EvaluationDashboardWidgetResultComputationStatus = "pending"`

      - `const EvaluationDashboardWidgetResultComputationStatusCompleted EvaluationDashboardWidgetResultComputationStatus = "completed"`

      - `const EvaluationDashboardWidgetResultComputationStatusFailed EvaluationDashboardWidgetResultComputationStatus = "failed"`

    - `CreatedAt Time`

      When the widget result was created

    - `WidgetID string`

      Unique identifier of the widget

    - `ComputationJobID string`

      Temporal workflow ID or job ID for async computation tracking

    - `ComputedAt Time`

      Timestamp when computation completed successfully

    - `ComputedResult map[string, any]`

      Cached computation results

    - `ErrorMessage string`

      Error message if computation failed

    - `EvaluationGroupID string`

      FK to evaluation_groups. Null if result is for a single evaluation.

    - `EvaluationID string`

      FK to evaluations. Null if result is for an evaluation group.

    - `Object EvaluationDashboardWidgetResultObject`

      - `const EvaluationDashboardWidgetResultObjectEvaluationDashboardWidgetResult EvaluationDashboardWidgetResultObject = "evaluation_dashboard_widget_result"`

    - `Widget EvaluationDashboardWidget`

      Widget that this result is for

      - `ID string`

        Unique identifier of the widget

      - `AccountID string`

        Account that owns this widget

      - `CreatedAt Time`

        When the widget was created

      - `Title string`

        Widget title

      - `Type EvaluationWidgetTypeEnum`

        Widget type

        - `const EvaluationWidgetTypeEnumBar EvaluationWidgetTypeEnum = "bar"`

        - `const EvaluationWidgetTypeEnumHistogram EvaluationWidgetTypeEnum = "histogram"`

        - `const EvaluationWidgetTypeEnumDonut EvaluationWidgetTypeEnum = "donut"`

        - `const EvaluationWidgetTypeEnumScatter EvaluationWidgetTypeEnum = "scatter"`

        - `const EvaluationWidgetTypeEnumMetric EvaluationWidgetTypeEnum = "metric"`

        - `const EvaluationWidgetTypeEnumTable EvaluationWidgetTypeEnum = "table"`

        - `const EvaluationWidgetTypeEnumMarkdown EvaluationWidgetTypeEnum = "markdown"`

        - `const EvaluationWidgetTypeEnumHeading EvaluationWidgetTypeEnum = "heading"`

        - `const EvaluationWidgetTypeEnumTimeseries EvaluationWidgetTypeEnum = "timeseries"`

      - `ArchivedAt Time`

        When the widget was archived (soft-deleted)

      - `Config map[string, any]`

        Chart-specific display configuration

      - `Object EvaluationDashboardWidgetObject`

        - `const EvaluationDashboardWidgetObjectEvaluationDashboardWidget EvaluationDashboardWidgetObject = "evaluation_dashboard_widget"`

      - `Query EvaluationDashboardWidgetQueryUnion`

        Structured query AST for metric computation (SeriesQuery or MetricQuery)

        - `type SeriesQuery struct{…}`

          Query that returns a series of records (used for table/bar/histogram/donut/scatter widgets).

          Used for widget types: table, bar, histogram, donut, scatter.
          Returns: {"type": "series", "data": [...]}

          Example SQL equivalent:
          SELECT category, AVG(score) as avg_score, COUNT(*) as count
          FROM evaluation_items
          WHERE score > 0.5 AND category = 'test'
          GROUP BY category
          ORDER BY avg_score DESC
          LIMIT 100

          - `Select []SelectItem`

            - `Expression SelectItemExpressionUnion`

              Reference to a column from evaluation_items.data

              Example:
              {"type": "COLUMN", "column": "category"}

              - `type SelectItemExpressionColumn struct{…}`

                Reference to a column from evaluation_items.data

                Example:
                {"type": "COLUMN", "column": "category"}

                - `Column string`

                  Column name from evaluation_items.data

                - `Source string`

                  Column source: 'data' or 'task_result_cache'

                - `Type string`

                  - `const SelectItemExpressionColumnTypeColumn SelectItemExpressionColumnType = "COLUMN"`

              - `type SelectItemExpressionAggregation struct{…}`

                Aggregation function to apply

                Examples:
                {"type": "AGGREGATION", "function": "AVG", "column": "score"}
                {"type": "AGGREGATION", "function": "COUNT", "column": "*"}
                {"type": "AGGREGATION", "function": "PERCENTILE", "column": "score", "params": {"percentile": 95}}

                - `Column string`

                  Column to aggregate, or '*' for COUNT(*)

                - `Function string`

                  Supported aggregation functions

                  - `const SelectItemExpressionAggregationFunctionCount SelectItemExpressionAggregationFunction = "COUNT"`

                  - `const SelectItemExpressionAggregationFunctionSum SelectItemExpressionAggregationFunction = "SUM"`

                  - `const SelectItemExpressionAggregationFunctionAvg SelectItemExpressionAggregationFunction = "AVG"`

                  - `const SelectItemExpressionAggregationFunctionMin SelectItemExpressionAggregationFunction = "MIN"`

                  - `const SelectItemExpressionAggregationFunctionMax SelectItemExpressionAggregationFunction = "MAX"`

                  - `const SelectItemExpressionAggregationFunctionStddev SelectItemExpressionAggregationFunction = "STDDEV"`

                  - `const SelectItemExpressionAggregationFunctionVariance SelectItemExpressionAggregationFunction = "VARIANCE"`

                  - `const SelectItemExpressionAggregationFunctionPercentile SelectItemExpressionAggregationFunction = "PERCENTILE"`

                  - `const SelectItemExpressionAggregationFunctionCountDistinct SelectItemExpressionAggregationFunction = "COUNT_DISTINCT"`

                  - `const SelectItemExpressionAggregationFunctionPercentage SelectItemExpressionAggregationFunction = "PERCENTAGE"`

                - `EvaluationIDs []string`

                  Optional subset of evaluation IDs for per-aggregation filtering in evaluation group dashboards.

                - `Params map[string, any]`

                  Function parameters (e.g., {'percentile': 95} for PERCENTILE, {'percentage_filters': Filter} for PERCENTAGE)

                - `Source string`

                  Column source: 'data' or 'task_result_cache'

                - `Type string`

                  - `const SelectItemExpressionAggregationTypeAggregation SelectItemExpressionAggregationType = "AGGREGATION"`

            - `Alias string`

              Optional alias for the selected item

          - `EvaluationIDs []string`

            Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

          - `Filter Filter`

            Filter conditions (WHERE clause)

            - `Conditions []FilterCondition`

              - `Column string`

                Column name to filter on

              - `Operator string`

                Comparison operator

                - `const FilterConditionOperatorEquals FilterConditionOperator = "="`

                - `const FilterConditionOperatorNotEquals FilterConditionOperator = "!="`

                - `const FilterConditionOperatorGreater FilterConditionOperator = ">"`

                - `const FilterConditionOperatorLess FilterConditionOperator = "<"`

                - `const FilterConditionOperatorGreaterOrEquals FilterConditionOperator = ">="`

                - `const FilterConditionOperatorLessOrEquals FilterConditionOperator = "<="`

                - `const FilterConditionOperatorIn FilterConditionOperator = "IN"`

                - `const FilterConditionOperatorNotIn FilterConditionOperator = "NOT IN"`

                - `const FilterConditionOperatorLike FilterConditionOperator = "LIKE"`

                - `const FilterConditionOperatorNotLike FilterConditionOperator = "NOT LIKE"`

                - `const FilterConditionOperatorIsNull FilterConditionOperator = "IS NULL"`

                - `const FilterConditionOperatorIsNotNull FilterConditionOperator = "IS NOT NULL"`

              - `Source string`

                Column source: 'data' or 'task_result_cache'

              - `Value FilterConditionValueUnion`

                Value to compare against. Not required for IS NULL / IS NOT NULL operators.

                - `string`

                - `float64`

                - `bool`

                - `type FilterConditionValueArray []any`

            - `LogicalOperators []string`

              Logical operators connecting conditions. Length must be len(conditions) - 1

              - `const FilterLogicalOperatorAnd FilterLogicalOperator = "AND"`

              - `const FilterLogicalOperatorOr FilterLogicalOperator = "OR"`

          - `GroupBy []string`

            Columns to group by

          - `LatestOnly bool`

            When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

          - `Limit int64`

            Max rows to return

          - `OrderBy []SeriesQueryOrderBy`

            Sort order

            - `Column string`

              Column name to sort by

            - `Direction string`

              Sort direction

              - `const SeriesQueryOrderByDirectionAsc SeriesQueryOrderByDirection = "ASC"`

              - `const SeriesQueryOrderByDirectionDesc SeriesQueryOrderByDirection = "DESC"`

            - `Source string`

              Column source: 'data' or 'task_result_cache'

        - `type MetricQuery struct{…}`

          Query that returns a single metric value (used for metric widgets).

          Used for widget type: metric.
          Enforces exactly 1 aggregation in select.
          Returns: {"type": "metric", "data": ...}

          Example SQL equivalent:
          SELECT AVG(score) as average_score
          FROM evaluation_items

          - `Select []SelectItem`

            - `Expression SelectItemExpressionUnion`

              Reference to a column from evaluation_items.data

              Example:
              {"type": "COLUMN", "column": "category"}

            - `Alias string`

              Optional alias for the selected item

          - `EvaluationIDs []string`

            Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

          - `Filter Filter`

            Filter conditions (WHERE clause)

          - `LatestOnly bool`

            When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

  - `Widgets []EvaluationDashboardWidget`

    Widgets associated with this dashboard. Populated with 'widgets' view.

    - `ID string`

      Unique identifier of the widget

    - `AccountID string`

      Account that owns this widget

    - `CreatedAt Time`

      When the widget was created

    - `Title string`

      Widget title

    - `Type EvaluationWidgetTypeEnum`

      Widget type

    - `ArchivedAt Time`

      When the widget was archived (soft-deleted)

    - `Config map[string, any]`

      Chart-specific display configuration

    - `Object EvaluationDashboardWidgetObject`

    - `Query EvaluationDashboardWidgetQueryUnion`

      Structured query AST for metric computation (SeriesQuery or MetricQuery)

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/scaleapi/sgp-dev-go"
  "github.com/scaleapi/sgp-dev-go/option"
)

func main() {
  client := sgpdev.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithAccountID("My Account ID"),
  )
  evaluationDashboard, err := client.EvaluationDashboards.Get(
    context.TODO(),
    "dashboard_id",
    sgpdev.EvaluationDashboardGetParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", evaluationDashboard.ID)
}
```

#### Response

```json
{
  "id": "id",
  "account_id": "account_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": {
    "id": "id",
    "type": "user",
    "object": "identity"
  },
  "name": "name",
  "tags": [
    "string"
  ],
  "updated_at": "2019-12-27T18:11:19.117Z",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "error_message": "error_message",
  "evaluation_group_id": "evaluation_group_id",
  "evaluation_id": "evaluation_id",
  "object": "evaluation_dashboard",
  "widget_order": [
    "string"
  ],
  "widget_results": [
    {
      "id": "id",
      "account_id": "account_id",
      "computation_status": "pending",
      "created_at": "2019-12-27T18:11:19.117Z",
      "widget_id": "widget_id",
      "computation_job_id": "computation_job_id",
      "computed_at": "2019-12-27T18:11:19.117Z",
      "computed_result": {
        "foo": "bar"
      },
      "error_message": "error_message",
      "evaluation_group_id": "evaluation_group_id",
      "evaluation_id": "evaluation_id",
      "object": "evaluation_dashboard_widget_result",
      "widget": {
        "id": "id",
        "account_id": "account_id",
        "created_at": "2019-12-27T18:11:19.117Z",
        "title": "title",
        "type": "bar",
        "archived_at": "2019-12-27T18:11:19.117Z",
        "config": {
          "foo": "bar"
        },
        "object": "evaluation_dashboard_widget",
        "query": {
          "select": [
            {
              "expression": {
                "column": "column",
                "source": "source",
                "type": "COLUMN"
              },
              "alias": "alias"
            }
          ],
          "evaluation_ids": [
            "string"
          ],
          "filter": {
            "conditions": [
              {
                "column": "column",
                "operator": "=",
                "source": "source",
                "value": "string"
              }
            ],
            "logicalOperators": [
              "AND"
            ]
          },
          "groupBy": [
            "string"
          ],
          "latest_only": true,
          "limit": 1,
          "orderBy": [
            {
              "column": "column",
              "direction": "ASC",
              "source": "source"
            }
          ]
        }
      }
    }
  ],
  "widgets": [
    {
      "id": "id",
      "account_id": "account_id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "title": "title",
      "type": "bar",
      "archived_at": "2019-12-27T18:11:19.117Z",
      "config": {
        "foo": "bar"
      },
      "object": "evaluation_dashboard_widget",
      "query": {
        "select": [
          {
            "expression": {
              "column": "column",
              "source": "source",
              "type": "COLUMN"
            },
            "alias": "alias"
          }
        ],
        "evaluation_ids": [
          "string"
        ],
        "filter": {
          "conditions": [
            {
              "column": "column",
              "operator": "=",
              "source": "source",
              "value": "string"
            }
          ],
          "logicalOperators": [
            "AND"
          ]
        },
        "groupBy": [
          "string"
        ],
        "latest_only": true,
        "limit": 1,
        "orderBy": [
          {
            "column": "column",
            "direction": "ASC",
            "source": "source"
          }
        ]
      }
    }
  ]
}
```

## Patch Evaluation Dashboard

`client.EvaluationDashboards.Update(ctx, dashboardID, body) (*EvaluationDashboard, error)`

**patch** `/v5/evaluation-dashboards/{dashboard_id}`

Partially update a dashboard's `name`, `description`, `tags`, or `widget_order`.

Only these mutable fields can change — the dashboard's bound evaluation or group is
fixed at creation and cannot be reassigned here, and unset fields are left untouched
(partial-update semantics). Reorder existing widgets by sending a new `widget_order`,
whose entries are validated to be existing, non-duplicate widget IDs before the
update is applied; creating and attaching new widgets is done through the widget
sub-endpoints, not by editing `widget_order`. Archived dashboards cannot be updated
and return a not-found error.

### Parameters

- `dashboardID string`

- `body EvaluationDashboardUpdateParams`

  - `Description param.Field[string]`

    Dashboard description

  - `Name param.Field[string]`

    Dashboard name

  - `Tags param.Field[[]string]`

    The tags associated with the entity

  - `WidgetOrder param.Field[[]string]`

    Ordered array of widget IDs (for reordering widgets)

### Returns

- `type EvaluationDashboard struct{…}`

  - `ID string`

    Unique identifier of the dashboard

  - `AccountID string`

    Account that owns this dashboard

  - `CreatedAt Time`

    When the dashboard was created

  - `CreatedBy Identity`

    The identity that created the entity.

    - `ID string`

    - `Type IdentityType`

      - `const IdentityTypeUser IdentityType = "user"`

      - `const IdentityTypeServiceAccount IdentityType = "service_account"`

    - `Object IdentityObject`

      - `const IdentityObjectIdentity IdentityObject = "identity"`

  - `Name string`

    Dashboard name

  - `Tags []string`

    The tags associated with the entity

  - `UpdatedAt Time`

    When the dashboard was last updated

  - `ArchivedAt Time`

    When the dashboard was archived (soft-deleted)

  - `Description string`

    Dashboard description

  - `ErrorMessage string`

    Error message if computation failed

  - `EvaluationGroupID string`

    Evaluation group ID

  - `EvaluationID string`

    Evaluation ID

  - `Object EvaluationDashboardObject`

    - `const EvaluationDashboardObjectEvaluationDashboard EvaluationDashboardObject = "evaluation_dashboard"`

  - `WidgetOrder []string`

    Ordered array of widget IDs

  - `WidgetResults []EvaluationDashboardWidgetResult`

    Widget results for this dashboard. Populated with 'widget_results' view.

    - `ID string`

      Unique identifier of the widget result

    - `AccountID string`

      Account that owns this widget result

    - `ComputationStatus EvaluationDashboardWidgetResultComputationStatus`

      Status of the computation

      - `const EvaluationDashboardWidgetResultComputationStatusPending EvaluationDashboardWidgetResultComputationStatus = "pending"`

      - `const EvaluationDashboardWidgetResultComputationStatusCompleted EvaluationDashboardWidgetResultComputationStatus = "completed"`

      - `const EvaluationDashboardWidgetResultComputationStatusFailed EvaluationDashboardWidgetResultComputationStatus = "failed"`

    - `CreatedAt Time`

      When the widget result was created

    - `WidgetID string`

      Unique identifier of the widget

    - `ComputationJobID string`

      Temporal workflow ID or job ID for async computation tracking

    - `ComputedAt Time`

      Timestamp when computation completed successfully

    - `ComputedResult map[string, any]`

      Cached computation results

    - `ErrorMessage string`

      Error message if computation failed

    - `EvaluationGroupID string`

      FK to evaluation_groups. Null if result is for a single evaluation.

    - `EvaluationID string`

      FK to evaluations. Null if result is for an evaluation group.

    - `Object EvaluationDashboardWidgetResultObject`

      - `const EvaluationDashboardWidgetResultObjectEvaluationDashboardWidgetResult EvaluationDashboardWidgetResultObject = "evaluation_dashboard_widget_result"`

    - `Widget EvaluationDashboardWidget`

      Widget that this result is for

      - `ID string`

        Unique identifier of the widget

      - `AccountID string`

        Account that owns this widget

      - `CreatedAt Time`

        When the widget was created

      - `Title string`

        Widget title

      - `Type EvaluationWidgetTypeEnum`

        Widget type

        - `const EvaluationWidgetTypeEnumBar EvaluationWidgetTypeEnum = "bar"`

        - `const EvaluationWidgetTypeEnumHistogram EvaluationWidgetTypeEnum = "histogram"`

        - `const EvaluationWidgetTypeEnumDonut EvaluationWidgetTypeEnum = "donut"`

        - `const EvaluationWidgetTypeEnumScatter EvaluationWidgetTypeEnum = "scatter"`

        - `const EvaluationWidgetTypeEnumMetric EvaluationWidgetTypeEnum = "metric"`

        - `const EvaluationWidgetTypeEnumTable EvaluationWidgetTypeEnum = "table"`

        - `const EvaluationWidgetTypeEnumMarkdown EvaluationWidgetTypeEnum = "markdown"`

        - `const EvaluationWidgetTypeEnumHeading EvaluationWidgetTypeEnum = "heading"`

        - `const EvaluationWidgetTypeEnumTimeseries EvaluationWidgetTypeEnum = "timeseries"`

      - `ArchivedAt Time`

        When the widget was archived (soft-deleted)

      - `Config map[string, any]`

        Chart-specific display configuration

      - `Object EvaluationDashboardWidgetObject`

        - `const EvaluationDashboardWidgetObjectEvaluationDashboardWidget EvaluationDashboardWidgetObject = "evaluation_dashboard_widget"`

      - `Query EvaluationDashboardWidgetQueryUnion`

        Structured query AST for metric computation (SeriesQuery or MetricQuery)

        - `type SeriesQuery struct{…}`

          Query that returns a series of records (used for table/bar/histogram/donut/scatter widgets).

          Used for widget types: table, bar, histogram, donut, scatter.
          Returns: {"type": "series", "data": [...]}

          Example SQL equivalent:
          SELECT category, AVG(score) as avg_score, COUNT(*) as count
          FROM evaluation_items
          WHERE score > 0.5 AND category = 'test'
          GROUP BY category
          ORDER BY avg_score DESC
          LIMIT 100

          - `Select []SelectItem`

            - `Expression SelectItemExpressionUnion`

              Reference to a column from evaluation_items.data

              Example:
              {"type": "COLUMN", "column": "category"}

              - `type SelectItemExpressionColumn struct{…}`

                Reference to a column from evaluation_items.data

                Example:
                {"type": "COLUMN", "column": "category"}

                - `Column string`

                  Column name from evaluation_items.data

                - `Source string`

                  Column source: 'data' or 'task_result_cache'

                - `Type string`

                  - `const SelectItemExpressionColumnTypeColumn SelectItemExpressionColumnType = "COLUMN"`

              - `type SelectItemExpressionAggregation struct{…}`

                Aggregation function to apply

                Examples:
                {"type": "AGGREGATION", "function": "AVG", "column": "score"}
                {"type": "AGGREGATION", "function": "COUNT", "column": "*"}
                {"type": "AGGREGATION", "function": "PERCENTILE", "column": "score", "params": {"percentile": 95}}

                - `Column string`

                  Column to aggregate, or '*' for COUNT(*)

                - `Function string`

                  Supported aggregation functions

                  - `const SelectItemExpressionAggregationFunctionCount SelectItemExpressionAggregationFunction = "COUNT"`

                  - `const SelectItemExpressionAggregationFunctionSum SelectItemExpressionAggregationFunction = "SUM"`

                  - `const SelectItemExpressionAggregationFunctionAvg SelectItemExpressionAggregationFunction = "AVG"`

                  - `const SelectItemExpressionAggregationFunctionMin SelectItemExpressionAggregationFunction = "MIN"`

                  - `const SelectItemExpressionAggregationFunctionMax SelectItemExpressionAggregationFunction = "MAX"`

                  - `const SelectItemExpressionAggregationFunctionStddev SelectItemExpressionAggregationFunction = "STDDEV"`

                  - `const SelectItemExpressionAggregationFunctionVariance SelectItemExpressionAggregationFunction = "VARIANCE"`

                  - `const SelectItemExpressionAggregationFunctionPercentile SelectItemExpressionAggregationFunction = "PERCENTILE"`

                  - `const SelectItemExpressionAggregationFunctionCountDistinct SelectItemExpressionAggregationFunction = "COUNT_DISTINCT"`

                  - `const SelectItemExpressionAggregationFunctionPercentage SelectItemExpressionAggregationFunction = "PERCENTAGE"`

                - `EvaluationIDs []string`

                  Optional subset of evaluation IDs for per-aggregation filtering in evaluation group dashboards.

                - `Params map[string, any]`

                  Function parameters (e.g., {'percentile': 95} for PERCENTILE, {'percentage_filters': Filter} for PERCENTAGE)

                - `Source string`

                  Column source: 'data' or 'task_result_cache'

                - `Type string`

                  - `const SelectItemExpressionAggregationTypeAggregation SelectItemExpressionAggregationType = "AGGREGATION"`

            - `Alias string`

              Optional alias for the selected item

          - `EvaluationIDs []string`

            Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

          - `Filter Filter`

            Filter conditions (WHERE clause)

            - `Conditions []FilterCondition`

              - `Column string`

                Column name to filter on

              - `Operator string`

                Comparison operator

                - `const FilterConditionOperatorEquals FilterConditionOperator = "="`

                - `const FilterConditionOperatorNotEquals FilterConditionOperator = "!="`

                - `const FilterConditionOperatorGreater FilterConditionOperator = ">"`

                - `const FilterConditionOperatorLess FilterConditionOperator = "<"`

                - `const FilterConditionOperatorGreaterOrEquals FilterConditionOperator = ">="`

                - `const FilterConditionOperatorLessOrEquals FilterConditionOperator = "<="`

                - `const FilterConditionOperatorIn FilterConditionOperator = "IN"`

                - `const FilterConditionOperatorNotIn FilterConditionOperator = "NOT IN"`

                - `const FilterConditionOperatorLike FilterConditionOperator = "LIKE"`

                - `const FilterConditionOperatorNotLike FilterConditionOperator = "NOT LIKE"`

                - `const FilterConditionOperatorIsNull FilterConditionOperator = "IS NULL"`

                - `const FilterConditionOperatorIsNotNull FilterConditionOperator = "IS NOT NULL"`

              - `Source string`

                Column source: 'data' or 'task_result_cache'

              - `Value FilterConditionValueUnion`

                Value to compare against. Not required for IS NULL / IS NOT NULL operators.

                - `string`

                - `float64`

                - `bool`

                - `type FilterConditionValueArray []any`

            - `LogicalOperators []string`

              Logical operators connecting conditions. Length must be len(conditions) - 1

              - `const FilterLogicalOperatorAnd FilterLogicalOperator = "AND"`

              - `const FilterLogicalOperatorOr FilterLogicalOperator = "OR"`

          - `GroupBy []string`

            Columns to group by

          - `LatestOnly bool`

            When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

          - `Limit int64`

            Max rows to return

          - `OrderBy []SeriesQueryOrderBy`

            Sort order

            - `Column string`

              Column name to sort by

            - `Direction string`

              Sort direction

              - `const SeriesQueryOrderByDirectionAsc SeriesQueryOrderByDirection = "ASC"`

              - `const SeriesQueryOrderByDirectionDesc SeriesQueryOrderByDirection = "DESC"`

            - `Source string`

              Column source: 'data' or 'task_result_cache'

        - `type MetricQuery struct{…}`

          Query that returns a single metric value (used for metric widgets).

          Used for widget type: metric.
          Enforces exactly 1 aggregation in select.
          Returns: {"type": "metric", "data": ...}

          Example SQL equivalent:
          SELECT AVG(score) as average_score
          FROM evaluation_items

          - `Select []SelectItem`

            - `Expression SelectItemExpressionUnion`

              Reference to a column from evaluation_items.data

              Example:
              {"type": "COLUMN", "column": "category"}

            - `Alias string`

              Optional alias for the selected item

          - `EvaluationIDs []string`

            Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

          - `Filter Filter`

            Filter conditions (WHERE clause)

          - `LatestOnly bool`

            When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

  - `Widgets []EvaluationDashboardWidget`

    Widgets associated with this dashboard. Populated with 'widgets' view.

    - `ID string`

      Unique identifier of the widget

    - `AccountID string`

      Account that owns this widget

    - `CreatedAt Time`

      When the widget was created

    - `Title string`

      Widget title

    - `Type EvaluationWidgetTypeEnum`

      Widget type

    - `ArchivedAt Time`

      When the widget was archived (soft-deleted)

    - `Config map[string, any]`

      Chart-specific display configuration

    - `Object EvaluationDashboardWidgetObject`

    - `Query EvaluationDashboardWidgetQueryUnion`

      Structured query AST for metric computation (SeriesQuery or MetricQuery)

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/scaleapi/sgp-dev-go"
  "github.com/scaleapi/sgp-dev-go/option"
)

func main() {
  client := sgpdev.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithAccountID("My Account ID"),
  )
  evaluationDashboard, err := client.EvaluationDashboards.Update(
    context.TODO(),
    "dashboard_id",
    sgpdev.EvaluationDashboardUpdateParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", evaluationDashboard.ID)
}
```

#### Response

```json
{
  "id": "id",
  "account_id": "account_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": {
    "id": "id",
    "type": "user",
    "object": "identity"
  },
  "name": "name",
  "tags": [
    "string"
  ],
  "updated_at": "2019-12-27T18:11:19.117Z",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "error_message": "error_message",
  "evaluation_group_id": "evaluation_group_id",
  "evaluation_id": "evaluation_id",
  "object": "evaluation_dashboard",
  "widget_order": [
    "string"
  ],
  "widget_results": [
    {
      "id": "id",
      "account_id": "account_id",
      "computation_status": "pending",
      "created_at": "2019-12-27T18:11:19.117Z",
      "widget_id": "widget_id",
      "computation_job_id": "computation_job_id",
      "computed_at": "2019-12-27T18:11:19.117Z",
      "computed_result": {
        "foo": "bar"
      },
      "error_message": "error_message",
      "evaluation_group_id": "evaluation_group_id",
      "evaluation_id": "evaluation_id",
      "object": "evaluation_dashboard_widget_result",
      "widget": {
        "id": "id",
        "account_id": "account_id",
        "created_at": "2019-12-27T18:11:19.117Z",
        "title": "title",
        "type": "bar",
        "archived_at": "2019-12-27T18:11:19.117Z",
        "config": {
          "foo": "bar"
        },
        "object": "evaluation_dashboard_widget",
        "query": {
          "select": [
            {
              "expression": {
                "column": "column",
                "source": "source",
                "type": "COLUMN"
              },
              "alias": "alias"
            }
          ],
          "evaluation_ids": [
            "string"
          ],
          "filter": {
            "conditions": [
              {
                "column": "column",
                "operator": "=",
                "source": "source",
                "value": "string"
              }
            ],
            "logicalOperators": [
              "AND"
            ]
          },
          "groupBy": [
            "string"
          ],
          "latest_only": true,
          "limit": 1,
          "orderBy": [
            {
              "column": "column",
              "direction": "ASC",
              "source": "source"
            }
          ]
        }
      }
    }
  ],
  "widgets": [
    {
      "id": "id",
      "account_id": "account_id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "title": "title",
      "type": "bar",
      "archived_at": "2019-12-27T18:11:19.117Z",
      "config": {
        "foo": "bar"
      },
      "object": "evaluation_dashboard_widget",
      "query": {
        "select": [
          {
            "expression": {
              "column": "column",
              "source": "source",
              "type": "COLUMN"
            },
            "alias": "alias"
          }
        ],
        "evaluation_ids": [
          "string"
        ],
        "filter": {
          "conditions": [
            {
              "column": "column",
              "operator": "=",
              "source": "source",
              "value": "string"
            }
          ],
          "logicalOperators": [
            "AND"
          ]
        },
        "groupBy": [
          "string"
        ],
        "latest_only": true,
        "limit": 1,
        "orderBy": [
          {
            "column": "column",
            "direction": "ASC",
            "source": "source"
          }
        ]
      }
    }
  ]
}
```

## Delete Evaluation Dashboard

`client.EvaluationDashboards.Archive(ctx, dashboardID) (*EvaluationDashboard, error)`

**delete** `/v5/evaluation-dashboards/{dashboard_id}`

Soft-delete a dashboard by setting its archived timestamp.

The dashboard row is retained and marked archived rather than physically removed, so
it stops appearing in default listings but can still be fetched with
`include_archived=true`; the archived dashboard is returned by this call. Associated
widgets and widget results are not deleted or detached. Returns a not-found error if
the dashboard does not exist in the caller's account.

### Parameters

- `dashboardID string`

### Returns

- `type EvaluationDashboard struct{…}`

  - `ID string`

    Unique identifier of the dashboard

  - `AccountID string`

    Account that owns this dashboard

  - `CreatedAt Time`

    When the dashboard was created

  - `CreatedBy Identity`

    The identity that created the entity.

    - `ID string`

    - `Type IdentityType`

      - `const IdentityTypeUser IdentityType = "user"`

      - `const IdentityTypeServiceAccount IdentityType = "service_account"`

    - `Object IdentityObject`

      - `const IdentityObjectIdentity IdentityObject = "identity"`

  - `Name string`

    Dashboard name

  - `Tags []string`

    The tags associated with the entity

  - `UpdatedAt Time`

    When the dashboard was last updated

  - `ArchivedAt Time`

    When the dashboard was archived (soft-deleted)

  - `Description string`

    Dashboard description

  - `ErrorMessage string`

    Error message if computation failed

  - `EvaluationGroupID string`

    Evaluation group ID

  - `EvaluationID string`

    Evaluation ID

  - `Object EvaluationDashboardObject`

    - `const EvaluationDashboardObjectEvaluationDashboard EvaluationDashboardObject = "evaluation_dashboard"`

  - `WidgetOrder []string`

    Ordered array of widget IDs

  - `WidgetResults []EvaluationDashboardWidgetResult`

    Widget results for this dashboard. Populated with 'widget_results' view.

    - `ID string`

      Unique identifier of the widget result

    - `AccountID string`

      Account that owns this widget result

    - `ComputationStatus EvaluationDashboardWidgetResultComputationStatus`

      Status of the computation

      - `const EvaluationDashboardWidgetResultComputationStatusPending EvaluationDashboardWidgetResultComputationStatus = "pending"`

      - `const EvaluationDashboardWidgetResultComputationStatusCompleted EvaluationDashboardWidgetResultComputationStatus = "completed"`

      - `const EvaluationDashboardWidgetResultComputationStatusFailed EvaluationDashboardWidgetResultComputationStatus = "failed"`

    - `CreatedAt Time`

      When the widget result was created

    - `WidgetID string`

      Unique identifier of the widget

    - `ComputationJobID string`

      Temporal workflow ID or job ID for async computation tracking

    - `ComputedAt Time`

      Timestamp when computation completed successfully

    - `ComputedResult map[string, any]`

      Cached computation results

    - `ErrorMessage string`

      Error message if computation failed

    - `EvaluationGroupID string`

      FK to evaluation_groups. Null if result is for a single evaluation.

    - `EvaluationID string`

      FK to evaluations. Null if result is for an evaluation group.

    - `Object EvaluationDashboardWidgetResultObject`

      - `const EvaluationDashboardWidgetResultObjectEvaluationDashboardWidgetResult EvaluationDashboardWidgetResultObject = "evaluation_dashboard_widget_result"`

    - `Widget EvaluationDashboardWidget`

      Widget that this result is for

      - `ID string`

        Unique identifier of the widget

      - `AccountID string`

        Account that owns this widget

      - `CreatedAt Time`

        When the widget was created

      - `Title string`

        Widget title

      - `Type EvaluationWidgetTypeEnum`

        Widget type

        - `const EvaluationWidgetTypeEnumBar EvaluationWidgetTypeEnum = "bar"`

        - `const EvaluationWidgetTypeEnumHistogram EvaluationWidgetTypeEnum = "histogram"`

        - `const EvaluationWidgetTypeEnumDonut EvaluationWidgetTypeEnum = "donut"`

        - `const EvaluationWidgetTypeEnumScatter EvaluationWidgetTypeEnum = "scatter"`

        - `const EvaluationWidgetTypeEnumMetric EvaluationWidgetTypeEnum = "metric"`

        - `const EvaluationWidgetTypeEnumTable EvaluationWidgetTypeEnum = "table"`

        - `const EvaluationWidgetTypeEnumMarkdown EvaluationWidgetTypeEnum = "markdown"`

        - `const EvaluationWidgetTypeEnumHeading EvaluationWidgetTypeEnum = "heading"`

        - `const EvaluationWidgetTypeEnumTimeseries EvaluationWidgetTypeEnum = "timeseries"`

      - `ArchivedAt Time`

        When the widget was archived (soft-deleted)

      - `Config map[string, any]`

        Chart-specific display configuration

      - `Object EvaluationDashboardWidgetObject`

        - `const EvaluationDashboardWidgetObjectEvaluationDashboardWidget EvaluationDashboardWidgetObject = "evaluation_dashboard_widget"`

      - `Query EvaluationDashboardWidgetQueryUnion`

        Structured query AST for metric computation (SeriesQuery or MetricQuery)

        - `type SeriesQuery struct{…}`

          Query that returns a series of records (used for table/bar/histogram/donut/scatter widgets).

          Used for widget types: table, bar, histogram, donut, scatter.
          Returns: {"type": "series", "data": [...]}

          Example SQL equivalent:
          SELECT category, AVG(score) as avg_score, COUNT(*) as count
          FROM evaluation_items
          WHERE score > 0.5 AND category = 'test'
          GROUP BY category
          ORDER BY avg_score DESC
          LIMIT 100

          - `Select []SelectItem`

            - `Expression SelectItemExpressionUnion`

              Reference to a column from evaluation_items.data

              Example:
              {"type": "COLUMN", "column": "category"}

              - `type SelectItemExpressionColumn struct{…}`

                Reference to a column from evaluation_items.data

                Example:
                {"type": "COLUMN", "column": "category"}

                - `Column string`

                  Column name from evaluation_items.data

                - `Source string`

                  Column source: 'data' or 'task_result_cache'

                - `Type string`

                  - `const SelectItemExpressionColumnTypeColumn SelectItemExpressionColumnType = "COLUMN"`

              - `type SelectItemExpressionAggregation struct{…}`

                Aggregation function to apply

                Examples:
                {"type": "AGGREGATION", "function": "AVG", "column": "score"}
                {"type": "AGGREGATION", "function": "COUNT", "column": "*"}
                {"type": "AGGREGATION", "function": "PERCENTILE", "column": "score", "params": {"percentile": 95}}

                - `Column string`

                  Column to aggregate, or '*' for COUNT(*)

                - `Function string`

                  Supported aggregation functions

                  - `const SelectItemExpressionAggregationFunctionCount SelectItemExpressionAggregationFunction = "COUNT"`

                  - `const SelectItemExpressionAggregationFunctionSum SelectItemExpressionAggregationFunction = "SUM"`

                  - `const SelectItemExpressionAggregationFunctionAvg SelectItemExpressionAggregationFunction = "AVG"`

                  - `const SelectItemExpressionAggregationFunctionMin SelectItemExpressionAggregationFunction = "MIN"`

                  - `const SelectItemExpressionAggregationFunctionMax SelectItemExpressionAggregationFunction = "MAX"`

                  - `const SelectItemExpressionAggregationFunctionStddev SelectItemExpressionAggregationFunction = "STDDEV"`

                  - `const SelectItemExpressionAggregationFunctionVariance SelectItemExpressionAggregationFunction = "VARIANCE"`

                  - `const SelectItemExpressionAggregationFunctionPercentile SelectItemExpressionAggregationFunction = "PERCENTILE"`

                  - `const SelectItemExpressionAggregationFunctionCountDistinct SelectItemExpressionAggregationFunction = "COUNT_DISTINCT"`

                  - `const SelectItemExpressionAggregationFunctionPercentage SelectItemExpressionAggregationFunction = "PERCENTAGE"`

                - `EvaluationIDs []string`

                  Optional subset of evaluation IDs for per-aggregation filtering in evaluation group dashboards.

                - `Params map[string, any]`

                  Function parameters (e.g., {'percentile': 95} for PERCENTILE, {'percentage_filters': Filter} for PERCENTAGE)

                - `Source string`

                  Column source: 'data' or 'task_result_cache'

                - `Type string`

                  - `const SelectItemExpressionAggregationTypeAggregation SelectItemExpressionAggregationType = "AGGREGATION"`

            - `Alias string`

              Optional alias for the selected item

          - `EvaluationIDs []string`

            Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

          - `Filter Filter`

            Filter conditions (WHERE clause)

            - `Conditions []FilterCondition`

              - `Column string`

                Column name to filter on

              - `Operator string`

                Comparison operator

                - `const FilterConditionOperatorEquals FilterConditionOperator = "="`

                - `const FilterConditionOperatorNotEquals FilterConditionOperator = "!="`

                - `const FilterConditionOperatorGreater FilterConditionOperator = ">"`

                - `const FilterConditionOperatorLess FilterConditionOperator = "<"`

                - `const FilterConditionOperatorGreaterOrEquals FilterConditionOperator = ">="`

                - `const FilterConditionOperatorLessOrEquals FilterConditionOperator = "<="`

                - `const FilterConditionOperatorIn FilterConditionOperator = "IN"`

                - `const FilterConditionOperatorNotIn FilterConditionOperator = "NOT IN"`

                - `const FilterConditionOperatorLike FilterConditionOperator = "LIKE"`

                - `const FilterConditionOperatorNotLike FilterConditionOperator = "NOT LIKE"`

                - `const FilterConditionOperatorIsNull FilterConditionOperator = "IS NULL"`

                - `const FilterConditionOperatorIsNotNull FilterConditionOperator = "IS NOT NULL"`

              - `Source string`

                Column source: 'data' or 'task_result_cache'

              - `Value FilterConditionValueUnion`

                Value to compare against. Not required for IS NULL / IS NOT NULL operators.

                - `string`

                - `float64`

                - `bool`

                - `type FilterConditionValueArray []any`

            - `LogicalOperators []string`

              Logical operators connecting conditions. Length must be len(conditions) - 1

              - `const FilterLogicalOperatorAnd FilterLogicalOperator = "AND"`

              - `const FilterLogicalOperatorOr FilterLogicalOperator = "OR"`

          - `GroupBy []string`

            Columns to group by

          - `LatestOnly bool`

            When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

          - `Limit int64`

            Max rows to return

          - `OrderBy []SeriesQueryOrderBy`

            Sort order

            - `Column string`

              Column name to sort by

            - `Direction string`

              Sort direction

              - `const SeriesQueryOrderByDirectionAsc SeriesQueryOrderByDirection = "ASC"`

              - `const SeriesQueryOrderByDirectionDesc SeriesQueryOrderByDirection = "DESC"`

            - `Source string`

              Column source: 'data' or 'task_result_cache'

        - `type MetricQuery struct{…}`

          Query that returns a single metric value (used for metric widgets).

          Used for widget type: metric.
          Enforces exactly 1 aggregation in select.
          Returns: {"type": "metric", "data": ...}

          Example SQL equivalent:
          SELECT AVG(score) as average_score
          FROM evaluation_items

          - `Select []SelectItem`

            - `Expression SelectItemExpressionUnion`

              Reference to a column from evaluation_items.data

              Example:
              {"type": "COLUMN", "column": "category"}

            - `Alias string`

              Optional alias for the selected item

          - `EvaluationIDs []string`

            Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

          - `Filter Filter`

            Filter conditions (WHERE clause)

          - `LatestOnly bool`

            When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

  - `Widgets []EvaluationDashboardWidget`

    Widgets associated with this dashboard. Populated with 'widgets' view.

    - `ID string`

      Unique identifier of the widget

    - `AccountID string`

      Account that owns this widget

    - `CreatedAt Time`

      When the widget was created

    - `Title string`

      Widget title

    - `Type EvaluationWidgetTypeEnum`

      Widget type

    - `ArchivedAt Time`

      When the widget was archived (soft-deleted)

    - `Config map[string, any]`

      Chart-specific display configuration

    - `Object EvaluationDashboardWidgetObject`

    - `Query EvaluationDashboardWidgetQueryUnion`

      Structured query AST for metric computation (SeriesQuery or MetricQuery)

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/scaleapi/sgp-dev-go"
  "github.com/scaleapi/sgp-dev-go/option"
)

func main() {
  client := sgpdev.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithAccountID("My Account ID"),
  )
  evaluationDashboard, err := client.EvaluationDashboards.Archive(context.TODO(), "dashboard_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", evaluationDashboard.ID)
}
```

#### Response

```json
{
  "id": "id",
  "account_id": "account_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": {
    "id": "id",
    "type": "user",
    "object": "identity"
  },
  "name": "name",
  "tags": [
    "string"
  ],
  "updated_at": "2019-12-27T18:11:19.117Z",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "error_message": "error_message",
  "evaluation_group_id": "evaluation_group_id",
  "evaluation_id": "evaluation_id",
  "object": "evaluation_dashboard",
  "widget_order": [
    "string"
  ],
  "widget_results": [
    {
      "id": "id",
      "account_id": "account_id",
      "computation_status": "pending",
      "created_at": "2019-12-27T18:11:19.117Z",
      "widget_id": "widget_id",
      "computation_job_id": "computation_job_id",
      "computed_at": "2019-12-27T18:11:19.117Z",
      "computed_result": {
        "foo": "bar"
      },
      "error_message": "error_message",
      "evaluation_group_id": "evaluation_group_id",
      "evaluation_id": "evaluation_id",
      "object": "evaluation_dashboard_widget_result",
      "widget": {
        "id": "id",
        "account_id": "account_id",
        "created_at": "2019-12-27T18:11:19.117Z",
        "title": "title",
        "type": "bar",
        "archived_at": "2019-12-27T18:11:19.117Z",
        "config": {
          "foo": "bar"
        },
        "object": "evaluation_dashboard_widget",
        "query": {
          "select": [
            {
              "expression": {
                "column": "column",
                "source": "source",
                "type": "COLUMN"
              },
              "alias": "alias"
            }
          ],
          "evaluation_ids": [
            "string"
          ],
          "filter": {
            "conditions": [
              {
                "column": "column",
                "operator": "=",
                "source": "source",
                "value": "string"
              }
            ],
            "logicalOperators": [
              "AND"
            ]
          },
          "groupBy": [
            "string"
          ],
          "latest_only": true,
          "limit": 1,
          "orderBy": [
            {
              "column": "column",
              "direction": "ASC",
              "source": "source"
            }
          ]
        }
      }
    }
  ],
  "widgets": [
    {
      "id": "id",
      "account_id": "account_id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "title": "title",
      "type": "bar",
      "archived_at": "2019-12-27T18:11:19.117Z",
      "config": {
        "foo": "bar"
      },
      "object": "evaluation_dashboard_widget",
      "query": {
        "select": [
          {
            "expression": {
              "column": "column",
              "source": "source",
              "type": "COLUMN"
            },
            "alias": "alias"
          }
        ],
        "evaluation_ids": [
          "string"
        ],
        "filter": {
          "conditions": [
            {
              "column": "column",
              "operator": "=",
              "source": "source",
              "value": "string"
            }
          ],
          "logicalOperators": [
            "AND"
          ]
        },
        "groupBy": [
          "string"
        ],
        "latest_only": true,
        "limit": 1,
        "orderBy": [
          {
            "column": "column",
            "direction": "ASC",
            "source": "source"
          }
        ]
      }
    }
  ]
}
```

## Domain Types

### Evaluation Dashboard

- `type EvaluationDashboard struct{…}`

  - `ID string`

    Unique identifier of the dashboard

  - `AccountID string`

    Account that owns this dashboard

  - `CreatedAt Time`

    When the dashboard was created

  - `CreatedBy Identity`

    The identity that created the entity.

    - `ID string`

    - `Type IdentityType`

      - `const IdentityTypeUser IdentityType = "user"`

      - `const IdentityTypeServiceAccount IdentityType = "service_account"`

    - `Object IdentityObject`

      - `const IdentityObjectIdentity IdentityObject = "identity"`

  - `Name string`

    Dashboard name

  - `Tags []string`

    The tags associated with the entity

  - `UpdatedAt Time`

    When the dashboard was last updated

  - `ArchivedAt Time`

    When the dashboard was archived (soft-deleted)

  - `Description string`

    Dashboard description

  - `ErrorMessage string`

    Error message if computation failed

  - `EvaluationGroupID string`

    Evaluation group ID

  - `EvaluationID string`

    Evaluation ID

  - `Object EvaluationDashboardObject`

    - `const EvaluationDashboardObjectEvaluationDashboard EvaluationDashboardObject = "evaluation_dashboard"`

  - `WidgetOrder []string`

    Ordered array of widget IDs

  - `WidgetResults []EvaluationDashboardWidgetResult`

    Widget results for this dashboard. Populated with 'widget_results' view.

    - `ID string`

      Unique identifier of the widget result

    - `AccountID string`

      Account that owns this widget result

    - `ComputationStatus EvaluationDashboardWidgetResultComputationStatus`

      Status of the computation

      - `const EvaluationDashboardWidgetResultComputationStatusPending EvaluationDashboardWidgetResultComputationStatus = "pending"`

      - `const EvaluationDashboardWidgetResultComputationStatusCompleted EvaluationDashboardWidgetResultComputationStatus = "completed"`

      - `const EvaluationDashboardWidgetResultComputationStatusFailed EvaluationDashboardWidgetResultComputationStatus = "failed"`

    - `CreatedAt Time`

      When the widget result was created

    - `WidgetID string`

      Unique identifier of the widget

    - `ComputationJobID string`

      Temporal workflow ID or job ID for async computation tracking

    - `ComputedAt Time`

      Timestamp when computation completed successfully

    - `ComputedResult map[string, any]`

      Cached computation results

    - `ErrorMessage string`

      Error message if computation failed

    - `EvaluationGroupID string`

      FK to evaluation_groups. Null if result is for a single evaluation.

    - `EvaluationID string`

      FK to evaluations. Null if result is for an evaluation group.

    - `Object EvaluationDashboardWidgetResultObject`

      - `const EvaluationDashboardWidgetResultObjectEvaluationDashboardWidgetResult EvaluationDashboardWidgetResultObject = "evaluation_dashboard_widget_result"`

    - `Widget EvaluationDashboardWidget`

      Widget that this result is for

      - `ID string`

        Unique identifier of the widget

      - `AccountID string`

        Account that owns this widget

      - `CreatedAt Time`

        When the widget was created

      - `Title string`

        Widget title

      - `Type EvaluationWidgetTypeEnum`

        Widget type

        - `const EvaluationWidgetTypeEnumBar EvaluationWidgetTypeEnum = "bar"`

        - `const EvaluationWidgetTypeEnumHistogram EvaluationWidgetTypeEnum = "histogram"`

        - `const EvaluationWidgetTypeEnumDonut EvaluationWidgetTypeEnum = "donut"`

        - `const EvaluationWidgetTypeEnumScatter EvaluationWidgetTypeEnum = "scatter"`

        - `const EvaluationWidgetTypeEnumMetric EvaluationWidgetTypeEnum = "metric"`

        - `const EvaluationWidgetTypeEnumTable EvaluationWidgetTypeEnum = "table"`

        - `const EvaluationWidgetTypeEnumMarkdown EvaluationWidgetTypeEnum = "markdown"`

        - `const EvaluationWidgetTypeEnumHeading EvaluationWidgetTypeEnum = "heading"`

        - `const EvaluationWidgetTypeEnumTimeseries EvaluationWidgetTypeEnum = "timeseries"`

      - `ArchivedAt Time`

        When the widget was archived (soft-deleted)

      - `Config map[string, any]`

        Chart-specific display configuration

      - `Object EvaluationDashboardWidgetObject`

        - `const EvaluationDashboardWidgetObjectEvaluationDashboardWidget EvaluationDashboardWidgetObject = "evaluation_dashboard_widget"`

      - `Query EvaluationDashboardWidgetQueryUnion`

        Structured query AST for metric computation (SeriesQuery or MetricQuery)

        - `type SeriesQuery struct{…}`

          Query that returns a series of records (used for table/bar/histogram/donut/scatter widgets).

          Used for widget types: table, bar, histogram, donut, scatter.
          Returns: {"type": "series", "data": [...]}

          Example SQL equivalent:
          SELECT category, AVG(score) as avg_score, COUNT(*) as count
          FROM evaluation_items
          WHERE score > 0.5 AND category = 'test'
          GROUP BY category
          ORDER BY avg_score DESC
          LIMIT 100

          - `Select []SelectItem`

            - `Expression SelectItemExpressionUnion`

              Reference to a column from evaluation_items.data

              Example:
              {"type": "COLUMN", "column": "category"}

              - `type SelectItemExpressionColumn struct{…}`

                Reference to a column from evaluation_items.data

                Example:
                {"type": "COLUMN", "column": "category"}

                - `Column string`

                  Column name from evaluation_items.data

                - `Source string`

                  Column source: 'data' or 'task_result_cache'

                - `Type string`

                  - `const SelectItemExpressionColumnTypeColumn SelectItemExpressionColumnType = "COLUMN"`

              - `type SelectItemExpressionAggregation struct{…}`

                Aggregation function to apply

                Examples:
                {"type": "AGGREGATION", "function": "AVG", "column": "score"}
                {"type": "AGGREGATION", "function": "COUNT", "column": "*"}
                {"type": "AGGREGATION", "function": "PERCENTILE", "column": "score", "params": {"percentile": 95}}

                - `Column string`

                  Column to aggregate, or '*' for COUNT(*)

                - `Function string`

                  Supported aggregation functions

                  - `const SelectItemExpressionAggregationFunctionCount SelectItemExpressionAggregationFunction = "COUNT"`

                  - `const SelectItemExpressionAggregationFunctionSum SelectItemExpressionAggregationFunction = "SUM"`

                  - `const SelectItemExpressionAggregationFunctionAvg SelectItemExpressionAggregationFunction = "AVG"`

                  - `const SelectItemExpressionAggregationFunctionMin SelectItemExpressionAggregationFunction = "MIN"`

                  - `const SelectItemExpressionAggregationFunctionMax SelectItemExpressionAggregationFunction = "MAX"`

                  - `const SelectItemExpressionAggregationFunctionStddev SelectItemExpressionAggregationFunction = "STDDEV"`

                  - `const SelectItemExpressionAggregationFunctionVariance SelectItemExpressionAggregationFunction = "VARIANCE"`

                  - `const SelectItemExpressionAggregationFunctionPercentile SelectItemExpressionAggregationFunction = "PERCENTILE"`

                  - `const SelectItemExpressionAggregationFunctionCountDistinct SelectItemExpressionAggregationFunction = "COUNT_DISTINCT"`

                  - `const SelectItemExpressionAggregationFunctionPercentage SelectItemExpressionAggregationFunction = "PERCENTAGE"`

                - `EvaluationIDs []string`

                  Optional subset of evaluation IDs for per-aggregation filtering in evaluation group dashboards.

                - `Params map[string, any]`

                  Function parameters (e.g., {'percentile': 95} for PERCENTILE, {'percentage_filters': Filter} for PERCENTAGE)

                - `Source string`

                  Column source: 'data' or 'task_result_cache'

                - `Type string`

                  - `const SelectItemExpressionAggregationTypeAggregation SelectItemExpressionAggregationType = "AGGREGATION"`

            - `Alias string`

              Optional alias for the selected item

          - `EvaluationIDs []string`

            Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

          - `Filter Filter`

            Filter conditions (WHERE clause)

            - `Conditions []FilterCondition`

              - `Column string`

                Column name to filter on

              - `Operator string`

                Comparison operator

                - `const FilterConditionOperatorEquals FilterConditionOperator = "="`

                - `const FilterConditionOperatorNotEquals FilterConditionOperator = "!="`

                - `const FilterConditionOperatorGreater FilterConditionOperator = ">"`

                - `const FilterConditionOperatorLess FilterConditionOperator = "<"`

                - `const FilterConditionOperatorGreaterOrEquals FilterConditionOperator = ">="`

                - `const FilterConditionOperatorLessOrEquals FilterConditionOperator = "<="`

                - `const FilterConditionOperatorIn FilterConditionOperator = "IN"`

                - `const FilterConditionOperatorNotIn FilterConditionOperator = "NOT IN"`

                - `const FilterConditionOperatorLike FilterConditionOperator = "LIKE"`

                - `const FilterConditionOperatorNotLike FilterConditionOperator = "NOT LIKE"`

                - `const FilterConditionOperatorIsNull FilterConditionOperator = "IS NULL"`

                - `const FilterConditionOperatorIsNotNull FilterConditionOperator = "IS NOT NULL"`

              - `Source string`

                Column source: 'data' or 'task_result_cache'

              - `Value FilterConditionValueUnion`

                Value to compare against. Not required for IS NULL / IS NOT NULL operators.

                - `string`

                - `float64`

                - `bool`

                - `type FilterConditionValueArray []any`

            - `LogicalOperators []string`

              Logical operators connecting conditions. Length must be len(conditions) - 1

              - `const FilterLogicalOperatorAnd FilterLogicalOperator = "AND"`

              - `const FilterLogicalOperatorOr FilterLogicalOperator = "OR"`

          - `GroupBy []string`

            Columns to group by

          - `LatestOnly bool`

            When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

          - `Limit int64`

            Max rows to return

          - `OrderBy []SeriesQueryOrderBy`

            Sort order

            - `Column string`

              Column name to sort by

            - `Direction string`

              Sort direction

              - `const SeriesQueryOrderByDirectionAsc SeriesQueryOrderByDirection = "ASC"`

              - `const SeriesQueryOrderByDirectionDesc SeriesQueryOrderByDirection = "DESC"`

            - `Source string`

              Column source: 'data' or 'task_result_cache'

        - `type MetricQuery struct{…}`

          Query that returns a single metric value (used for metric widgets).

          Used for widget type: metric.
          Enforces exactly 1 aggregation in select.
          Returns: {"type": "metric", "data": ...}

          Example SQL equivalent:
          SELECT AVG(score) as average_score
          FROM evaluation_items

          - `Select []SelectItem`

            - `Expression SelectItemExpressionUnion`

              Reference to a column from evaluation_items.data

              Example:
              {"type": "COLUMN", "column": "category"}

            - `Alias string`

              Optional alias for the selected item

          - `EvaluationIDs []string`

            Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

          - `Filter Filter`

            Filter conditions (WHERE clause)

          - `LatestOnly bool`

            When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

  - `Widgets []EvaluationDashboardWidget`

    Widgets associated with this dashboard. Populated with 'widgets' view.

    - `ID string`

      Unique identifier of the widget

    - `AccountID string`

      Account that owns this widget

    - `CreatedAt Time`

      When the widget was created

    - `Title string`

      Widget title

    - `Type EvaluationWidgetTypeEnum`

      Widget type

    - `ArchivedAt Time`

      When the widget was archived (soft-deleted)

    - `Config map[string, any]`

      Chart-specific display configuration

    - `Object EvaluationDashboardWidgetObject`

    - `Query EvaluationDashboardWidgetQueryUnion`

      Structured query AST for metric computation (SeriesQuery or MetricQuery)

# Widgets

## Add Widget to Dashboard

`client.EvaluationDashboards.Widgets.New(ctx, dashboardID, body) (*EvaluationDashboardWidgetWithResult, error)`

**post** `/v5/evaluation-dashboards/{dashboard_id}/widgets`

Create a new widget, append it to the dashboard, and compute its result in one call.

The widget is persisted as its own entity, its ID is appended to the dashboard's
`widget_order`, and — unless it is a `markdown` or `heading` widget — its result is
computed synchronously against the dashboard's evaluation (or evaluation-group) data
before the response returns. Validation is type-specific: `markdown` requires
`config.content`, `bar`/`histogram`/`donut`/`scatter` require exactly one of
`config.x_column` or `config.x_column_group`, `table` configs with conditional
formatting are schema-validated, and all other chart types require a `query`. The
dashboard must exist and not be archived. A computation failure does not fail the
request: the widget is still created and returned with a result whose
`computation_status` is `failed` and an `error_message` set, while `markdown` and
`heading` widgets return a null result.

### Parameters

- `dashboardID string`

- `body EvaluationDashboardWidgetNewParams`

  - `Title param.Field[string]`

    Widget title

  - `Type param.Field[EvaluationWidgetTypeEnum]`

    Widget type

  - `Config param.Field[map[string, any]]`

    Chart-specific display configuration

  - `Query param.Field[EvaluationDashboardWidgetNewParamsQueryUnion]`

    Structured query AST for metric computation (SeriesQuery or MetricQuery)

    - `type SeriesQuery struct{…}`

      Query that returns a series of records (used for table/bar/histogram/donut/scatter widgets).

      Used for widget types: table, bar, histogram, donut, scatter.
      Returns: {"type": "series", "data": [...]}

      Example SQL equivalent:
      SELECT category, AVG(score) as avg_score, COUNT(*) as count
      FROM evaluation_items
      WHERE score > 0.5 AND category = 'test'
      GROUP BY category
      ORDER BY avg_score DESC
      LIMIT 100

      - `Select []SelectItem`

        - `Expression SelectItemExpressionUnion`

          Reference to a column from evaluation_items.data

          Example:
          {"type": "COLUMN", "column": "category"}

          - `type SelectItemExpressionColumn struct{…}`

            Reference to a column from evaluation_items.data

            Example:
            {"type": "COLUMN", "column": "category"}

            - `Column string`

              Column name from evaluation_items.data

            - `Source string`

              Column source: 'data' or 'task_result_cache'

            - `Type string`

              - `const SelectItemExpressionColumnTypeColumn SelectItemExpressionColumnType = "COLUMN"`

          - `type SelectItemExpressionAggregation struct{…}`

            Aggregation function to apply

            Examples:
            {"type": "AGGREGATION", "function": "AVG", "column": "score"}
            {"type": "AGGREGATION", "function": "COUNT", "column": "*"}
            {"type": "AGGREGATION", "function": "PERCENTILE", "column": "score", "params": {"percentile": 95}}

            - `Column string`

              Column to aggregate, or '*' for COUNT(*)

            - `Function string`

              Supported aggregation functions

              - `const SelectItemExpressionAggregationFunctionCount SelectItemExpressionAggregationFunction = "COUNT"`

              - `const SelectItemExpressionAggregationFunctionSum SelectItemExpressionAggregationFunction = "SUM"`

              - `const SelectItemExpressionAggregationFunctionAvg SelectItemExpressionAggregationFunction = "AVG"`

              - `const SelectItemExpressionAggregationFunctionMin SelectItemExpressionAggregationFunction = "MIN"`

              - `const SelectItemExpressionAggregationFunctionMax SelectItemExpressionAggregationFunction = "MAX"`

              - `const SelectItemExpressionAggregationFunctionStddev SelectItemExpressionAggregationFunction = "STDDEV"`

              - `const SelectItemExpressionAggregationFunctionVariance SelectItemExpressionAggregationFunction = "VARIANCE"`

              - `const SelectItemExpressionAggregationFunctionPercentile SelectItemExpressionAggregationFunction = "PERCENTILE"`

              - `const SelectItemExpressionAggregationFunctionCountDistinct SelectItemExpressionAggregationFunction = "COUNT_DISTINCT"`

              - `const SelectItemExpressionAggregationFunctionPercentage SelectItemExpressionAggregationFunction = "PERCENTAGE"`

            - `EvaluationIDs []string`

              Optional subset of evaluation IDs for per-aggregation filtering in evaluation group dashboards.

            - `Params map[string, any]`

              Function parameters (e.g., {'percentile': 95} for PERCENTILE, {'percentage_filters': Filter} for PERCENTAGE)

            - `Source string`

              Column source: 'data' or 'task_result_cache'

            - `Type string`

              - `const SelectItemExpressionAggregationTypeAggregation SelectItemExpressionAggregationType = "AGGREGATION"`

        - `Alias string`

          Optional alias for the selected item

      - `EvaluationIDs []string`

        Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

      - `Filter Filter`

        Filter conditions (WHERE clause)

        - `Conditions []FilterCondition`

          - `Column string`

            Column name to filter on

          - `Operator string`

            Comparison operator

            - `const FilterConditionOperatorEquals FilterConditionOperator = "="`

            - `const FilterConditionOperatorNotEquals FilterConditionOperator = "!="`

            - `const FilterConditionOperatorGreater FilterConditionOperator = ">"`

            - `const FilterConditionOperatorLess FilterConditionOperator = "<"`

            - `const FilterConditionOperatorGreaterOrEquals FilterConditionOperator = ">="`

            - `const FilterConditionOperatorLessOrEquals FilterConditionOperator = "<="`

            - `const FilterConditionOperatorIn FilterConditionOperator = "IN"`

            - `const FilterConditionOperatorNotIn FilterConditionOperator = "NOT IN"`

            - `const FilterConditionOperatorLike FilterConditionOperator = "LIKE"`

            - `const FilterConditionOperatorNotLike FilterConditionOperator = "NOT LIKE"`

            - `const FilterConditionOperatorIsNull FilterConditionOperator = "IS NULL"`

            - `const FilterConditionOperatorIsNotNull FilterConditionOperator = "IS NOT NULL"`

          - `Source string`

            Column source: 'data' or 'task_result_cache'

          - `Value FilterConditionValueUnion`

            Value to compare against. Not required for IS NULL / IS NOT NULL operators.

            - `string`

            - `float64`

            - `bool`

            - `type FilterConditionValueArray []any`

        - `LogicalOperators []string`

          Logical operators connecting conditions. Length must be len(conditions) - 1

          - `const FilterLogicalOperatorAnd FilterLogicalOperator = "AND"`

          - `const FilterLogicalOperatorOr FilterLogicalOperator = "OR"`

      - `GroupBy []string`

        Columns to group by

      - `LatestOnly bool`

        When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

      - `Limit int64`

        Max rows to return

      - `OrderBy []SeriesQueryOrderBy`

        Sort order

        - `Column string`

          Column name to sort by

        - `Direction string`

          Sort direction

          - `const SeriesQueryOrderByDirectionAsc SeriesQueryOrderByDirection = "ASC"`

          - `const SeriesQueryOrderByDirectionDesc SeriesQueryOrderByDirection = "DESC"`

        - `Source string`

          Column source: 'data' or 'task_result_cache'

    - `type MetricQuery struct{…}`

      Query that returns a single metric value (used for metric widgets).

      Used for widget type: metric.
      Enforces exactly 1 aggregation in select.
      Returns: {"type": "metric", "data": ...}

      Example SQL equivalent:
      SELECT AVG(score) as average_score
      FROM evaluation_items

      - `Select []SelectItem`

        - `Expression SelectItemExpressionUnion`

          Reference to a column from evaluation_items.data

          Example:
          {"type": "COLUMN", "column": "category"}

        - `Alias string`

          Optional alias for the selected item

      - `EvaluationIDs []string`

        Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

      - `Filter Filter`

        Filter conditions (WHERE clause)

      - `LatestOnly bool`

        When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

### Returns

- `type EvaluationDashboardWidgetWithResult struct{…}`

  Response model for widget creation - includes widget and computed result

  - `ID string`

    Unique identifier of the widget

  - `AccountID string`

    Account that owns this widget

  - `CreatedAt Time`

    When the widget was created

  - `Title string`

    Widget title

  - `Type EvaluationWidgetTypeEnum`

    Widget type

    - `const EvaluationWidgetTypeEnumBar EvaluationWidgetTypeEnum = "bar"`

    - `const EvaluationWidgetTypeEnumHistogram EvaluationWidgetTypeEnum = "histogram"`

    - `const EvaluationWidgetTypeEnumDonut EvaluationWidgetTypeEnum = "donut"`

    - `const EvaluationWidgetTypeEnumScatter EvaluationWidgetTypeEnum = "scatter"`

    - `const EvaluationWidgetTypeEnumMetric EvaluationWidgetTypeEnum = "metric"`

    - `const EvaluationWidgetTypeEnumTable EvaluationWidgetTypeEnum = "table"`

    - `const EvaluationWidgetTypeEnumMarkdown EvaluationWidgetTypeEnum = "markdown"`

    - `const EvaluationWidgetTypeEnumHeading EvaluationWidgetTypeEnum = "heading"`

    - `const EvaluationWidgetTypeEnumTimeseries EvaluationWidgetTypeEnum = "timeseries"`

  - `Config map[string, any]`

    Display configuration

  - `Object EvaluationDashboardWidgetWithResultObject`

    - `const EvaluationDashboardWidgetWithResultObjectEvaluationWidget EvaluationDashboardWidgetWithResultObject = "evaluation_widget"`

  - `Query EvaluationDashboardWidgetWithResultQueryUnion`

    Structured query AST for computation (SeriesQuery or MetricQuery)

    - `type SeriesQuery struct{…}`

      Query that returns a series of records (used for table/bar/histogram/donut/scatter widgets).

      Used for widget types: table, bar, histogram, donut, scatter.
      Returns: {"type": "series", "data": [...]}

      Example SQL equivalent:
      SELECT category, AVG(score) as avg_score, COUNT(*) as count
      FROM evaluation_items
      WHERE score > 0.5 AND category = 'test'
      GROUP BY category
      ORDER BY avg_score DESC
      LIMIT 100

      - `Select []SelectItem`

        - `Expression SelectItemExpressionUnion`

          Reference to a column from evaluation_items.data

          Example:
          {"type": "COLUMN", "column": "category"}

          - `type SelectItemExpressionColumn struct{…}`

            Reference to a column from evaluation_items.data

            Example:
            {"type": "COLUMN", "column": "category"}

            - `Column string`

              Column name from evaluation_items.data

            - `Source string`

              Column source: 'data' or 'task_result_cache'

            - `Type string`

              - `const SelectItemExpressionColumnTypeColumn SelectItemExpressionColumnType = "COLUMN"`

          - `type SelectItemExpressionAggregation struct{…}`

            Aggregation function to apply

            Examples:
            {"type": "AGGREGATION", "function": "AVG", "column": "score"}
            {"type": "AGGREGATION", "function": "COUNT", "column": "*"}
            {"type": "AGGREGATION", "function": "PERCENTILE", "column": "score", "params": {"percentile": 95}}

            - `Column string`

              Column to aggregate, or '*' for COUNT(*)

            - `Function string`

              Supported aggregation functions

              - `const SelectItemExpressionAggregationFunctionCount SelectItemExpressionAggregationFunction = "COUNT"`

              - `const SelectItemExpressionAggregationFunctionSum SelectItemExpressionAggregationFunction = "SUM"`

              - `const SelectItemExpressionAggregationFunctionAvg SelectItemExpressionAggregationFunction = "AVG"`

              - `const SelectItemExpressionAggregationFunctionMin SelectItemExpressionAggregationFunction = "MIN"`

              - `const SelectItemExpressionAggregationFunctionMax SelectItemExpressionAggregationFunction = "MAX"`

              - `const SelectItemExpressionAggregationFunctionStddev SelectItemExpressionAggregationFunction = "STDDEV"`

              - `const SelectItemExpressionAggregationFunctionVariance SelectItemExpressionAggregationFunction = "VARIANCE"`

              - `const SelectItemExpressionAggregationFunctionPercentile SelectItemExpressionAggregationFunction = "PERCENTILE"`

              - `const SelectItemExpressionAggregationFunctionCountDistinct SelectItemExpressionAggregationFunction = "COUNT_DISTINCT"`

              - `const SelectItemExpressionAggregationFunctionPercentage SelectItemExpressionAggregationFunction = "PERCENTAGE"`

            - `EvaluationIDs []string`

              Optional subset of evaluation IDs for per-aggregation filtering in evaluation group dashboards.

            - `Params map[string, any]`

              Function parameters (e.g., {'percentile': 95} for PERCENTILE, {'percentage_filters': Filter} for PERCENTAGE)

            - `Source string`

              Column source: 'data' or 'task_result_cache'

            - `Type string`

              - `const SelectItemExpressionAggregationTypeAggregation SelectItemExpressionAggregationType = "AGGREGATION"`

        - `Alias string`

          Optional alias for the selected item

      - `EvaluationIDs []string`

        Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

      - `Filter Filter`

        Filter conditions (WHERE clause)

        - `Conditions []FilterCondition`

          - `Column string`

            Column name to filter on

          - `Operator string`

            Comparison operator

            - `const FilterConditionOperatorEquals FilterConditionOperator = "="`

            - `const FilterConditionOperatorNotEquals FilterConditionOperator = "!="`

            - `const FilterConditionOperatorGreater FilterConditionOperator = ">"`

            - `const FilterConditionOperatorLess FilterConditionOperator = "<"`

            - `const FilterConditionOperatorGreaterOrEquals FilterConditionOperator = ">="`

            - `const FilterConditionOperatorLessOrEquals FilterConditionOperator = "<="`

            - `const FilterConditionOperatorIn FilterConditionOperator = "IN"`

            - `const FilterConditionOperatorNotIn FilterConditionOperator = "NOT IN"`

            - `const FilterConditionOperatorLike FilterConditionOperator = "LIKE"`

            - `const FilterConditionOperatorNotLike FilterConditionOperator = "NOT LIKE"`

            - `const FilterConditionOperatorIsNull FilterConditionOperator = "IS NULL"`

            - `const FilterConditionOperatorIsNotNull FilterConditionOperator = "IS NOT NULL"`

          - `Source string`

            Column source: 'data' or 'task_result_cache'

          - `Value FilterConditionValueUnion`

            Value to compare against. Not required for IS NULL / IS NOT NULL operators.

            - `string`

            - `float64`

            - `bool`

            - `type FilterConditionValueArray []any`

        - `LogicalOperators []string`

          Logical operators connecting conditions. Length must be len(conditions) - 1

          - `const FilterLogicalOperatorAnd FilterLogicalOperator = "AND"`

          - `const FilterLogicalOperatorOr FilterLogicalOperator = "OR"`

      - `GroupBy []string`

        Columns to group by

      - `LatestOnly bool`

        When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

      - `Limit int64`

        Max rows to return

      - `OrderBy []SeriesQueryOrderBy`

        Sort order

        - `Column string`

          Column name to sort by

        - `Direction string`

          Sort direction

          - `const SeriesQueryOrderByDirectionAsc SeriesQueryOrderByDirection = "ASC"`

          - `const SeriesQueryOrderByDirectionDesc SeriesQueryOrderByDirection = "DESC"`

        - `Source string`

          Column source: 'data' or 'task_result_cache'

    - `type MetricQuery struct{…}`

      Query that returns a single metric value (used for metric widgets).

      Used for widget type: metric.
      Enforces exactly 1 aggregation in select.
      Returns: {"type": "metric", "data": ...}

      Example SQL equivalent:
      SELECT AVG(score) as average_score
      FROM evaluation_items

      - `Select []SelectItem`

        - `Expression SelectItemExpressionUnion`

          Reference to a column from evaluation_items.data

          Example:
          {"type": "COLUMN", "column": "category"}

        - `Alias string`

          Optional alias for the selected item

      - `EvaluationIDs []string`

        Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

      - `Filter Filter`

        Filter conditions (WHERE clause)

      - `LatestOnly bool`

        When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

  - `Result EvaluationDashboardWidgetResultResponse`

    Computed result for this widget

    - `ID string`

      Unique identifier of the widget result

    - `ComputationStatus string`

      Status: pending, completed, or failed

    - `WidgetID string`

      Widget ID this result belongs to

    - `ComputedAt Time`

      When computation completed

    - `ComputedResult map[string, any]`

      Computed result data. Metric: {type: 'metric', data: 42}, Series: {type: 'series', data: [{x: 'A', y: 10}, ...]}

    - `ErrorMessage string`

      Error message if computation failed

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/scaleapi/sgp-dev-go"
  "github.com/scaleapi/sgp-dev-go/option"
)

func main() {
  client := sgpdev.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithAccountID("My Account ID"),
  )
  evaluationDashboardWidgetWithResult, err := client.EvaluationDashboards.Widgets.New(
    context.TODO(),
    "dashboard_id",
    sgpdev.EvaluationDashboardWidgetNewParams{
      Title: "x",
      Type: sgpdev.EvaluationWidgetTypeEnumBar,
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", evaluationDashboardWidgetWithResult.ID)
}
```

#### Response

```json
{
  "id": "id",
  "account_id": "account_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "title": "title",
  "type": "bar",
  "config": {
    "foo": "bar"
  },
  "object": "evaluation_widget",
  "query": {
    "select": [
      {
        "expression": {
          "column": "column",
          "source": "source",
          "type": "COLUMN"
        },
        "alias": "alias"
      }
    ],
    "evaluation_ids": [
      "string"
    ],
    "filter": {
      "conditions": [
        {
          "column": "column",
          "operator": "=",
          "source": "source",
          "value": "string"
        }
      ],
      "logicalOperators": [
        "AND"
      ]
    },
    "groupBy": [
      "string"
    ],
    "latest_only": true,
    "limit": 1,
    "orderBy": [
      {
        "column": "column",
        "direction": "ASC",
        "source": "source"
      }
    ]
  },
  "result": {
    "id": "id",
    "computation_status": "computation_status",
    "widget_id": "widget_id",
    "computed_at": "2019-12-27T18:11:19.117Z",
    "computed_result": {
      "foo": "bar"
    },
    "error_message": "error_message"
  }
}
```

## Update Dashboard Widget

`client.EvaluationDashboards.Widgets.Update(ctx, widgetID, params) (*EvaluationDashboardWidgetWithResult, error)`

**patch** `/v5/evaluation-dashboards/{dashboard_id}/widgets/{widget_id}`

Update a widget's fields within this dashboard, using copy-on-write for shared widgets.

If the widget belongs only to this dashboard it is updated in place; if it is
referenced by more than one dashboard, a new widget is created with the updates
applied and swapped into this dashboard's `widget_order`, leaving the other
dashboards' copy untouched. The widget must already be in this dashboard's
`widget_order`, otherwise the call is rejected. The result is recomputed
synchronously when the `query` changes or when the widget was cloned; otherwise the
existing cached result is returned. For `table` widgets, conditional-formatting
column references are re-resolved against the (possibly updated) query on each save.
The dashboard must exist and not be archived.

### Parameters

- `widgetID string`

- `params EvaluationDashboardWidgetUpdateParams`

  - `DashboardID param.Field[string]`

    Path param

  - `Config param.Field[map[string, any]]`

    Body param: Chart-specific display configuration

  - `Query param.Field[EvaluationDashboardWidgetUpdateParamsQueryUnion]`

    Body param: Structured query AST for metric computation (SeriesQuery or MetricQuery)

    - `type SeriesQuery struct{…}`

      Query that returns a series of records (used for table/bar/histogram/donut/scatter widgets).

      Used for widget types: table, bar, histogram, donut, scatter.
      Returns: {"type": "series", "data": [...]}

      Example SQL equivalent:
      SELECT category, AVG(score) as avg_score, COUNT(*) as count
      FROM evaluation_items
      WHERE score > 0.5 AND category = 'test'
      GROUP BY category
      ORDER BY avg_score DESC
      LIMIT 100

      - `Select []SelectItem`

        - `Expression SelectItemExpressionUnion`

          Reference to a column from evaluation_items.data

          Example:
          {"type": "COLUMN", "column": "category"}

          - `type SelectItemExpressionColumn struct{…}`

            Reference to a column from evaluation_items.data

            Example:
            {"type": "COLUMN", "column": "category"}

            - `Column string`

              Column name from evaluation_items.data

            - `Source string`

              Column source: 'data' or 'task_result_cache'

            - `Type string`

              - `const SelectItemExpressionColumnTypeColumn SelectItemExpressionColumnType = "COLUMN"`

          - `type SelectItemExpressionAggregation struct{…}`

            Aggregation function to apply

            Examples:
            {"type": "AGGREGATION", "function": "AVG", "column": "score"}
            {"type": "AGGREGATION", "function": "COUNT", "column": "*"}
            {"type": "AGGREGATION", "function": "PERCENTILE", "column": "score", "params": {"percentile": 95}}

            - `Column string`

              Column to aggregate, or '*' for COUNT(*)

            - `Function string`

              Supported aggregation functions

              - `const SelectItemExpressionAggregationFunctionCount SelectItemExpressionAggregationFunction = "COUNT"`

              - `const SelectItemExpressionAggregationFunctionSum SelectItemExpressionAggregationFunction = "SUM"`

              - `const SelectItemExpressionAggregationFunctionAvg SelectItemExpressionAggregationFunction = "AVG"`

              - `const SelectItemExpressionAggregationFunctionMin SelectItemExpressionAggregationFunction = "MIN"`

              - `const SelectItemExpressionAggregationFunctionMax SelectItemExpressionAggregationFunction = "MAX"`

              - `const SelectItemExpressionAggregationFunctionStddev SelectItemExpressionAggregationFunction = "STDDEV"`

              - `const SelectItemExpressionAggregationFunctionVariance SelectItemExpressionAggregationFunction = "VARIANCE"`

              - `const SelectItemExpressionAggregationFunctionPercentile SelectItemExpressionAggregationFunction = "PERCENTILE"`

              - `const SelectItemExpressionAggregationFunctionCountDistinct SelectItemExpressionAggregationFunction = "COUNT_DISTINCT"`

              - `const SelectItemExpressionAggregationFunctionPercentage SelectItemExpressionAggregationFunction = "PERCENTAGE"`

            - `EvaluationIDs []string`

              Optional subset of evaluation IDs for per-aggregation filtering in evaluation group dashboards.

            - `Params map[string, any]`

              Function parameters (e.g., {'percentile': 95} for PERCENTILE, {'percentage_filters': Filter} for PERCENTAGE)

            - `Source string`

              Column source: 'data' or 'task_result_cache'

            - `Type string`

              - `const SelectItemExpressionAggregationTypeAggregation SelectItemExpressionAggregationType = "AGGREGATION"`

        - `Alias string`

          Optional alias for the selected item

      - `EvaluationIDs []string`

        Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

      - `Filter Filter`

        Filter conditions (WHERE clause)

        - `Conditions []FilterCondition`

          - `Column string`

            Column name to filter on

          - `Operator string`

            Comparison operator

            - `const FilterConditionOperatorEquals FilterConditionOperator = "="`

            - `const FilterConditionOperatorNotEquals FilterConditionOperator = "!="`

            - `const FilterConditionOperatorGreater FilterConditionOperator = ">"`

            - `const FilterConditionOperatorLess FilterConditionOperator = "<"`

            - `const FilterConditionOperatorGreaterOrEquals FilterConditionOperator = ">="`

            - `const FilterConditionOperatorLessOrEquals FilterConditionOperator = "<="`

            - `const FilterConditionOperatorIn FilterConditionOperator = "IN"`

            - `const FilterConditionOperatorNotIn FilterConditionOperator = "NOT IN"`

            - `const FilterConditionOperatorLike FilterConditionOperator = "LIKE"`

            - `const FilterConditionOperatorNotLike FilterConditionOperator = "NOT LIKE"`

            - `const FilterConditionOperatorIsNull FilterConditionOperator = "IS NULL"`

            - `const FilterConditionOperatorIsNotNull FilterConditionOperator = "IS NOT NULL"`

          - `Source string`

            Column source: 'data' or 'task_result_cache'

          - `Value FilterConditionValueUnion`

            Value to compare against. Not required for IS NULL / IS NOT NULL operators.

            - `string`

            - `float64`

            - `bool`

            - `type FilterConditionValueArray []any`

        - `LogicalOperators []string`

          Logical operators connecting conditions. Length must be len(conditions) - 1

          - `const FilterLogicalOperatorAnd FilterLogicalOperator = "AND"`

          - `const FilterLogicalOperatorOr FilterLogicalOperator = "OR"`

      - `GroupBy []string`

        Columns to group by

      - `LatestOnly bool`

        When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

      - `Limit int64`

        Max rows to return

      - `OrderBy []SeriesQueryOrderBy`

        Sort order

        - `Column string`

          Column name to sort by

        - `Direction string`

          Sort direction

          - `const SeriesQueryOrderByDirectionAsc SeriesQueryOrderByDirection = "ASC"`

          - `const SeriesQueryOrderByDirectionDesc SeriesQueryOrderByDirection = "DESC"`

        - `Source string`

          Column source: 'data' or 'task_result_cache'

    - `type MetricQuery struct{…}`

      Query that returns a single metric value (used for metric widgets).

      Used for widget type: metric.
      Enforces exactly 1 aggregation in select.
      Returns: {"type": "metric", "data": ...}

      Example SQL equivalent:
      SELECT AVG(score) as average_score
      FROM evaluation_items

      - `Select []SelectItem`

        - `Expression SelectItemExpressionUnion`

          Reference to a column from evaluation_items.data

          Example:
          {"type": "COLUMN", "column": "category"}

        - `Alias string`

          Optional alias for the selected item

      - `EvaluationIDs []string`

        Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

      - `Filter Filter`

        Filter conditions (WHERE clause)

      - `LatestOnly bool`

        When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

  - `Title param.Field[string]`

    Body param: Widget title

### Returns

- `type EvaluationDashboardWidgetWithResult struct{…}`

  Response model for widget creation - includes widget and computed result

  - `ID string`

    Unique identifier of the widget

  - `AccountID string`

    Account that owns this widget

  - `CreatedAt Time`

    When the widget was created

  - `Title string`

    Widget title

  - `Type EvaluationWidgetTypeEnum`

    Widget type

    - `const EvaluationWidgetTypeEnumBar EvaluationWidgetTypeEnum = "bar"`

    - `const EvaluationWidgetTypeEnumHistogram EvaluationWidgetTypeEnum = "histogram"`

    - `const EvaluationWidgetTypeEnumDonut EvaluationWidgetTypeEnum = "donut"`

    - `const EvaluationWidgetTypeEnumScatter EvaluationWidgetTypeEnum = "scatter"`

    - `const EvaluationWidgetTypeEnumMetric EvaluationWidgetTypeEnum = "metric"`

    - `const EvaluationWidgetTypeEnumTable EvaluationWidgetTypeEnum = "table"`

    - `const EvaluationWidgetTypeEnumMarkdown EvaluationWidgetTypeEnum = "markdown"`

    - `const EvaluationWidgetTypeEnumHeading EvaluationWidgetTypeEnum = "heading"`

    - `const EvaluationWidgetTypeEnumTimeseries EvaluationWidgetTypeEnum = "timeseries"`

  - `Config map[string, any]`

    Display configuration

  - `Object EvaluationDashboardWidgetWithResultObject`

    - `const EvaluationDashboardWidgetWithResultObjectEvaluationWidget EvaluationDashboardWidgetWithResultObject = "evaluation_widget"`

  - `Query EvaluationDashboardWidgetWithResultQueryUnion`

    Structured query AST for computation (SeriesQuery or MetricQuery)

    - `type SeriesQuery struct{…}`

      Query that returns a series of records (used for table/bar/histogram/donut/scatter widgets).

      Used for widget types: table, bar, histogram, donut, scatter.
      Returns: {"type": "series", "data": [...]}

      Example SQL equivalent:
      SELECT category, AVG(score) as avg_score, COUNT(*) as count
      FROM evaluation_items
      WHERE score > 0.5 AND category = 'test'
      GROUP BY category
      ORDER BY avg_score DESC
      LIMIT 100

      - `Select []SelectItem`

        - `Expression SelectItemExpressionUnion`

          Reference to a column from evaluation_items.data

          Example:
          {"type": "COLUMN", "column": "category"}

          - `type SelectItemExpressionColumn struct{…}`

            Reference to a column from evaluation_items.data

            Example:
            {"type": "COLUMN", "column": "category"}

            - `Column string`

              Column name from evaluation_items.data

            - `Source string`

              Column source: 'data' or 'task_result_cache'

            - `Type string`

              - `const SelectItemExpressionColumnTypeColumn SelectItemExpressionColumnType = "COLUMN"`

          - `type SelectItemExpressionAggregation struct{…}`

            Aggregation function to apply

            Examples:
            {"type": "AGGREGATION", "function": "AVG", "column": "score"}
            {"type": "AGGREGATION", "function": "COUNT", "column": "*"}
            {"type": "AGGREGATION", "function": "PERCENTILE", "column": "score", "params": {"percentile": 95}}

            - `Column string`

              Column to aggregate, or '*' for COUNT(*)

            - `Function string`

              Supported aggregation functions

              - `const SelectItemExpressionAggregationFunctionCount SelectItemExpressionAggregationFunction = "COUNT"`

              - `const SelectItemExpressionAggregationFunctionSum SelectItemExpressionAggregationFunction = "SUM"`

              - `const SelectItemExpressionAggregationFunctionAvg SelectItemExpressionAggregationFunction = "AVG"`

              - `const SelectItemExpressionAggregationFunctionMin SelectItemExpressionAggregationFunction = "MIN"`

              - `const SelectItemExpressionAggregationFunctionMax SelectItemExpressionAggregationFunction = "MAX"`

              - `const SelectItemExpressionAggregationFunctionStddev SelectItemExpressionAggregationFunction = "STDDEV"`

              - `const SelectItemExpressionAggregationFunctionVariance SelectItemExpressionAggregationFunction = "VARIANCE"`

              - `const SelectItemExpressionAggregationFunctionPercentile SelectItemExpressionAggregationFunction = "PERCENTILE"`

              - `const SelectItemExpressionAggregationFunctionCountDistinct SelectItemExpressionAggregationFunction = "COUNT_DISTINCT"`

              - `const SelectItemExpressionAggregationFunctionPercentage SelectItemExpressionAggregationFunction = "PERCENTAGE"`

            - `EvaluationIDs []string`

              Optional subset of evaluation IDs for per-aggregation filtering in evaluation group dashboards.

            - `Params map[string, any]`

              Function parameters (e.g., {'percentile': 95} for PERCENTILE, {'percentage_filters': Filter} for PERCENTAGE)

            - `Source string`

              Column source: 'data' or 'task_result_cache'

            - `Type string`

              - `const SelectItemExpressionAggregationTypeAggregation SelectItemExpressionAggregationType = "AGGREGATION"`

        - `Alias string`

          Optional alias for the selected item

      - `EvaluationIDs []string`

        Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

      - `Filter Filter`

        Filter conditions (WHERE clause)

        - `Conditions []FilterCondition`

          - `Column string`

            Column name to filter on

          - `Operator string`

            Comparison operator

            - `const FilterConditionOperatorEquals FilterConditionOperator = "="`

            - `const FilterConditionOperatorNotEquals FilterConditionOperator = "!="`

            - `const FilterConditionOperatorGreater FilterConditionOperator = ">"`

            - `const FilterConditionOperatorLess FilterConditionOperator = "<"`

            - `const FilterConditionOperatorGreaterOrEquals FilterConditionOperator = ">="`

            - `const FilterConditionOperatorLessOrEquals FilterConditionOperator = "<="`

            - `const FilterConditionOperatorIn FilterConditionOperator = "IN"`

            - `const FilterConditionOperatorNotIn FilterConditionOperator = "NOT IN"`

            - `const FilterConditionOperatorLike FilterConditionOperator = "LIKE"`

            - `const FilterConditionOperatorNotLike FilterConditionOperator = "NOT LIKE"`

            - `const FilterConditionOperatorIsNull FilterConditionOperator = "IS NULL"`

            - `const FilterConditionOperatorIsNotNull FilterConditionOperator = "IS NOT NULL"`

          - `Source string`

            Column source: 'data' or 'task_result_cache'

          - `Value FilterConditionValueUnion`

            Value to compare against. Not required for IS NULL / IS NOT NULL operators.

            - `string`

            - `float64`

            - `bool`

            - `type FilterConditionValueArray []any`

        - `LogicalOperators []string`

          Logical operators connecting conditions. Length must be len(conditions) - 1

          - `const FilterLogicalOperatorAnd FilterLogicalOperator = "AND"`

          - `const FilterLogicalOperatorOr FilterLogicalOperator = "OR"`

      - `GroupBy []string`

        Columns to group by

      - `LatestOnly bool`

        When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

      - `Limit int64`

        Max rows to return

      - `OrderBy []SeriesQueryOrderBy`

        Sort order

        - `Column string`

          Column name to sort by

        - `Direction string`

          Sort direction

          - `const SeriesQueryOrderByDirectionAsc SeriesQueryOrderByDirection = "ASC"`

          - `const SeriesQueryOrderByDirectionDesc SeriesQueryOrderByDirection = "DESC"`

        - `Source string`

          Column source: 'data' or 'task_result_cache'

    - `type MetricQuery struct{…}`

      Query that returns a single metric value (used for metric widgets).

      Used for widget type: metric.
      Enforces exactly 1 aggregation in select.
      Returns: {"type": "metric", "data": ...}

      Example SQL equivalent:
      SELECT AVG(score) as average_score
      FROM evaluation_items

      - `Select []SelectItem`

        - `Expression SelectItemExpressionUnion`

          Reference to a column from evaluation_items.data

          Example:
          {"type": "COLUMN", "column": "category"}

        - `Alias string`

          Optional alias for the selected item

      - `EvaluationIDs []string`

        Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

      - `Filter Filter`

        Filter conditions (WHERE clause)

      - `LatestOnly bool`

        When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

  - `Result EvaluationDashboardWidgetResultResponse`

    Computed result for this widget

    - `ID string`

      Unique identifier of the widget result

    - `ComputationStatus string`

      Status: pending, completed, or failed

    - `WidgetID string`

      Widget ID this result belongs to

    - `ComputedAt Time`

      When computation completed

    - `ComputedResult map[string, any]`

      Computed result data. Metric: {type: 'metric', data: 42}, Series: {type: 'series', data: [{x: 'A', y: 10}, ...]}

    - `ErrorMessage string`

      Error message if computation failed

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/scaleapi/sgp-dev-go"
  "github.com/scaleapi/sgp-dev-go/option"
)

func main() {
  client := sgpdev.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithAccountID("My Account ID"),
  )
  evaluationDashboardWidgetWithResult, err := client.EvaluationDashboards.Widgets.Update(
    context.TODO(),
    "widget_id",
    sgpdev.EvaluationDashboardWidgetUpdateParams{
      DashboardID: "dashboard_id",
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", evaluationDashboardWidgetWithResult.ID)
}
```

#### Response

```json
{
  "id": "id",
  "account_id": "account_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "title": "title",
  "type": "bar",
  "config": {
    "foo": "bar"
  },
  "object": "evaluation_widget",
  "query": {
    "select": [
      {
        "expression": {
          "column": "column",
          "source": "source",
          "type": "COLUMN"
        },
        "alias": "alias"
      }
    ],
    "evaluation_ids": [
      "string"
    ],
    "filter": {
      "conditions": [
        {
          "column": "column",
          "operator": "=",
          "source": "source",
          "value": "string"
        }
      ],
      "logicalOperators": [
        "AND"
      ]
    },
    "groupBy": [
      "string"
    ],
    "latest_only": true,
    "limit": 1,
    "orderBy": [
      {
        "column": "column",
        "direction": "ASC",
        "source": "source"
      }
    ]
  },
  "result": {
    "id": "id",
    "computation_status": "computation_status",
    "widget_id": "widget_id",
    "computed_at": "2019-12-27T18:11:19.117Z",
    "computed_result": {
      "foo": "bar"
    },
    "error_message": "error_message"
  }
}
```

## Remove Widget from Dashboard

`client.EvaluationDashboards.Widgets.Remove(ctx, widgetID, body) error`

**delete** `/v5/evaluation-dashboards/{dashboard_id}/widgets/{widget_id}`

Detach a widget from this dashboard without deleting the widget itself.

This removes the widget's ID from the dashboard's `widget_order` only; the
underlying widget entity and any computed widget results are left intact, so a widget
shared with other dashboards continues to work there. The widget must currently be in
this dashboard's `widget_order`, otherwise a not-found error is returned. Responds
with 204 No Content on success.

### Parameters

- `widgetID string`

- `body EvaluationDashboardWidgetRemoveParams`

  - `DashboardID param.Field[string]`

### Example

```go
package main

import (
  "context"

  "github.com/scaleapi/sgp-dev-go"
  "github.com/scaleapi/sgp-dev-go/option"
)

func main() {
  client := sgpdev.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithAccountID("My Account ID"),
  )
  err := client.EvaluationDashboards.Widgets.Remove(
    context.TODO(),
    "widget_id",
    sgpdev.EvaluationDashboardWidgetRemoveParams{
      DashboardID: "dashboard_id",
    },
  )
  if err != nil {
    panic(err.Error())
  }
}
```

## Domain Types

### Evaluation Dashboard Widget

- `type EvaluationDashboardWidget struct{…}`

  - `ID string`

    Unique identifier of the widget

  - `AccountID string`

    Account that owns this widget

  - `CreatedAt Time`

    When the widget was created

  - `Title string`

    Widget title

  - `Type EvaluationWidgetTypeEnum`

    Widget type

    - `const EvaluationWidgetTypeEnumBar EvaluationWidgetTypeEnum = "bar"`

    - `const EvaluationWidgetTypeEnumHistogram EvaluationWidgetTypeEnum = "histogram"`

    - `const EvaluationWidgetTypeEnumDonut EvaluationWidgetTypeEnum = "donut"`

    - `const EvaluationWidgetTypeEnumScatter EvaluationWidgetTypeEnum = "scatter"`

    - `const EvaluationWidgetTypeEnumMetric EvaluationWidgetTypeEnum = "metric"`

    - `const EvaluationWidgetTypeEnumTable EvaluationWidgetTypeEnum = "table"`

    - `const EvaluationWidgetTypeEnumMarkdown EvaluationWidgetTypeEnum = "markdown"`

    - `const EvaluationWidgetTypeEnumHeading EvaluationWidgetTypeEnum = "heading"`

    - `const EvaluationWidgetTypeEnumTimeseries EvaluationWidgetTypeEnum = "timeseries"`

  - `ArchivedAt Time`

    When the widget was archived (soft-deleted)

  - `Config map[string, any]`

    Chart-specific display configuration

  - `Object EvaluationDashboardWidgetObject`

    - `const EvaluationDashboardWidgetObjectEvaluationDashboardWidget EvaluationDashboardWidgetObject = "evaluation_dashboard_widget"`

  - `Query EvaluationDashboardWidgetQueryUnion`

    Structured query AST for metric computation (SeriesQuery or MetricQuery)

    - `type SeriesQuery struct{…}`

      Query that returns a series of records (used for table/bar/histogram/donut/scatter widgets).

      Used for widget types: table, bar, histogram, donut, scatter.
      Returns: {"type": "series", "data": [...]}

      Example SQL equivalent:
      SELECT category, AVG(score) as avg_score, COUNT(*) as count
      FROM evaluation_items
      WHERE score > 0.5 AND category = 'test'
      GROUP BY category
      ORDER BY avg_score DESC
      LIMIT 100

      - `Select []SelectItem`

        - `Expression SelectItemExpressionUnion`

          Reference to a column from evaluation_items.data

          Example:
          {"type": "COLUMN", "column": "category"}

          - `type SelectItemExpressionColumn struct{…}`

            Reference to a column from evaluation_items.data

            Example:
            {"type": "COLUMN", "column": "category"}

            - `Column string`

              Column name from evaluation_items.data

            - `Source string`

              Column source: 'data' or 'task_result_cache'

            - `Type string`

              - `const SelectItemExpressionColumnTypeColumn SelectItemExpressionColumnType = "COLUMN"`

          - `type SelectItemExpressionAggregation struct{…}`

            Aggregation function to apply

            Examples:
            {"type": "AGGREGATION", "function": "AVG", "column": "score"}
            {"type": "AGGREGATION", "function": "COUNT", "column": "*"}
            {"type": "AGGREGATION", "function": "PERCENTILE", "column": "score", "params": {"percentile": 95}}

            - `Column string`

              Column to aggregate, or '*' for COUNT(*)

            - `Function string`

              Supported aggregation functions

              - `const SelectItemExpressionAggregationFunctionCount SelectItemExpressionAggregationFunction = "COUNT"`

              - `const SelectItemExpressionAggregationFunctionSum SelectItemExpressionAggregationFunction = "SUM"`

              - `const SelectItemExpressionAggregationFunctionAvg SelectItemExpressionAggregationFunction = "AVG"`

              - `const SelectItemExpressionAggregationFunctionMin SelectItemExpressionAggregationFunction = "MIN"`

              - `const SelectItemExpressionAggregationFunctionMax SelectItemExpressionAggregationFunction = "MAX"`

              - `const SelectItemExpressionAggregationFunctionStddev SelectItemExpressionAggregationFunction = "STDDEV"`

              - `const SelectItemExpressionAggregationFunctionVariance SelectItemExpressionAggregationFunction = "VARIANCE"`

              - `const SelectItemExpressionAggregationFunctionPercentile SelectItemExpressionAggregationFunction = "PERCENTILE"`

              - `const SelectItemExpressionAggregationFunctionCountDistinct SelectItemExpressionAggregationFunction = "COUNT_DISTINCT"`

              - `const SelectItemExpressionAggregationFunctionPercentage SelectItemExpressionAggregationFunction = "PERCENTAGE"`

            - `EvaluationIDs []string`

              Optional subset of evaluation IDs for per-aggregation filtering in evaluation group dashboards.

            - `Params map[string, any]`

              Function parameters (e.g., {'percentile': 95} for PERCENTILE, {'percentage_filters': Filter} for PERCENTAGE)

            - `Source string`

              Column source: 'data' or 'task_result_cache'

            - `Type string`

              - `const SelectItemExpressionAggregationTypeAggregation SelectItemExpressionAggregationType = "AGGREGATION"`

        - `Alias string`

          Optional alias for the selected item

      - `EvaluationIDs []string`

        Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

      - `Filter Filter`

        Filter conditions (WHERE clause)

        - `Conditions []FilterCondition`

          - `Column string`

            Column name to filter on

          - `Operator string`

            Comparison operator

            - `const FilterConditionOperatorEquals FilterConditionOperator = "="`

            - `const FilterConditionOperatorNotEquals FilterConditionOperator = "!="`

            - `const FilterConditionOperatorGreater FilterConditionOperator = ">"`

            - `const FilterConditionOperatorLess FilterConditionOperator = "<"`

            - `const FilterConditionOperatorGreaterOrEquals FilterConditionOperator = ">="`

            - `const FilterConditionOperatorLessOrEquals FilterConditionOperator = "<="`

            - `const FilterConditionOperatorIn FilterConditionOperator = "IN"`

            - `const FilterConditionOperatorNotIn FilterConditionOperator = "NOT IN"`

            - `const FilterConditionOperatorLike FilterConditionOperator = "LIKE"`

            - `const FilterConditionOperatorNotLike FilterConditionOperator = "NOT LIKE"`

            - `const FilterConditionOperatorIsNull FilterConditionOperator = "IS NULL"`

            - `const FilterConditionOperatorIsNotNull FilterConditionOperator = "IS NOT NULL"`

          - `Source string`

            Column source: 'data' or 'task_result_cache'

          - `Value FilterConditionValueUnion`

            Value to compare against. Not required for IS NULL / IS NOT NULL operators.

            - `string`

            - `float64`

            - `bool`

            - `type FilterConditionValueArray []any`

        - `LogicalOperators []string`

          Logical operators connecting conditions. Length must be len(conditions) - 1

          - `const FilterLogicalOperatorAnd FilterLogicalOperator = "AND"`

          - `const FilterLogicalOperatorOr FilterLogicalOperator = "OR"`

      - `GroupBy []string`

        Columns to group by

      - `LatestOnly bool`

        When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

      - `Limit int64`

        Max rows to return

      - `OrderBy []SeriesQueryOrderBy`

        Sort order

        - `Column string`

          Column name to sort by

        - `Direction string`

          Sort direction

          - `const SeriesQueryOrderByDirectionAsc SeriesQueryOrderByDirection = "ASC"`

          - `const SeriesQueryOrderByDirectionDesc SeriesQueryOrderByDirection = "DESC"`

        - `Source string`

          Column source: 'data' or 'task_result_cache'

    - `type MetricQuery struct{…}`

      Query that returns a single metric value (used for metric widgets).

      Used for widget type: metric.
      Enforces exactly 1 aggregation in select.
      Returns: {"type": "metric", "data": ...}

      Example SQL equivalent:
      SELECT AVG(score) as average_score
      FROM evaluation_items

      - `Select []SelectItem`

        - `Expression SelectItemExpressionUnion`

          Reference to a column from evaluation_items.data

          Example:
          {"type": "COLUMN", "column": "category"}

        - `Alias string`

          Optional alias for the selected item

      - `EvaluationIDs []string`

        Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

      - `Filter Filter`

        Filter conditions (WHERE clause)

      - `LatestOnly bool`

        When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

### Evaluation Dashboard Widget Result

- `type EvaluationDashboardWidgetResult struct{…}`

  - `ID string`

    Unique identifier of the widget result

  - `AccountID string`

    Account that owns this widget result

  - `ComputationStatus EvaluationDashboardWidgetResultComputationStatus`

    Status of the computation

    - `const EvaluationDashboardWidgetResultComputationStatusPending EvaluationDashboardWidgetResultComputationStatus = "pending"`

    - `const EvaluationDashboardWidgetResultComputationStatusCompleted EvaluationDashboardWidgetResultComputationStatus = "completed"`

    - `const EvaluationDashboardWidgetResultComputationStatusFailed EvaluationDashboardWidgetResultComputationStatus = "failed"`

  - `CreatedAt Time`

    When the widget result was created

  - `WidgetID string`

    Unique identifier of the widget

  - `ComputationJobID string`

    Temporal workflow ID or job ID for async computation tracking

  - `ComputedAt Time`

    Timestamp when computation completed successfully

  - `ComputedResult map[string, any]`

    Cached computation results

  - `ErrorMessage string`

    Error message if computation failed

  - `EvaluationGroupID string`

    FK to evaluation_groups. Null if result is for a single evaluation.

  - `EvaluationID string`

    FK to evaluations. Null if result is for an evaluation group.

  - `Object EvaluationDashboardWidgetResultObject`

    - `const EvaluationDashboardWidgetResultObjectEvaluationDashboardWidgetResult EvaluationDashboardWidgetResultObject = "evaluation_dashboard_widget_result"`

  - `Widget EvaluationDashboardWidget`

    Widget that this result is for

    - `ID string`

      Unique identifier of the widget

    - `AccountID string`

      Account that owns this widget

    - `CreatedAt Time`

      When the widget was created

    - `Title string`

      Widget title

    - `Type EvaluationWidgetTypeEnum`

      Widget type

      - `const EvaluationWidgetTypeEnumBar EvaluationWidgetTypeEnum = "bar"`

      - `const EvaluationWidgetTypeEnumHistogram EvaluationWidgetTypeEnum = "histogram"`

      - `const EvaluationWidgetTypeEnumDonut EvaluationWidgetTypeEnum = "donut"`

      - `const EvaluationWidgetTypeEnumScatter EvaluationWidgetTypeEnum = "scatter"`

      - `const EvaluationWidgetTypeEnumMetric EvaluationWidgetTypeEnum = "metric"`

      - `const EvaluationWidgetTypeEnumTable EvaluationWidgetTypeEnum = "table"`

      - `const EvaluationWidgetTypeEnumMarkdown EvaluationWidgetTypeEnum = "markdown"`

      - `const EvaluationWidgetTypeEnumHeading EvaluationWidgetTypeEnum = "heading"`

      - `const EvaluationWidgetTypeEnumTimeseries EvaluationWidgetTypeEnum = "timeseries"`

    - `ArchivedAt Time`

      When the widget was archived (soft-deleted)

    - `Config map[string, any]`

      Chart-specific display configuration

    - `Object EvaluationDashboardWidgetObject`

      - `const EvaluationDashboardWidgetObjectEvaluationDashboardWidget EvaluationDashboardWidgetObject = "evaluation_dashboard_widget"`

    - `Query EvaluationDashboardWidgetQueryUnion`

      Structured query AST for metric computation (SeriesQuery or MetricQuery)

      - `type SeriesQuery struct{…}`

        Query that returns a series of records (used for table/bar/histogram/donut/scatter widgets).

        Used for widget types: table, bar, histogram, donut, scatter.
        Returns: {"type": "series", "data": [...]}

        Example SQL equivalent:
        SELECT category, AVG(score) as avg_score, COUNT(*) as count
        FROM evaluation_items
        WHERE score > 0.5 AND category = 'test'
        GROUP BY category
        ORDER BY avg_score DESC
        LIMIT 100

        - `Select []SelectItem`

          - `Expression SelectItemExpressionUnion`

            Reference to a column from evaluation_items.data

            Example:
            {"type": "COLUMN", "column": "category"}

            - `type SelectItemExpressionColumn struct{…}`

              Reference to a column from evaluation_items.data

              Example:
              {"type": "COLUMN", "column": "category"}

              - `Column string`

                Column name from evaluation_items.data

              - `Source string`

                Column source: 'data' or 'task_result_cache'

              - `Type string`

                - `const SelectItemExpressionColumnTypeColumn SelectItemExpressionColumnType = "COLUMN"`

            - `type SelectItemExpressionAggregation struct{…}`

              Aggregation function to apply

              Examples:
              {"type": "AGGREGATION", "function": "AVG", "column": "score"}
              {"type": "AGGREGATION", "function": "COUNT", "column": "*"}
              {"type": "AGGREGATION", "function": "PERCENTILE", "column": "score", "params": {"percentile": 95}}

              - `Column string`

                Column to aggregate, or '*' for COUNT(*)

              - `Function string`

                Supported aggregation functions

                - `const SelectItemExpressionAggregationFunctionCount SelectItemExpressionAggregationFunction = "COUNT"`

                - `const SelectItemExpressionAggregationFunctionSum SelectItemExpressionAggregationFunction = "SUM"`

                - `const SelectItemExpressionAggregationFunctionAvg SelectItemExpressionAggregationFunction = "AVG"`

                - `const SelectItemExpressionAggregationFunctionMin SelectItemExpressionAggregationFunction = "MIN"`

                - `const SelectItemExpressionAggregationFunctionMax SelectItemExpressionAggregationFunction = "MAX"`

                - `const SelectItemExpressionAggregationFunctionStddev SelectItemExpressionAggregationFunction = "STDDEV"`

                - `const SelectItemExpressionAggregationFunctionVariance SelectItemExpressionAggregationFunction = "VARIANCE"`

                - `const SelectItemExpressionAggregationFunctionPercentile SelectItemExpressionAggregationFunction = "PERCENTILE"`

                - `const SelectItemExpressionAggregationFunctionCountDistinct SelectItemExpressionAggregationFunction = "COUNT_DISTINCT"`

                - `const SelectItemExpressionAggregationFunctionPercentage SelectItemExpressionAggregationFunction = "PERCENTAGE"`

              - `EvaluationIDs []string`

                Optional subset of evaluation IDs for per-aggregation filtering in evaluation group dashboards.

              - `Params map[string, any]`

                Function parameters (e.g., {'percentile': 95} for PERCENTILE, {'percentage_filters': Filter} for PERCENTAGE)

              - `Source string`

                Column source: 'data' or 'task_result_cache'

              - `Type string`

                - `const SelectItemExpressionAggregationTypeAggregation SelectItemExpressionAggregationType = "AGGREGATION"`

          - `Alias string`

            Optional alias for the selected item

        - `EvaluationIDs []string`

          Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

        - `Filter Filter`

          Filter conditions (WHERE clause)

          - `Conditions []FilterCondition`

            - `Column string`

              Column name to filter on

            - `Operator string`

              Comparison operator

              - `const FilterConditionOperatorEquals FilterConditionOperator = "="`

              - `const FilterConditionOperatorNotEquals FilterConditionOperator = "!="`

              - `const FilterConditionOperatorGreater FilterConditionOperator = ">"`

              - `const FilterConditionOperatorLess FilterConditionOperator = "<"`

              - `const FilterConditionOperatorGreaterOrEquals FilterConditionOperator = ">="`

              - `const FilterConditionOperatorLessOrEquals FilterConditionOperator = "<="`

              - `const FilterConditionOperatorIn FilterConditionOperator = "IN"`

              - `const FilterConditionOperatorNotIn FilterConditionOperator = "NOT IN"`

              - `const FilterConditionOperatorLike FilterConditionOperator = "LIKE"`

              - `const FilterConditionOperatorNotLike FilterConditionOperator = "NOT LIKE"`

              - `const FilterConditionOperatorIsNull FilterConditionOperator = "IS NULL"`

              - `const FilterConditionOperatorIsNotNull FilterConditionOperator = "IS NOT NULL"`

            - `Source string`

              Column source: 'data' or 'task_result_cache'

            - `Value FilterConditionValueUnion`

              Value to compare against. Not required for IS NULL / IS NOT NULL operators.

              - `string`

              - `float64`

              - `bool`

              - `type FilterConditionValueArray []any`

          - `LogicalOperators []string`

            Logical operators connecting conditions. Length must be len(conditions) - 1

            - `const FilterLogicalOperatorAnd FilterLogicalOperator = "AND"`

            - `const FilterLogicalOperatorOr FilterLogicalOperator = "OR"`

        - `GroupBy []string`

          Columns to group by

        - `LatestOnly bool`

          When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

        - `Limit int64`

          Max rows to return

        - `OrderBy []SeriesQueryOrderBy`

          Sort order

          - `Column string`

            Column name to sort by

          - `Direction string`

            Sort direction

            - `const SeriesQueryOrderByDirectionAsc SeriesQueryOrderByDirection = "ASC"`

            - `const SeriesQueryOrderByDirectionDesc SeriesQueryOrderByDirection = "DESC"`

          - `Source string`

            Column source: 'data' or 'task_result_cache'

      - `type MetricQuery struct{…}`

        Query that returns a single metric value (used for metric widgets).

        Used for widget type: metric.
        Enforces exactly 1 aggregation in select.
        Returns: {"type": "metric", "data": ...}

        Example SQL equivalent:
        SELECT AVG(score) as average_score
        FROM evaluation_items

        - `Select []SelectItem`

          - `Expression SelectItemExpressionUnion`

            Reference to a column from evaluation_items.data

            Example:
            {"type": "COLUMN", "column": "category"}

          - `Alias string`

            Optional alias for the selected item

        - `EvaluationIDs []string`

          Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

        - `Filter Filter`

          Filter conditions (WHERE clause)

        - `LatestOnly bool`

          When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

### Evaluation Dashboard Widget Result Response

- `type EvaluationDashboardWidgetResultResponse struct{…}`

  Computed result for a widget - used in widget creation response

  - `ID string`

    Unique identifier of the widget result

  - `ComputationStatus string`

    Status: pending, completed, or failed

  - `WidgetID string`

    Widget ID this result belongs to

  - `ComputedAt Time`

    When computation completed

  - `ComputedResult map[string, any]`

    Computed result data. Metric: {type: 'metric', data: 42}, Series: {type: 'series', data: [{x: 'A', y: 10}, ...]}

  - `ErrorMessage string`

    Error message if computation failed

### Evaluation Dashboard Widget With Result

- `type EvaluationDashboardWidgetWithResult struct{…}`

  Response model for widget creation - includes widget and computed result

  - `ID string`

    Unique identifier of the widget

  - `AccountID string`

    Account that owns this widget

  - `CreatedAt Time`

    When the widget was created

  - `Title string`

    Widget title

  - `Type EvaluationWidgetTypeEnum`

    Widget type

    - `const EvaluationWidgetTypeEnumBar EvaluationWidgetTypeEnum = "bar"`

    - `const EvaluationWidgetTypeEnumHistogram EvaluationWidgetTypeEnum = "histogram"`

    - `const EvaluationWidgetTypeEnumDonut EvaluationWidgetTypeEnum = "donut"`

    - `const EvaluationWidgetTypeEnumScatter EvaluationWidgetTypeEnum = "scatter"`

    - `const EvaluationWidgetTypeEnumMetric EvaluationWidgetTypeEnum = "metric"`

    - `const EvaluationWidgetTypeEnumTable EvaluationWidgetTypeEnum = "table"`

    - `const EvaluationWidgetTypeEnumMarkdown EvaluationWidgetTypeEnum = "markdown"`

    - `const EvaluationWidgetTypeEnumHeading EvaluationWidgetTypeEnum = "heading"`

    - `const EvaluationWidgetTypeEnumTimeseries EvaluationWidgetTypeEnum = "timeseries"`

  - `Config map[string, any]`

    Display configuration

  - `Object EvaluationDashboardWidgetWithResultObject`

    - `const EvaluationDashboardWidgetWithResultObjectEvaluationWidget EvaluationDashboardWidgetWithResultObject = "evaluation_widget"`

  - `Query EvaluationDashboardWidgetWithResultQueryUnion`

    Structured query AST for computation (SeriesQuery or MetricQuery)

    - `type SeriesQuery struct{…}`

      Query that returns a series of records (used for table/bar/histogram/donut/scatter widgets).

      Used for widget types: table, bar, histogram, donut, scatter.
      Returns: {"type": "series", "data": [...]}

      Example SQL equivalent:
      SELECT category, AVG(score) as avg_score, COUNT(*) as count
      FROM evaluation_items
      WHERE score > 0.5 AND category = 'test'
      GROUP BY category
      ORDER BY avg_score DESC
      LIMIT 100

      - `Select []SelectItem`

        - `Expression SelectItemExpressionUnion`

          Reference to a column from evaluation_items.data

          Example:
          {"type": "COLUMN", "column": "category"}

          - `type SelectItemExpressionColumn struct{…}`

            Reference to a column from evaluation_items.data

            Example:
            {"type": "COLUMN", "column": "category"}

            - `Column string`

              Column name from evaluation_items.data

            - `Source string`

              Column source: 'data' or 'task_result_cache'

            - `Type string`

              - `const SelectItemExpressionColumnTypeColumn SelectItemExpressionColumnType = "COLUMN"`

          - `type SelectItemExpressionAggregation struct{…}`

            Aggregation function to apply

            Examples:
            {"type": "AGGREGATION", "function": "AVG", "column": "score"}
            {"type": "AGGREGATION", "function": "COUNT", "column": "*"}
            {"type": "AGGREGATION", "function": "PERCENTILE", "column": "score", "params": {"percentile": 95}}

            - `Column string`

              Column to aggregate, or '*' for COUNT(*)

            - `Function string`

              Supported aggregation functions

              - `const SelectItemExpressionAggregationFunctionCount SelectItemExpressionAggregationFunction = "COUNT"`

              - `const SelectItemExpressionAggregationFunctionSum SelectItemExpressionAggregationFunction = "SUM"`

              - `const SelectItemExpressionAggregationFunctionAvg SelectItemExpressionAggregationFunction = "AVG"`

              - `const SelectItemExpressionAggregationFunctionMin SelectItemExpressionAggregationFunction = "MIN"`

              - `const SelectItemExpressionAggregationFunctionMax SelectItemExpressionAggregationFunction = "MAX"`

              - `const SelectItemExpressionAggregationFunctionStddev SelectItemExpressionAggregationFunction = "STDDEV"`

              - `const SelectItemExpressionAggregationFunctionVariance SelectItemExpressionAggregationFunction = "VARIANCE"`

              - `const SelectItemExpressionAggregationFunctionPercentile SelectItemExpressionAggregationFunction = "PERCENTILE"`

              - `const SelectItemExpressionAggregationFunctionCountDistinct SelectItemExpressionAggregationFunction = "COUNT_DISTINCT"`

              - `const SelectItemExpressionAggregationFunctionPercentage SelectItemExpressionAggregationFunction = "PERCENTAGE"`

            - `EvaluationIDs []string`

              Optional subset of evaluation IDs for per-aggregation filtering in evaluation group dashboards.

            - `Params map[string, any]`

              Function parameters (e.g., {'percentile': 95} for PERCENTILE, {'percentage_filters': Filter} for PERCENTAGE)

            - `Source string`

              Column source: 'data' or 'task_result_cache'

            - `Type string`

              - `const SelectItemExpressionAggregationTypeAggregation SelectItemExpressionAggregationType = "AGGREGATION"`

        - `Alias string`

          Optional alias for the selected item

      - `EvaluationIDs []string`

        Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

      - `Filter Filter`

        Filter conditions (WHERE clause)

        - `Conditions []FilterCondition`

          - `Column string`

            Column name to filter on

          - `Operator string`

            Comparison operator

            - `const FilterConditionOperatorEquals FilterConditionOperator = "="`

            - `const FilterConditionOperatorNotEquals FilterConditionOperator = "!="`

            - `const FilterConditionOperatorGreater FilterConditionOperator = ">"`

            - `const FilterConditionOperatorLess FilterConditionOperator = "<"`

            - `const FilterConditionOperatorGreaterOrEquals FilterConditionOperator = ">="`

            - `const FilterConditionOperatorLessOrEquals FilterConditionOperator = "<="`

            - `const FilterConditionOperatorIn FilterConditionOperator = "IN"`

            - `const FilterConditionOperatorNotIn FilterConditionOperator = "NOT IN"`

            - `const FilterConditionOperatorLike FilterConditionOperator = "LIKE"`

            - `const FilterConditionOperatorNotLike FilterConditionOperator = "NOT LIKE"`

            - `const FilterConditionOperatorIsNull FilterConditionOperator = "IS NULL"`

            - `const FilterConditionOperatorIsNotNull FilterConditionOperator = "IS NOT NULL"`

          - `Source string`

            Column source: 'data' or 'task_result_cache'

          - `Value FilterConditionValueUnion`

            Value to compare against. Not required for IS NULL / IS NOT NULL operators.

            - `string`

            - `float64`

            - `bool`

            - `type FilterConditionValueArray []any`

        - `LogicalOperators []string`

          Logical operators connecting conditions. Length must be len(conditions) - 1

          - `const FilterLogicalOperatorAnd FilterLogicalOperator = "AND"`

          - `const FilterLogicalOperatorOr FilterLogicalOperator = "OR"`

      - `GroupBy []string`

        Columns to group by

      - `LatestOnly bool`

        When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

      - `Limit int64`

        Max rows to return

      - `OrderBy []SeriesQueryOrderBy`

        Sort order

        - `Column string`

          Column name to sort by

        - `Direction string`

          Sort direction

          - `const SeriesQueryOrderByDirectionAsc SeriesQueryOrderByDirection = "ASC"`

          - `const SeriesQueryOrderByDirectionDesc SeriesQueryOrderByDirection = "DESC"`

        - `Source string`

          Column source: 'data' or 'task_result_cache'

    - `type MetricQuery struct{…}`

      Query that returns a single metric value (used for metric widgets).

      Used for widget type: metric.
      Enforces exactly 1 aggregation in select.
      Returns: {"type": "metric", "data": ...}

      Example SQL equivalent:
      SELECT AVG(score) as average_score
      FROM evaluation_items

      - `Select []SelectItem`

        - `Expression SelectItemExpressionUnion`

          Reference to a column from evaluation_items.data

          Example:
          {"type": "COLUMN", "column": "category"}

        - `Alias string`

          Optional alias for the selected item

      - `EvaluationIDs []string`

        Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

      - `Filter Filter`

        Filter conditions (WHERE clause)

      - `LatestOnly bool`

        When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

  - `Result EvaluationDashboardWidgetResultResponse`

    Computed result for this widget

    - `ID string`

      Unique identifier of the widget result

    - `ComputationStatus string`

      Status: pending, completed, or failed

    - `WidgetID string`

      Widget ID this result belongs to

    - `ComputedAt Time`

      When computation completed

    - `ComputedResult map[string, any]`

      Computed result data. Metric: {type: 'metric', data: 42}, Series: {type: 'series', data: [{x: 'A', y: 10}, ...]}

    - `ErrorMessage string`

      Error message if computation failed

### Evaluation Widget Type Enum

- `type EvaluationWidgetTypeEnum string`

  Widget types for dashboard visualizations

  - `const EvaluationWidgetTypeEnumBar EvaluationWidgetTypeEnum = "bar"`

  - `const EvaluationWidgetTypeEnumHistogram EvaluationWidgetTypeEnum = "histogram"`

  - `const EvaluationWidgetTypeEnumDonut EvaluationWidgetTypeEnum = "donut"`

  - `const EvaluationWidgetTypeEnumScatter EvaluationWidgetTypeEnum = "scatter"`

  - `const EvaluationWidgetTypeEnumMetric EvaluationWidgetTypeEnum = "metric"`

  - `const EvaluationWidgetTypeEnumTable EvaluationWidgetTypeEnum = "table"`

  - `const EvaluationWidgetTypeEnumMarkdown EvaluationWidgetTypeEnum = "markdown"`

  - `const EvaluationWidgetTypeEnumHeading EvaluationWidgetTypeEnum = "heading"`

  - `const EvaluationWidgetTypeEnumTimeseries EvaluationWidgetTypeEnum = "timeseries"`

### Filter

- `type Filter struct{…}`

  Filter clause with conditions connected by logical operators.

  Conditions are evaluated left-to-right without precedence (no nesting/parentheses).
  Example: condition1 AND condition2 OR condition3 evaluates as ((condition1 AND condition2) OR condition3)

  Example:
  {
  "conditions": [
  {"column": "score", "operator": ">", "value": 0.5},
  {"column": "category", "operator": "=", "value": "test"}
  ],
  "logicalOperators": ["AND"]
  }

  - `Conditions []FilterCondition`

    - `Column string`

      Column name to filter on

    - `Operator string`

      Comparison operator

      - `const FilterConditionOperatorEquals FilterConditionOperator = "="`

      - `const FilterConditionOperatorNotEquals FilterConditionOperator = "!="`

      - `const FilterConditionOperatorGreater FilterConditionOperator = ">"`

      - `const FilterConditionOperatorLess FilterConditionOperator = "<"`

      - `const FilterConditionOperatorGreaterOrEquals FilterConditionOperator = ">="`

      - `const FilterConditionOperatorLessOrEquals FilterConditionOperator = "<="`

      - `const FilterConditionOperatorIn FilterConditionOperator = "IN"`

      - `const FilterConditionOperatorNotIn FilterConditionOperator = "NOT IN"`

      - `const FilterConditionOperatorLike FilterConditionOperator = "LIKE"`

      - `const FilterConditionOperatorNotLike FilterConditionOperator = "NOT LIKE"`

      - `const FilterConditionOperatorIsNull FilterConditionOperator = "IS NULL"`

      - `const FilterConditionOperatorIsNotNull FilterConditionOperator = "IS NOT NULL"`

    - `Source string`

      Column source: 'data' or 'task_result_cache'

    - `Value FilterConditionValueUnion`

      Value to compare against. Not required for IS NULL / IS NOT NULL operators.

      - `string`

      - `float64`

      - `bool`

      - `type FilterConditionValueArray []any`

  - `LogicalOperators []string`

    Logical operators connecting conditions. Length must be len(conditions) - 1

    - `const FilterLogicalOperatorAnd FilterLogicalOperator = "AND"`

    - `const FilterLogicalOperatorOr FilterLogicalOperator = "OR"`

### Metric Query

- `type MetricQuery struct{…}`

  Query that returns a single metric value (used for metric widgets).

  Used for widget type: metric.
  Enforces exactly 1 aggregation in select.
  Returns: {"type": "metric", "data": ...}

  Example SQL equivalent:
  SELECT AVG(score) as average_score
  FROM evaluation_items

  - `Select []SelectItem`

    - `Expression SelectItemExpressionUnion`

      Reference to a column from evaluation_items.data

      Example:
      {"type": "COLUMN", "column": "category"}

      - `type SelectItemExpressionColumn struct{…}`

        Reference to a column from evaluation_items.data

        Example:
        {"type": "COLUMN", "column": "category"}

        - `Column string`

          Column name from evaluation_items.data

        - `Source string`

          Column source: 'data' or 'task_result_cache'

        - `Type string`

          - `const SelectItemExpressionColumnTypeColumn SelectItemExpressionColumnType = "COLUMN"`

      - `type SelectItemExpressionAggregation struct{…}`

        Aggregation function to apply

        Examples:
        {"type": "AGGREGATION", "function": "AVG", "column": "score"}
        {"type": "AGGREGATION", "function": "COUNT", "column": "*"}
        {"type": "AGGREGATION", "function": "PERCENTILE", "column": "score", "params": {"percentile": 95}}

        - `Column string`

          Column to aggregate, or '*' for COUNT(*)

        - `Function string`

          Supported aggregation functions

          - `const SelectItemExpressionAggregationFunctionCount SelectItemExpressionAggregationFunction = "COUNT"`

          - `const SelectItemExpressionAggregationFunctionSum SelectItemExpressionAggregationFunction = "SUM"`

          - `const SelectItemExpressionAggregationFunctionAvg SelectItemExpressionAggregationFunction = "AVG"`

          - `const SelectItemExpressionAggregationFunctionMin SelectItemExpressionAggregationFunction = "MIN"`

          - `const SelectItemExpressionAggregationFunctionMax SelectItemExpressionAggregationFunction = "MAX"`

          - `const SelectItemExpressionAggregationFunctionStddev SelectItemExpressionAggregationFunction = "STDDEV"`

          - `const SelectItemExpressionAggregationFunctionVariance SelectItemExpressionAggregationFunction = "VARIANCE"`

          - `const SelectItemExpressionAggregationFunctionPercentile SelectItemExpressionAggregationFunction = "PERCENTILE"`

          - `const SelectItemExpressionAggregationFunctionCountDistinct SelectItemExpressionAggregationFunction = "COUNT_DISTINCT"`

          - `const SelectItemExpressionAggregationFunctionPercentage SelectItemExpressionAggregationFunction = "PERCENTAGE"`

        - `EvaluationIDs []string`

          Optional subset of evaluation IDs for per-aggregation filtering in evaluation group dashboards.

        - `Params map[string, any]`

          Function parameters (e.g., {'percentile': 95} for PERCENTILE, {'percentage_filters': Filter} for PERCENTAGE)

        - `Source string`

          Column source: 'data' or 'task_result_cache'

        - `Type string`

          - `const SelectItemExpressionAggregationTypeAggregation SelectItemExpressionAggregationType = "AGGREGATION"`

    - `Alias string`

      Optional alias for the selected item

  - `EvaluationIDs []string`

    Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

  - `Filter Filter`

    Filter conditions (WHERE clause)

    - `Conditions []FilterCondition`

      - `Column string`

        Column name to filter on

      - `Operator string`

        Comparison operator

        - `const FilterConditionOperatorEquals FilterConditionOperator = "="`

        - `const FilterConditionOperatorNotEquals FilterConditionOperator = "!="`

        - `const FilterConditionOperatorGreater FilterConditionOperator = ">"`

        - `const FilterConditionOperatorLess FilterConditionOperator = "<"`

        - `const FilterConditionOperatorGreaterOrEquals FilterConditionOperator = ">="`

        - `const FilterConditionOperatorLessOrEquals FilterConditionOperator = "<="`

        - `const FilterConditionOperatorIn FilterConditionOperator = "IN"`

        - `const FilterConditionOperatorNotIn FilterConditionOperator = "NOT IN"`

        - `const FilterConditionOperatorLike FilterConditionOperator = "LIKE"`

        - `const FilterConditionOperatorNotLike FilterConditionOperator = "NOT LIKE"`

        - `const FilterConditionOperatorIsNull FilterConditionOperator = "IS NULL"`

        - `const FilterConditionOperatorIsNotNull FilterConditionOperator = "IS NOT NULL"`

      - `Source string`

        Column source: 'data' or 'task_result_cache'

      - `Value FilterConditionValueUnion`

        Value to compare against. Not required for IS NULL / IS NOT NULL operators.

        - `string`

        - `float64`

        - `bool`

        - `type FilterConditionValueArray []any`

    - `LogicalOperators []string`

      Logical operators connecting conditions. Length must be len(conditions) - 1

      - `const FilterLogicalOperatorAnd FilterLogicalOperator = "AND"`

      - `const FilterLogicalOperatorOr FilterLogicalOperator = "OR"`

  - `LatestOnly bool`

    When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

### Select Item

- `type SelectItem struct{…}`

  Column in SELECT clause

  - `Expression SelectItemExpressionUnion`

    Reference to a column from evaluation_items.data

    Example:
    {"type": "COLUMN", "column": "category"}

    - `type SelectItemExpressionColumn struct{…}`

      Reference to a column from evaluation_items.data

      Example:
      {"type": "COLUMN", "column": "category"}

      - `Column string`

        Column name from evaluation_items.data

      - `Source string`

        Column source: 'data' or 'task_result_cache'

      - `Type string`

        - `const SelectItemExpressionColumnTypeColumn SelectItemExpressionColumnType = "COLUMN"`

    - `type SelectItemExpressionAggregation struct{…}`

      Aggregation function to apply

      Examples:
      {"type": "AGGREGATION", "function": "AVG", "column": "score"}
      {"type": "AGGREGATION", "function": "COUNT", "column": "*"}
      {"type": "AGGREGATION", "function": "PERCENTILE", "column": "score", "params": {"percentile": 95}}

      - `Column string`

        Column to aggregate, or '*' for COUNT(*)

      - `Function string`

        Supported aggregation functions

        - `const SelectItemExpressionAggregationFunctionCount SelectItemExpressionAggregationFunction = "COUNT"`

        - `const SelectItemExpressionAggregationFunctionSum SelectItemExpressionAggregationFunction = "SUM"`

        - `const SelectItemExpressionAggregationFunctionAvg SelectItemExpressionAggregationFunction = "AVG"`

        - `const SelectItemExpressionAggregationFunctionMin SelectItemExpressionAggregationFunction = "MIN"`

        - `const SelectItemExpressionAggregationFunctionMax SelectItemExpressionAggregationFunction = "MAX"`

        - `const SelectItemExpressionAggregationFunctionStddev SelectItemExpressionAggregationFunction = "STDDEV"`

        - `const SelectItemExpressionAggregationFunctionVariance SelectItemExpressionAggregationFunction = "VARIANCE"`

        - `const SelectItemExpressionAggregationFunctionPercentile SelectItemExpressionAggregationFunction = "PERCENTILE"`

        - `const SelectItemExpressionAggregationFunctionCountDistinct SelectItemExpressionAggregationFunction = "COUNT_DISTINCT"`

        - `const SelectItemExpressionAggregationFunctionPercentage SelectItemExpressionAggregationFunction = "PERCENTAGE"`

      - `EvaluationIDs []string`

        Optional subset of evaluation IDs for per-aggregation filtering in evaluation group dashboards.

      - `Params map[string, any]`

        Function parameters (e.g., {'percentile': 95} for PERCENTILE, {'percentage_filters': Filter} for PERCENTAGE)

      - `Source string`

        Column source: 'data' or 'task_result_cache'

      - `Type string`

        - `const SelectItemExpressionAggregationTypeAggregation SelectItemExpressionAggregationType = "AGGREGATION"`

  - `Alias string`

    Optional alias for the selected item

### Series Query

- `type SeriesQuery struct{…}`

  Query that returns a series of records (used for table/bar/histogram/donut/scatter widgets).

  Used for widget types: table, bar, histogram, donut, scatter.
  Returns: {"type": "series", "data": [...]}

  Example SQL equivalent:
  SELECT category, AVG(score) as avg_score, COUNT(*) as count
  FROM evaluation_items
  WHERE score > 0.5 AND category = 'test'
  GROUP BY category
  ORDER BY avg_score DESC
  LIMIT 100

  - `Select []SelectItem`

    - `Expression SelectItemExpressionUnion`

      Reference to a column from evaluation_items.data

      Example:
      {"type": "COLUMN", "column": "category"}

      - `type SelectItemExpressionColumn struct{…}`

        Reference to a column from evaluation_items.data

        Example:
        {"type": "COLUMN", "column": "category"}

        - `Column string`

          Column name from evaluation_items.data

        - `Source string`

          Column source: 'data' or 'task_result_cache'

        - `Type string`

          - `const SelectItemExpressionColumnTypeColumn SelectItemExpressionColumnType = "COLUMN"`

      - `type SelectItemExpressionAggregation struct{…}`

        Aggregation function to apply

        Examples:
        {"type": "AGGREGATION", "function": "AVG", "column": "score"}
        {"type": "AGGREGATION", "function": "COUNT", "column": "*"}
        {"type": "AGGREGATION", "function": "PERCENTILE", "column": "score", "params": {"percentile": 95}}

        - `Column string`

          Column to aggregate, or '*' for COUNT(*)

        - `Function string`

          Supported aggregation functions

          - `const SelectItemExpressionAggregationFunctionCount SelectItemExpressionAggregationFunction = "COUNT"`

          - `const SelectItemExpressionAggregationFunctionSum SelectItemExpressionAggregationFunction = "SUM"`

          - `const SelectItemExpressionAggregationFunctionAvg SelectItemExpressionAggregationFunction = "AVG"`

          - `const SelectItemExpressionAggregationFunctionMin SelectItemExpressionAggregationFunction = "MIN"`

          - `const SelectItemExpressionAggregationFunctionMax SelectItemExpressionAggregationFunction = "MAX"`

          - `const SelectItemExpressionAggregationFunctionStddev SelectItemExpressionAggregationFunction = "STDDEV"`

          - `const SelectItemExpressionAggregationFunctionVariance SelectItemExpressionAggregationFunction = "VARIANCE"`

          - `const SelectItemExpressionAggregationFunctionPercentile SelectItemExpressionAggregationFunction = "PERCENTILE"`

          - `const SelectItemExpressionAggregationFunctionCountDistinct SelectItemExpressionAggregationFunction = "COUNT_DISTINCT"`

          - `const SelectItemExpressionAggregationFunctionPercentage SelectItemExpressionAggregationFunction = "PERCENTAGE"`

        - `EvaluationIDs []string`

          Optional subset of evaluation IDs for per-aggregation filtering in evaluation group dashboards.

        - `Params map[string, any]`

          Function parameters (e.g., {'percentile': 95} for PERCENTILE, {'percentage_filters': Filter} for PERCENTAGE)

        - `Source string`

          Column source: 'data' or 'task_result_cache'

        - `Type string`

          - `const SelectItemExpressionAggregationTypeAggregation SelectItemExpressionAggregationType = "AGGREGATION"`

    - `Alias string`

      Optional alias for the selected item

  - `EvaluationIDs []string`

    Optional subset of evaluation IDs to compute on. Only applicable for evaluation group dashboards. If omitted, computes on all evaluations in the group.

  - `Filter Filter`

    Filter conditions (WHERE clause)

    - `Conditions []FilterCondition`

      - `Column string`

        Column name to filter on

      - `Operator string`

        Comparison operator

        - `const FilterConditionOperatorEquals FilterConditionOperator = "="`

        - `const FilterConditionOperatorNotEquals FilterConditionOperator = "!="`

        - `const FilterConditionOperatorGreater FilterConditionOperator = ">"`

        - `const FilterConditionOperatorLess FilterConditionOperator = "<"`

        - `const FilterConditionOperatorGreaterOrEquals FilterConditionOperator = ">="`

        - `const FilterConditionOperatorLessOrEquals FilterConditionOperator = "<="`

        - `const FilterConditionOperatorIn FilterConditionOperator = "IN"`

        - `const FilterConditionOperatorNotIn FilterConditionOperator = "NOT IN"`

        - `const FilterConditionOperatorLike FilterConditionOperator = "LIKE"`

        - `const FilterConditionOperatorNotLike FilterConditionOperator = "NOT LIKE"`

        - `const FilterConditionOperatorIsNull FilterConditionOperator = "IS NULL"`

        - `const FilterConditionOperatorIsNotNull FilterConditionOperator = "IS NOT NULL"`

      - `Source string`

        Column source: 'data' or 'task_result_cache'

      - `Value FilterConditionValueUnion`

        Value to compare against. Not required for IS NULL / IS NOT NULL operators.

        - `string`

        - `float64`

        - `bool`

        - `type FilterConditionValueArray []any`

    - `LogicalOperators []string`

      Logical operators connecting conditions. Length must be len(conditions) - 1

      - `const FilterLogicalOperatorAnd FilterLogicalOperator = "AND"`

      - `const FilterLogicalOperatorOr FilterLogicalOperator = "OR"`

  - `GroupBy []string`

    Columns to group by

  - `LatestOnly bool`

    When True, the widget computes against rows from only the most recent active evaluation in the group (by EvaluationORM.created_at). Only applicable for evaluation group dashboards. Composes with evaluation_ids (latest within the subset). Cannot be combined with per-aggregation evaluation_ids; the use case enforces these rules.

  - `Limit int64`

    Max rows to return

  - `OrderBy []SeriesQueryOrderBy`

    Sort order

    - `Column string`

      Column name to sort by

    - `Direction string`

      Sort direction

      - `const SeriesQueryOrderByDirectionAsc SeriesQueryOrderByDirection = "ASC"`

      - `const SeriesQueryOrderByDirectionDesc SeriesQueryOrderByDirection = "DESC"`

    - `Source string`

      Column source: 'data' or 'task_result_cache'
