# Evaluation Dashboards

## Create Evaluation Dashboard

`evaluation_dashboards.create(EvaluationDashboardCreateParams**kwargs)  -> EvaluationDashboard`

**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

- `name: str`

  Dashboard name

- `description: Optional[str]`

  Optional description of the dashboard

- `evaluation_group_id: Optional[str]`

  Evaluation group ID (XOR with evaluation_id)

- `evaluation_id: Optional[str]`

  Evaluation ID (XOR with evaluation_group_id)

- `tags: Optional[Sequence[str]]`

  The tags associated with the entity

- `template_dashboard_id: Optional[str]`

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

- `widget_order: Optional[Sequence[str]]`

  Ordered array of widget IDs to display on this dashboard

### Returns

- `class EvaluationDashboard: …`

  - `id: str`

    Unique identifier of the dashboard

  - `account_id: str`

    Account that owns this dashboard

  - `created_at: datetime`

    When the dashboard was created

  - `created_by: Identity`

    The identity that created the entity.

    - `id: str`

    - `type: Literal["user", "service_account"]`

      - `"user"`

      - `"service_account"`

    - `object: Optional[Literal["identity"]]`

      - `"identity"`

  - `name: str`

    Dashboard name

  - `tags: Optional[List[str]]`

    The tags associated with the entity

  - `updated_at: datetime`

    When the dashboard was last updated

  - `archived_at: Optional[datetime]`

    When the dashboard was archived (soft-deleted)

  - `description: Optional[str]`

    Dashboard description

  - `error_message: Optional[str]`

    Error message if computation failed

  - `evaluation_group_id: Optional[str]`

    Evaluation group ID

  - `evaluation_id: Optional[str]`

    Evaluation ID

  - `object: Optional[Literal["evaluation_dashboard"]]`

    - `"evaluation_dashboard"`

  - `widget_order: Optional[List[str]]`

    Ordered array of widget IDs

  - `widget_results: Optional[List[EvaluationDashboardWidgetResult]]`

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

    - `id: str`

      Unique identifier of the widget result

    - `account_id: str`

      Account that owns this widget result

    - `computation_status: Literal["pending", "completed", "failed"]`

      Status of the computation

      - `"pending"`

      - `"completed"`

      - `"failed"`

    - `created_at: datetime`

      When the widget result was created

    - `widget_id: str`

      Unique identifier of the widget

    - `computation_job_id: Optional[str]`

      Temporal workflow ID or job ID for async computation tracking

    - `computed_at: Optional[datetime]`

      Timestamp when computation completed successfully

    - `computed_result: Optional[Dict[str, object]]`

      Cached computation results

    - `error_message: Optional[str]`

      Error message if computation failed

    - `evaluation_group_id: Optional[str]`

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

    - `evaluation_id: Optional[str]`

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

    - `object: Optional[Literal["evaluation_dashboard_widget_result"]]`

      - `"evaluation_dashboard_widget_result"`

    - `widget: Optional[EvaluationDashboardWidget]`

      Widget that this result is for

      - `id: str`

        Unique identifier of the widget

      - `account_id: str`

        Account that owns this widget

      - `created_at: datetime`

        When the widget was created

      - `title: str`

        Widget title

      - `type: EvaluationWidgetTypeEnum`

        Widget type

        - `"bar"`

        - `"histogram"`

        - `"donut"`

        - `"scatter"`

        - `"metric"`

        - `"table"`

        - `"markdown"`

        - `"heading"`

        - `"timeseries"`

      - `archived_at: Optional[datetime]`

        When the widget was archived (soft-deleted)

      - `config: Optional[Dict[str, object]]`

        Chart-specific display configuration

      - `object: Optional[Literal["evaluation_dashboard_widget"]]`

        - `"evaluation_dashboard_widget"`

      - `query: Optional[Query]`

        Structured query AST for metric computation (SeriesQuery or MetricQuery)

        - `class SeriesQuery: …`

          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: List[SelectItem]`

            - `expression: Expression`

              Reference to a column from evaluation_items.data

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

              - `class ExpressionColumn: …`

                Reference to a column from evaluation_items.data

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

                - `column: str`

                  Column name from evaluation_items.data

                - `source: Optional[str]`

                  Column source: 'data' or 'task_result_cache'

                - `type: Optional[Literal["COLUMN"]]`

                  - `"COLUMN"`

              - `class ExpressionAggregation: …`

                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: str`

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

                - `function: Literal["COUNT", "SUM", "AVG", 7 more]`

                  Supported aggregation functions

                  - `"COUNT"`

                  - `"SUM"`

                  - `"AVG"`

                  - `"MIN"`

                  - `"MAX"`

                  - `"STDDEV"`

                  - `"VARIANCE"`

                  - `"PERCENTILE"`

                  - `"COUNT_DISTINCT"`

                  - `"PERCENTAGE"`

                - `evaluation_ids: Optional[List[str]]`

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

                - `params: Optional[Dict[str, object]]`

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

                - `source: Optional[str]`

                  Column source: 'data' or 'task_result_cache'

                - `type: Optional[Literal["AGGREGATION"]]`

                  - `"AGGREGATION"`

            - `alias: Optional[str]`

              Optional alias for the selected item

          - `evaluation_ids: Optional[List[str]]`

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

          - `filter: Optional[Filter]`

            Filter conditions (WHERE clause)

            - `conditions: List[Condition]`

              - `column: str`

                Column name to filter on

              - `operator: Literal["=", "!=", ">", 9 more]`

                Comparison operator

                - `"="`

                - `"!="`

                - `">"`

                - `"<"`

                - `">="`

                - `"<="`

                - `"IN"`

                - `"NOT IN"`

                - `"LIKE"`

                - `"NOT LIKE"`

                - `"IS NULL"`

                - `"IS NOT NULL"`

              - `source: Optional[str]`

                Column source: 'data' or 'task_result_cache'

              - `value: Optional[Union[str, float, bool, 2 more]]`

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

                - `str`

                - `float`

                - `bool`

                - `List[object]`

            - `logical_operators: Optional[List[Literal["AND", "OR"]]]`

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

              - `"AND"`

              - `"OR"`

          - `group_by: Optional[List[str]]`

            Columns to group by

          - `latest_only: Optional[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: Optional[int]`

            Max rows to return

          - `order_by: Optional[List[OrderBy]]`

            Sort order

            - `column: str`

              Column name to sort by

            - `direction: Optional[Literal["ASC", "DESC"]]`

              Sort direction

              - `"ASC"`

              - `"DESC"`

            - `source: Optional[str]`

              Column source: 'data' or 'task_result_cache'

        - `class MetricQuery: …`

          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: List[SelectItem]`

            - `expression: Expression`

              Reference to a column from evaluation_items.data

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

            - `alias: Optional[str]`

              Optional alias for the selected item

          - `evaluation_ids: Optional[List[str]]`

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

          - `filter: Optional[Filter]`

            Filter conditions (WHERE clause)

          - `latest_only: Optional[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: Optional[List[EvaluationDashboardWidget]]`

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

    - `id: str`

      Unique identifier of the widget

    - `account_id: str`

      Account that owns this widget

    - `created_at: datetime`

      When the widget was created

    - `title: str`

      Widget title

    - `type: EvaluationWidgetTypeEnum`

      Widget type

    - `archived_at: Optional[datetime]`

      When the widget was archived (soft-deleted)

    - `config: Optional[Dict[str, object]]`

      Chart-specific display configuration

    - `object: Optional[Literal["evaluation_dashboard_widget"]]`

    - `query: Optional[Query]`

      Structured query AST for metric computation (SeriesQuery or MetricQuery)

### Example

```python
import os
from scale_gp_beta import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
evaluation_dashboard = client.evaluation_dashboards.create(
    name="x",
)
print(evaluation_dashboard.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

`evaluation_dashboards.list(EvaluationDashboardListParams**kwargs)  -> SyncCursorPage[EvaluationDashboard]`

**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

- `created_by_ids: Optional[Sequence[str]]`

  Filter by creator user IDs

- `ending_before: Optional[str]`

- `evaluation_group_id: Optional[str]`

- `evaluation_id: Optional[str]`

- `include_archived: Optional[bool]`

- `limit: Optional[int]`

- `search: Optional[str]`

  Search in name and tags

- `sort_by: Optional[str]`

- `sort_order: Optional[SortOrder]`

  - `"asc"`

  - `"desc"`

- `starting_after: Optional[str]`

- `tags: Optional[Sequence[str]]`

  Filter by tags (case-insensitive)

### Returns

- `class EvaluationDashboard: …`

  - `id: str`

    Unique identifier of the dashboard

  - `account_id: str`

    Account that owns this dashboard

  - `created_at: datetime`

    When the dashboard was created

  - `created_by: Identity`

    The identity that created the entity.

    - `id: str`

    - `type: Literal["user", "service_account"]`

      - `"user"`

      - `"service_account"`

    - `object: Optional[Literal["identity"]]`

      - `"identity"`

  - `name: str`

    Dashboard name

  - `tags: Optional[List[str]]`

    The tags associated with the entity

  - `updated_at: datetime`

    When the dashboard was last updated

  - `archived_at: Optional[datetime]`

    When the dashboard was archived (soft-deleted)

  - `description: Optional[str]`

    Dashboard description

  - `error_message: Optional[str]`

    Error message if computation failed

  - `evaluation_group_id: Optional[str]`

    Evaluation group ID

  - `evaluation_id: Optional[str]`

    Evaluation ID

  - `object: Optional[Literal["evaluation_dashboard"]]`

    - `"evaluation_dashboard"`

  - `widget_order: Optional[List[str]]`

    Ordered array of widget IDs

  - `widget_results: Optional[List[EvaluationDashboardWidgetResult]]`

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

    - `id: str`

      Unique identifier of the widget result

    - `account_id: str`

      Account that owns this widget result

    - `computation_status: Literal["pending", "completed", "failed"]`

      Status of the computation

      - `"pending"`

      - `"completed"`

      - `"failed"`

    - `created_at: datetime`

      When the widget result was created

    - `widget_id: str`

      Unique identifier of the widget

    - `computation_job_id: Optional[str]`

      Temporal workflow ID or job ID for async computation tracking

    - `computed_at: Optional[datetime]`

      Timestamp when computation completed successfully

    - `computed_result: Optional[Dict[str, object]]`

      Cached computation results

    - `error_message: Optional[str]`

      Error message if computation failed

    - `evaluation_group_id: Optional[str]`

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

    - `evaluation_id: Optional[str]`

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

    - `object: Optional[Literal["evaluation_dashboard_widget_result"]]`

      - `"evaluation_dashboard_widget_result"`

    - `widget: Optional[EvaluationDashboardWidget]`

      Widget that this result is for

      - `id: str`

        Unique identifier of the widget

      - `account_id: str`

        Account that owns this widget

      - `created_at: datetime`

        When the widget was created

      - `title: str`

        Widget title

      - `type: EvaluationWidgetTypeEnum`

        Widget type

        - `"bar"`

        - `"histogram"`

        - `"donut"`

        - `"scatter"`

        - `"metric"`

        - `"table"`

        - `"markdown"`

        - `"heading"`

        - `"timeseries"`

      - `archived_at: Optional[datetime]`

        When the widget was archived (soft-deleted)

      - `config: Optional[Dict[str, object]]`

        Chart-specific display configuration

      - `object: Optional[Literal["evaluation_dashboard_widget"]]`

        - `"evaluation_dashboard_widget"`

      - `query: Optional[Query]`

        Structured query AST for metric computation (SeriesQuery or MetricQuery)

        - `class SeriesQuery: …`

          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: List[SelectItem]`

            - `expression: Expression`

              Reference to a column from evaluation_items.data

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

              - `class ExpressionColumn: …`

                Reference to a column from evaluation_items.data

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

                - `column: str`

                  Column name from evaluation_items.data

                - `source: Optional[str]`

                  Column source: 'data' or 'task_result_cache'

                - `type: Optional[Literal["COLUMN"]]`

                  - `"COLUMN"`

              - `class ExpressionAggregation: …`

                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: str`

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

                - `function: Literal["COUNT", "SUM", "AVG", 7 more]`

                  Supported aggregation functions

                  - `"COUNT"`

                  - `"SUM"`

                  - `"AVG"`

                  - `"MIN"`

                  - `"MAX"`

                  - `"STDDEV"`

                  - `"VARIANCE"`

                  - `"PERCENTILE"`

                  - `"COUNT_DISTINCT"`

                  - `"PERCENTAGE"`

                - `evaluation_ids: Optional[List[str]]`

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

                - `params: Optional[Dict[str, object]]`

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

                - `source: Optional[str]`

                  Column source: 'data' or 'task_result_cache'

                - `type: Optional[Literal["AGGREGATION"]]`

                  - `"AGGREGATION"`

            - `alias: Optional[str]`

              Optional alias for the selected item

          - `evaluation_ids: Optional[List[str]]`

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

          - `filter: Optional[Filter]`

            Filter conditions (WHERE clause)

            - `conditions: List[Condition]`

              - `column: str`

                Column name to filter on

              - `operator: Literal["=", "!=", ">", 9 more]`

                Comparison operator

                - `"="`

                - `"!="`

                - `">"`

                - `"<"`

                - `">="`

                - `"<="`

                - `"IN"`

                - `"NOT IN"`

                - `"LIKE"`

                - `"NOT LIKE"`

                - `"IS NULL"`

                - `"IS NOT NULL"`

              - `source: Optional[str]`

                Column source: 'data' or 'task_result_cache'

              - `value: Optional[Union[str, float, bool, 2 more]]`

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

                - `str`

                - `float`

                - `bool`

                - `List[object]`

            - `logical_operators: Optional[List[Literal["AND", "OR"]]]`

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

              - `"AND"`

              - `"OR"`

          - `group_by: Optional[List[str]]`

            Columns to group by

          - `latest_only: Optional[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: Optional[int]`

            Max rows to return

          - `order_by: Optional[List[OrderBy]]`

            Sort order

            - `column: str`

              Column name to sort by

            - `direction: Optional[Literal["ASC", "DESC"]]`

              Sort direction

              - `"ASC"`

              - `"DESC"`

            - `source: Optional[str]`

              Column source: 'data' or 'task_result_cache'

        - `class MetricQuery: …`

          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: List[SelectItem]`

            - `expression: Expression`

              Reference to a column from evaluation_items.data

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

            - `alias: Optional[str]`

              Optional alias for the selected item

          - `evaluation_ids: Optional[List[str]]`

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

          - `filter: Optional[Filter]`

            Filter conditions (WHERE clause)

          - `latest_only: Optional[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: Optional[List[EvaluationDashboardWidget]]`

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

    - `id: str`

      Unique identifier of the widget

    - `account_id: str`

      Account that owns this widget

    - `created_at: datetime`

      When the widget was created

    - `title: str`

      Widget title

    - `type: EvaluationWidgetTypeEnum`

      Widget type

    - `archived_at: Optional[datetime]`

      When the widget was archived (soft-deleted)

    - `config: Optional[Dict[str, object]]`

      Chart-specific display configuration

    - `object: Optional[Literal["evaluation_dashboard_widget"]]`

    - `query: Optional[Query]`

      Structured query AST for metric computation (SeriesQuery or MetricQuery)

### Example

```python
import os
from scale_gp_beta import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
page = client.evaluation_dashboards.list()
page = page.items[0]
print(page.id)
```

#### 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

`evaluation_dashboards.retrieve(strdashboard_id, EvaluationDashboardRetrieveParams**kwargs)  -> EvaluationDashboard`

**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

- `dashboard_id: str`

- `include_archived: Optional[bool]`

- `views: Optional[List[Literal["widgets", "widget_results"]]]`

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

  - `"widgets"`

  - `"widget_results"`

### Returns

- `class EvaluationDashboard: …`

  - `id: str`

    Unique identifier of the dashboard

  - `account_id: str`

    Account that owns this dashboard

  - `created_at: datetime`

    When the dashboard was created

  - `created_by: Identity`

    The identity that created the entity.

    - `id: str`

    - `type: Literal["user", "service_account"]`

      - `"user"`

      - `"service_account"`

    - `object: Optional[Literal["identity"]]`

      - `"identity"`

  - `name: str`

    Dashboard name

  - `tags: Optional[List[str]]`

    The tags associated with the entity

  - `updated_at: datetime`

    When the dashboard was last updated

  - `archived_at: Optional[datetime]`

    When the dashboard was archived (soft-deleted)

  - `description: Optional[str]`

    Dashboard description

  - `error_message: Optional[str]`

    Error message if computation failed

  - `evaluation_group_id: Optional[str]`

    Evaluation group ID

  - `evaluation_id: Optional[str]`

    Evaluation ID

  - `object: Optional[Literal["evaluation_dashboard"]]`

    - `"evaluation_dashboard"`

  - `widget_order: Optional[List[str]]`

    Ordered array of widget IDs

  - `widget_results: Optional[List[EvaluationDashboardWidgetResult]]`

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

    - `id: str`

      Unique identifier of the widget result

    - `account_id: str`

      Account that owns this widget result

    - `computation_status: Literal["pending", "completed", "failed"]`

      Status of the computation

      - `"pending"`

      - `"completed"`

      - `"failed"`

    - `created_at: datetime`

      When the widget result was created

    - `widget_id: str`

      Unique identifier of the widget

    - `computation_job_id: Optional[str]`

      Temporal workflow ID or job ID for async computation tracking

    - `computed_at: Optional[datetime]`

      Timestamp when computation completed successfully

    - `computed_result: Optional[Dict[str, object]]`

      Cached computation results

    - `error_message: Optional[str]`

      Error message if computation failed

    - `evaluation_group_id: Optional[str]`

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

    - `evaluation_id: Optional[str]`

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

    - `object: Optional[Literal["evaluation_dashboard_widget_result"]]`

      - `"evaluation_dashboard_widget_result"`

    - `widget: Optional[EvaluationDashboardWidget]`

      Widget that this result is for

      - `id: str`

        Unique identifier of the widget

      - `account_id: str`

        Account that owns this widget

      - `created_at: datetime`

        When the widget was created

      - `title: str`

        Widget title

      - `type: EvaluationWidgetTypeEnum`

        Widget type

        - `"bar"`

        - `"histogram"`

        - `"donut"`

        - `"scatter"`

        - `"metric"`

        - `"table"`

        - `"markdown"`

        - `"heading"`

        - `"timeseries"`

      - `archived_at: Optional[datetime]`

        When the widget was archived (soft-deleted)

      - `config: Optional[Dict[str, object]]`

        Chart-specific display configuration

      - `object: Optional[Literal["evaluation_dashboard_widget"]]`

        - `"evaluation_dashboard_widget"`

      - `query: Optional[Query]`

        Structured query AST for metric computation (SeriesQuery or MetricQuery)

        - `class SeriesQuery: …`

          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: List[SelectItem]`

            - `expression: Expression`

              Reference to a column from evaluation_items.data

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

              - `class ExpressionColumn: …`

                Reference to a column from evaluation_items.data

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

                - `column: str`

                  Column name from evaluation_items.data

                - `source: Optional[str]`

                  Column source: 'data' or 'task_result_cache'

                - `type: Optional[Literal["COLUMN"]]`

                  - `"COLUMN"`

              - `class ExpressionAggregation: …`

                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: str`

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

                - `function: Literal["COUNT", "SUM", "AVG", 7 more]`

                  Supported aggregation functions

                  - `"COUNT"`

                  - `"SUM"`

                  - `"AVG"`

                  - `"MIN"`

                  - `"MAX"`

                  - `"STDDEV"`

                  - `"VARIANCE"`

                  - `"PERCENTILE"`

                  - `"COUNT_DISTINCT"`

                  - `"PERCENTAGE"`

                - `evaluation_ids: Optional[List[str]]`

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

                - `params: Optional[Dict[str, object]]`

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

                - `source: Optional[str]`

                  Column source: 'data' or 'task_result_cache'

                - `type: Optional[Literal["AGGREGATION"]]`

                  - `"AGGREGATION"`

            - `alias: Optional[str]`

              Optional alias for the selected item

          - `evaluation_ids: Optional[List[str]]`

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

          - `filter: Optional[Filter]`

            Filter conditions (WHERE clause)

            - `conditions: List[Condition]`

              - `column: str`

                Column name to filter on

              - `operator: Literal["=", "!=", ">", 9 more]`

                Comparison operator

                - `"="`

                - `"!="`

                - `">"`

                - `"<"`

                - `">="`

                - `"<="`

                - `"IN"`

                - `"NOT IN"`

                - `"LIKE"`

                - `"NOT LIKE"`

                - `"IS NULL"`

                - `"IS NOT NULL"`

              - `source: Optional[str]`

                Column source: 'data' or 'task_result_cache'

              - `value: Optional[Union[str, float, bool, 2 more]]`

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

                - `str`

                - `float`

                - `bool`

                - `List[object]`

            - `logical_operators: Optional[List[Literal["AND", "OR"]]]`

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

              - `"AND"`

              - `"OR"`

          - `group_by: Optional[List[str]]`

            Columns to group by

          - `latest_only: Optional[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: Optional[int]`

            Max rows to return

          - `order_by: Optional[List[OrderBy]]`

            Sort order

            - `column: str`

              Column name to sort by

            - `direction: Optional[Literal["ASC", "DESC"]]`

              Sort direction

              - `"ASC"`

              - `"DESC"`

            - `source: Optional[str]`

              Column source: 'data' or 'task_result_cache'

        - `class MetricQuery: …`

          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: List[SelectItem]`

            - `expression: Expression`

              Reference to a column from evaluation_items.data

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

            - `alias: Optional[str]`

              Optional alias for the selected item

          - `evaluation_ids: Optional[List[str]]`

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

          - `filter: Optional[Filter]`

            Filter conditions (WHERE clause)

          - `latest_only: Optional[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: Optional[List[EvaluationDashboardWidget]]`

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

    - `id: str`

      Unique identifier of the widget

    - `account_id: str`

      Account that owns this widget

    - `created_at: datetime`

      When the widget was created

    - `title: str`

      Widget title

    - `type: EvaluationWidgetTypeEnum`

      Widget type

    - `archived_at: Optional[datetime]`

      When the widget was archived (soft-deleted)

    - `config: Optional[Dict[str, object]]`

      Chart-specific display configuration

    - `object: Optional[Literal["evaluation_dashboard_widget"]]`

    - `query: Optional[Query]`

      Structured query AST for metric computation (SeriesQuery or MetricQuery)

### Example

```python
import os
from scale_gp_beta import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
evaluation_dashboard = client.evaluation_dashboards.retrieve(
    dashboard_id="dashboard_id",
)
print(evaluation_dashboard.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

`evaluation_dashboards.update(strdashboard_id, EvaluationDashboardUpdateParams**kwargs)  -> EvaluationDashboard`

**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

- `dashboard_id: str`

- `description: Optional[str]`

  Dashboard description

- `name: Optional[str]`

  Dashboard name

- `tags: Optional[Sequence[str]]`

  The tags associated with the entity

- `widget_order: Optional[Sequence[str]]`

  Ordered array of widget IDs (for reordering widgets)

### Returns

- `class EvaluationDashboard: …`

  - `id: str`

    Unique identifier of the dashboard

  - `account_id: str`

    Account that owns this dashboard

  - `created_at: datetime`

    When the dashboard was created

  - `created_by: Identity`

    The identity that created the entity.

    - `id: str`

    - `type: Literal["user", "service_account"]`

      - `"user"`

      - `"service_account"`

    - `object: Optional[Literal["identity"]]`

      - `"identity"`

  - `name: str`

    Dashboard name

  - `tags: Optional[List[str]]`

    The tags associated with the entity

  - `updated_at: datetime`

    When the dashboard was last updated

  - `archived_at: Optional[datetime]`

    When the dashboard was archived (soft-deleted)

  - `description: Optional[str]`

    Dashboard description

  - `error_message: Optional[str]`

    Error message if computation failed

  - `evaluation_group_id: Optional[str]`

    Evaluation group ID

  - `evaluation_id: Optional[str]`

    Evaluation ID

  - `object: Optional[Literal["evaluation_dashboard"]]`

    - `"evaluation_dashboard"`

  - `widget_order: Optional[List[str]]`

    Ordered array of widget IDs

  - `widget_results: Optional[List[EvaluationDashboardWidgetResult]]`

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

    - `id: str`

      Unique identifier of the widget result

    - `account_id: str`

      Account that owns this widget result

    - `computation_status: Literal["pending", "completed", "failed"]`

      Status of the computation

      - `"pending"`

      - `"completed"`

      - `"failed"`

    - `created_at: datetime`

      When the widget result was created

    - `widget_id: str`

      Unique identifier of the widget

    - `computation_job_id: Optional[str]`

      Temporal workflow ID or job ID for async computation tracking

    - `computed_at: Optional[datetime]`

      Timestamp when computation completed successfully

    - `computed_result: Optional[Dict[str, object]]`

      Cached computation results

    - `error_message: Optional[str]`

      Error message if computation failed

    - `evaluation_group_id: Optional[str]`

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

    - `evaluation_id: Optional[str]`

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

    - `object: Optional[Literal["evaluation_dashboard_widget_result"]]`

      - `"evaluation_dashboard_widget_result"`

    - `widget: Optional[EvaluationDashboardWidget]`

      Widget that this result is for

      - `id: str`

        Unique identifier of the widget

      - `account_id: str`

        Account that owns this widget

      - `created_at: datetime`

        When the widget was created

      - `title: str`

        Widget title

      - `type: EvaluationWidgetTypeEnum`

        Widget type

        - `"bar"`

        - `"histogram"`

        - `"donut"`

        - `"scatter"`

        - `"metric"`

        - `"table"`

        - `"markdown"`

        - `"heading"`

        - `"timeseries"`

      - `archived_at: Optional[datetime]`

        When the widget was archived (soft-deleted)

      - `config: Optional[Dict[str, object]]`

        Chart-specific display configuration

      - `object: Optional[Literal["evaluation_dashboard_widget"]]`

        - `"evaluation_dashboard_widget"`

      - `query: Optional[Query]`

        Structured query AST for metric computation (SeriesQuery or MetricQuery)

        - `class SeriesQuery: …`

          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: List[SelectItem]`

            - `expression: Expression`

              Reference to a column from evaluation_items.data

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

              - `class ExpressionColumn: …`

                Reference to a column from evaluation_items.data

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

                - `column: str`

                  Column name from evaluation_items.data

                - `source: Optional[str]`

                  Column source: 'data' or 'task_result_cache'

                - `type: Optional[Literal["COLUMN"]]`

                  - `"COLUMN"`

              - `class ExpressionAggregation: …`

                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: str`

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

                - `function: Literal["COUNT", "SUM", "AVG", 7 more]`

                  Supported aggregation functions

                  - `"COUNT"`

                  - `"SUM"`

                  - `"AVG"`

                  - `"MIN"`

                  - `"MAX"`

                  - `"STDDEV"`

                  - `"VARIANCE"`

                  - `"PERCENTILE"`

                  - `"COUNT_DISTINCT"`

                  - `"PERCENTAGE"`

                - `evaluation_ids: Optional[List[str]]`

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

                - `params: Optional[Dict[str, object]]`

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

                - `source: Optional[str]`

                  Column source: 'data' or 'task_result_cache'

                - `type: Optional[Literal["AGGREGATION"]]`

                  - `"AGGREGATION"`

            - `alias: Optional[str]`

              Optional alias for the selected item

          - `evaluation_ids: Optional[List[str]]`

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

          - `filter: Optional[Filter]`

            Filter conditions (WHERE clause)

            - `conditions: List[Condition]`

              - `column: str`

                Column name to filter on

              - `operator: Literal["=", "!=", ">", 9 more]`

                Comparison operator

                - `"="`

                - `"!="`

                - `">"`

                - `"<"`

                - `">="`

                - `"<="`

                - `"IN"`

                - `"NOT IN"`

                - `"LIKE"`

                - `"NOT LIKE"`

                - `"IS NULL"`

                - `"IS NOT NULL"`

              - `source: Optional[str]`

                Column source: 'data' or 'task_result_cache'

              - `value: Optional[Union[str, float, bool, 2 more]]`

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

                - `str`

                - `float`

                - `bool`

                - `List[object]`

            - `logical_operators: Optional[List[Literal["AND", "OR"]]]`

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

              - `"AND"`

              - `"OR"`

          - `group_by: Optional[List[str]]`

            Columns to group by

          - `latest_only: Optional[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: Optional[int]`

            Max rows to return

          - `order_by: Optional[List[OrderBy]]`

            Sort order

            - `column: str`

              Column name to sort by

            - `direction: Optional[Literal["ASC", "DESC"]]`

              Sort direction

              - `"ASC"`

              - `"DESC"`

            - `source: Optional[str]`

              Column source: 'data' or 'task_result_cache'

        - `class MetricQuery: …`

          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: List[SelectItem]`

            - `expression: Expression`

              Reference to a column from evaluation_items.data

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

            - `alias: Optional[str]`

              Optional alias for the selected item

          - `evaluation_ids: Optional[List[str]]`

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

          - `filter: Optional[Filter]`

            Filter conditions (WHERE clause)

          - `latest_only: Optional[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: Optional[List[EvaluationDashboardWidget]]`

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

    - `id: str`

      Unique identifier of the widget

    - `account_id: str`

      Account that owns this widget

    - `created_at: datetime`

      When the widget was created

    - `title: str`

      Widget title

    - `type: EvaluationWidgetTypeEnum`

      Widget type

    - `archived_at: Optional[datetime]`

      When the widget was archived (soft-deleted)

    - `config: Optional[Dict[str, object]]`

      Chart-specific display configuration

    - `object: Optional[Literal["evaluation_dashboard_widget"]]`

    - `query: Optional[Query]`

      Structured query AST for metric computation (SeriesQuery or MetricQuery)

### Example

```python
import os
from scale_gp_beta import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
evaluation_dashboard = client.evaluation_dashboards.update(
    dashboard_id="dashboard_id",
)
print(evaluation_dashboard.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

`evaluation_dashboards.archive(strdashboard_id)  -> EvaluationDashboard`

**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

- `dashboard_id: str`

### Returns

- `class EvaluationDashboard: …`

  - `id: str`

    Unique identifier of the dashboard

  - `account_id: str`

    Account that owns this dashboard

  - `created_at: datetime`

    When the dashboard was created

  - `created_by: Identity`

    The identity that created the entity.

    - `id: str`

    - `type: Literal["user", "service_account"]`

      - `"user"`

      - `"service_account"`

    - `object: Optional[Literal["identity"]]`

      - `"identity"`

  - `name: str`

    Dashboard name

  - `tags: Optional[List[str]]`

    The tags associated with the entity

  - `updated_at: datetime`

    When the dashboard was last updated

  - `archived_at: Optional[datetime]`

    When the dashboard was archived (soft-deleted)

  - `description: Optional[str]`

    Dashboard description

  - `error_message: Optional[str]`

    Error message if computation failed

  - `evaluation_group_id: Optional[str]`

    Evaluation group ID

  - `evaluation_id: Optional[str]`

    Evaluation ID

  - `object: Optional[Literal["evaluation_dashboard"]]`

    - `"evaluation_dashboard"`

  - `widget_order: Optional[List[str]]`

    Ordered array of widget IDs

  - `widget_results: Optional[List[EvaluationDashboardWidgetResult]]`

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

    - `id: str`

      Unique identifier of the widget result

    - `account_id: str`

      Account that owns this widget result

    - `computation_status: Literal["pending", "completed", "failed"]`

      Status of the computation

      - `"pending"`

      - `"completed"`

      - `"failed"`

    - `created_at: datetime`

      When the widget result was created

    - `widget_id: str`

      Unique identifier of the widget

    - `computation_job_id: Optional[str]`

      Temporal workflow ID or job ID for async computation tracking

    - `computed_at: Optional[datetime]`

      Timestamp when computation completed successfully

    - `computed_result: Optional[Dict[str, object]]`

      Cached computation results

    - `error_message: Optional[str]`

      Error message if computation failed

    - `evaluation_group_id: Optional[str]`

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

    - `evaluation_id: Optional[str]`

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

    - `object: Optional[Literal["evaluation_dashboard_widget_result"]]`

      - `"evaluation_dashboard_widget_result"`

    - `widget: Optional[EvaluationDashboardWidget]`

      Widget that this result is for

      - `id: str`

        Unique identifier of the widget

      - `account_id: str`

        Account that owns this widget

      - `created_at: datetime`

        When the widget was created

      - `title: str`

        Widget title

      - `type: EvaluationWidgetTypeEnum`

        Widget type

        - `"bar"`

        - `"histogram"`

        - `"donut"`

        - `"scatter"`

        - `"metric"`

        - `"table"`

        - `"markdown"`

        - `"heading"`

        - `"timeseries"`

      - `archived_at: Optional[datetime]`

        When the widget was archived (soft-deleted)

      - `config: Optional[Dict[str, object]]`

        Chart-specific display configuration

      - `object: Optional[Literal["evaluation_dashboard_widget"]]`

        - `"evaluation_dashboard_widget"`

      - `query: Optional[Query]`

        Structured query AST for metric computation (SeriesQuery or MetricQuery)

        - `class SeriesQuery: …`

          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: List[SelectItem]`

            - `expression: Expression`

              Reference to a column from evaluation_items.data

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

              - `class ExpressionColumn: …`

                Reference to a column from evaluation_items.data

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

                - `column: str`

                  Column name from evaluation_items.data

                - `source: Optional[str]`

                  Column source: 'data' or 'task_result_cache'

                - `type: Optional[Literal["COLUMN"]]`

                  - `"COLUMN"`

              - `class ExpressionAggregation: …`

                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: str`

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

                - `function: Literal["COUNT", "SUM", "AVG", 7 more]`

                  Supported aggregation functions

                  - `"COUNT"`

                  - `"SUM"`

                  - `"AVG"`

                  - `"MIN"`

                  - `"MAX"`

                  - `"STDDEV"`

                  - `"VARIANCE"`

                  - `"PERCENTILE"`

                  - `"COUNT_DISTINCT"`

                  - `"PERCENTAGE"`

                - `evaluation_ids: Optional[List[str]]`

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

                - `params: Optional[Dict[str, object]]`

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

                - `source: Optional[str]`

                  Column source: 'data' or 'task_result_cache'

                - `type: Optional[Literal["AGGREGATION"]]`

                  - `"AGGREGATION"`

            - `alias: Optional[str]`

              Optional alias for the selected item

          - `evaluation_ids: Optional[List[str]]`

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

          - `filter: Optional[Filter]`

            Filter conditions (WHERE clause)

            - `conditions: List[Condition]`

              - `column: str`

                Column name to filter on

              - `operator: Literal["=", "!=", ">", 9 more]`

                Comparison operator

                - `"="`

                - `"!="`

                - `">"`

                - `"<"`

                - `">="`

                - `"<="`

                - `"IN"`

                - `"NOT IN"`

                - `"LIKE"`

                - `"NOT LIKE"`

                - `"IS NULL"`

                - `"IS NOT NULL"`

              - `source: Optional[str]`

                Column source: 'data' or 'task_result_cache'

              - `value: Optional[Union[str, float, bool, 2 more]]`

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

                - `str`

                - `float`

                - `bool`

                - `List[object]`

            - `logical_operators: Optional[List[Literal["AND", "OR"]]]`

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

              - `"AND"`

              - `"OR"`

          - `group_by: Optional[List[str]]`

            Columns to group by

          - `latest_only: Optional[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: Optional[int]`

            Max rows to return

          - `order_by: Optional[List[OrderBy]]`

            Sort order

            - `column: str`

              Column name to sort by

            - `direction: Optional[Literal["ASC", "DESC"]]`

              Sort direction

              - `"ASC"`

              - `"DESC"`

            - `source: Optional[str]`

              Column source: 'data' or 'task_result_cache'

        - `class MetricQuery: …`

          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: List[SelectItem]`

            - `expression: Expression`

              Reference to a column from evaluation_items.data

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

            - `alias: Optional[str]`

              Optional alias for the selected item

          - `evaluation_ids: Optional[List[str]]`

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

          - `filter: Optional[Filter]`

            Filter conditions (WHERE clause)

          - `latest_only: Optional[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: Optional[List[EvaluationDashboardWidget]]`

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

    - `id: str`

      Unique identifier of the widget

    - `account_id: str`

      Account that owns this widget

    - `created_at: datetime`

      When the widget was created

    - `title: str`

      Widget title

    - `type: EvaluationWidgetTypeEnum`

      Widget type

    - `archived_at: Optional[datetime]`

      When the widget was archived (soft-deleted)

    - `config: Optional[Dict[str, object]]`

      Chart-specific display configuration

    - `object: Optional[Literal["evaluation_dashboard_widget"]]`

    - `query: Optional[Query]`

      Structured query AST for metric computation (SeriesQuery or MetricQuery)

### Example

```python
import os
from scale_gp_beta import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
evaluation_dashboard = client.evaluation_dashboards.archive(
    "dashboard_id",
)
print(evaluation_dashboard.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

- `class EvaluationDashboard: …`

  - `id: str`

    Unique identifier of the dashboard

  - `account_id: str`

    Account that owns this dashboard

  - `created_at: datetime`

    When the dashboard was created

  - `created_by: Identity`

    The identity that created the entity.

    - `id: str`

    - `type: Literal["user", "service_account"]`

      - `"user"`

      - `"service_account"`

    - `object: Optional[Literal["identity"]]`

      - `"identity"`

  - `name: str`

    Dashboard name

  - `tags: Optional[List[str]]`

    The tags associated with the entity

  - `updated_at: datetime`

    When the dashboard was last updated

  - `archived_at: Optional[datetime]`

    When the dashboard was archived (soft-deleted)

  - `description: Optional[str]`

    Dashboard description

  - `error_message: Optional[str]`

    Error message if computation failed

  - `evaluation_group_id: Optional[str]`

    Evaluation group ID

  - `evaluation_id: Optional[str]`

    Evaluation ID

  - `object: Optional[Literal["evaluation_dashboard"]]`

    - `"evaluation_dashboard"`

  - `widget_order: Optional[List[str]]`

    Ordered array of widget IDs

  - `widget_results: Optional[List[EvaluationDashboardWidgetResult]]`

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

    - `id: str`

      Unique identifier of the widget result

    - `account_id: str`

      Account that owns this widget result

    - `computation_status: Literal["pending", "completed", "failed"]`

      Status of the computation

      - `"pending"`

      - `"completed"`

      - `"failed"`

    - `created_at: datetime`

      When the widget result was created

    - `widget_id: str`

      Unique identifier of the widget

    - `computation_job_id: Optional[str]`

      Temporal workflow ID or job ID for async computation tracking

    - `computed_at: Optional[datetime]`

      Timestamp when computation completed successfully

    - `computed_result: Optional[Dict[str, object]]`

      Cached computation results

    - `error_message: Optional[str]`

      Error message if computation failed

    - `evaluation_group_id: Optional[str]`

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

    - `evaluation_id: Optional[str]`

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

    - `object: Optional[Literal["evaluation_dashboard_widget_result"]]`

      - `"evaluation_dashboard_widget_result"`

    - `widget: Optional[EvaluationDashboardWidget]`

      Widget that this result is for

      - `id: str`

        Unique identifier of the widget

      - `account_id: str`

        Account that owns this widget

      - `created_at: datetime`

        When the widget was created

      - `title: str`

        Widget title

      - `type: EvaluationWidgetTypeEnum`

        Widget type

        - `"bar"`

        - `"histogram"`

        - `"donut"`

        - `"scatter"`

        - `"metric"`

        - `"table"`

        - `"markdown"`

        - `"heading"`

        - `"timeseries"`

      - `archived_at: Optional[datetime]`

        When the widget was archived (soft-deleted)

      - `config: Optional[Dict[str, object]]`

        Chart-specific display configuration

      - `object: Optional[Literal["evaluation_dashboard_widget"]]`

        - `"evaluation_dashboard_widget"`

      - `query: Optional[Query]`

        Structured query AST for metric computation (SeriesQuery or MetricQuery)

        - `class SeriesQuery: …`

          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: List[SelectItem]`

            - `expression: Expression`

              Reference to a column from evaluation_items.data

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

              - `class ExpressionColumn: …`

                Reference to a column from evaluation_items.data

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

                - `column: str`

                  Column name from evaluation_items.data

                - `source: Optional[str]`

                  Column source: 'data' or 'task_result_cache'

                - `type: Optional[Literal["COLUMN"]]`

                  - `"COLUMN"`

              - `class ExpressionAggregation: …`

                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: str`

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

                - `function: Literal["COUNT", "SUM", "AVG", 7 more]`

                  Supported aggregation functions

                  - `"COUNT"`

                  - `"SUM"`

                  - `"AVG"`

                  - `"MIN"`

                  - `"MAX"`

                  - `"STDDEV"`

                  - `"VARIANCE"`

                  - `"PERCENTILE"`

                  - `"COUNT_DISTINCT"`

                  - `"PERCENTAGE"`

                - `evaluation_ids: Optional[List[str]]`

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

                - `params: Optional[Dict[str, object]]`

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

                - `source: Optional[str]`

                  Column source: 'data' or 'task_result_cache'

                - `type: Optional[Literal["AGGREGATION"]]`

                  - `"AGGREGATION"`

            - `alias: Optional[str]`

              Optional alias for the selected item

          - `evaluation_ids: Optional[List[str]]`

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

          - `filter: Optional[Filter]`

            Filter conditions (WHERE clause)

            - `conditions: List[Condition]`

              - `column: str`

                Column name to filter on

              - `operator: Literal["=", "!=", ">", 9 more]`

                Comparison operator

                - `"="`

                - `"!="`

                - `">"`

                - `"<"`

                - `">="`

                - `"<="`

                - `"IN"`

                - `"NOT IN"`

                - `"LIKE"`

                - `"NOT LIKE"`

                - `"IS NULL"`

                - `"IS NOT NULL"`

              - `source: Optional[str]`

                Column source: 'data' or 'task_result_cache'

              - `value: Optional[Union[str, float, bool, 2 more]]`

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

                - `str`

                - `float`

                - `bool`

                - `List[object]`

            - `logical_operators: Optional[List[Literal["AND", "OR"]]]`

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

              - `"AND"`

              - `"OR"`

          - `group_by: Optional[List[str]]`

            Columns to group by

          - `latest_only: Optional[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: Optional[int]`

            Max rows to return

          - `order_by: Optional[List[OrderBy]]`

            Sort order

            - `column: str`

              Column name to sort by

            - `direction: Optional[Literal["ASC", "DESC"]]`

              Sort direction

              - `"ASC"`

              - `"DESC"`

            - `source: Optional[str]`

              Column source: 'data' or 'task_result_cache'

        - `class MetricQuery: …`

          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: List[SelectItem]`

            - `expression: Expression`

              Reference to a column from evaluation_items.data

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

            - `alias: Optional[str]`

              Optional alias for the selected item

          - `evaluation_ids: Optional[List[str]]`

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

          - `filter: Optional[Filter]`

            Filter conditions (WHERE clause)

          - `latest_only: Optional[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: Optional[List[EvaluationDashboardWidget]]`

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

    - `id: str`

      Unique identifier of the widget

    - `account_id: str`

      Account that owns this widget

    - `created_at: datetime`

      When the widget was created

    - `title: str`

      Widget title

    - `type: EvaluationWidgetTypeEnum`

      Widget type

    - `archived_at: Optional[datetime]`

      When the widget was archived (soft-deleted)

    - `config: Optional[Dict[str, object]]`

      Chart-specific display configuration

    - `object: Optional[Literal["evaluation_dashboard_widget"]]`

    - `query: Optional[Query]`

      Structured query AST for metric computation (SeriesQuery or MetricQuery)

# Widgets

## Add Widget to Dashboard

`evaluation_dashboards.widgets.create(strdashboard_id, WidgetCreateParams**kwargs)  -> EvaluationDashboardWidgetWithResult`

**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

- `dashboard_id: str`

- `title: str`

  Widget title

- `type: EvaluationWidgetTypeEnum`

  Widget type

  - `"bar"`

  - `"histogram"`

  - `"donut"`

  - `"scatter"`

  - `"metric"`

  - `"table"`

  - `"markdown"`

  - `"heading"`

  - `"timeseries"`

- `config: Optional[Dict[str, object]]`

  Chart-specific display configuration

- `query: Optional[Query]`

  Structured query AST for metric computation (SeriesQuery or MetricQuery)

  - `class SeriesQuery: …`

    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: List[SelectItem]`

      - `expression: Expression`

        Reference to a column from evaluation_items.data

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

        - `class ExpressionColumn: …`

          Reference to a column from evaluation_items.data

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

          - `column: str`

            Column name from evaluation_items.data

          - `source: Optional[str]`

            Column source: 'data' or 'task_result_cache'

          - `type: Optional[Literal["COLUMN"]]`

            - `"COLUMN"`

        - `class ExpressionAggregation: …`

          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: str`

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

          - `function: Literal["COUNT", "SUM", "AVG", 7 more]`

            Supported aggregation functions

            - `"COUNT"`

            - `"SUM"`

            - `"AVG"`

            - `"MIN"`

            - `"MAX"`

            - `"STDDEV"`

            - `"VARIANCE"`

            - `"PERCENTILE"`

            - `"COUNT_DISTINCT"`

            - `"PERCENTAGE"`

          - `evaluation_ids: Optional[List[str]]`

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

          - `params: Optional[Dict[str, object]]`

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

          - `source: Optional[str]`

            Column source: 'data' or 'task_result_cache'

          - `type: Optional[Literal["AGGREGATION"]]`

            - `"AGGREGATION"`

      - `alias: Optional[str]`

        Optional alias for the selected item

    - `evaluation_ids: Optional[List[str]]`

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

    - `filter: Optional[Filter]`

      Filter conditions (WHERE clause)

      - `conditions: List[Condition]`

        - `column: str`

          Column name to filter on

        - `operator: Literal["=", "!=", ">", 9 more]`

          Comparison operator

          - `"="`

          - `"!="`

          - `">"`

          - `"<"`

          - `">="`

          - `"<="`

          - `"IN"`

          - `"NOT IN"`

          - `"LIKE"`

          - `"NOT LIKE"`

          - `"IS NULL"`

          - `"IS NOT NULL"`

        - `source: Optional[str]`

          Column source: 'data' or 'task_result_cache'

        - `value: Optional[Union[str, float, bool, 2 more]]`

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

          - `str`

          - `float`

          - `bool`

          - `List[object]`

      - `logical_operators: Optional[List[Literal["AND", "OR"]]]`

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

        - `"AND"`

        - `"OR"`

    - `group_by: Optional[List[str]]`

      Columns to group by

    - `latest_only: Optional[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: Optional[int]`

      Max rows to return

    - `order_by: Optional[List[OrderBy]]`

      Sort order

      - `column: str`

        Column name to sort by

      - `direction: Optional[Literal["ASC", "DESC"]]`

        Sort direction

        - `"ASC"`

        - `"DESC"`

      - `source: Optional[str]`

        Column source: 'data' or 'task_result_cache'

  - `class MetricQuery: …`

    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: List[SelectItem]`

      - `expression: Expression`

        Reference to a column from evaluation_items.data

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

      - `alias: Optional[str]`

        Optional alias for the selected item

    - `evaluation_ids: Optional[List[str]]`

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

    - `filter: Optional[Filter]`

      Filter conditions (WHERE clause)

    - `latest_only: Optional[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

- `class EvaluationDashboardWidgetWithResult: …`

  Response model for widget creation - includes widget and computed result

  - `id: str`

    Unique identifier of the widget

  - `account_id: str`

    Account that owns this widget

  - `created_at: datetime`

    When the widget was created

  - `title: str`

    Widget title

  - `type: EvaluationWidgetTypeEnum`

    Widget type

    - `"bar"`

    - `"histogram"`

    - `"donut"`

    - `"scatter"`

    - `"metric"`

    - `"table"`

    - `"markdown"`

    - `"heading"`

    - `"timeseries"`

  - `config: Optional[Dict[str, object]]`

    Display configuration

  - `object: Optional[Literal["evaluation_widget"]]`

    - `"evaluation_widget"`

  - `query: Optional[Query]`

    Structured query AST for computation (SeriesQuery or MetricQuery)

    - `class SeriesQuery: …`

      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: List[SelectItem]`

        - `expression: Expression`

          Reference to a column from evaluation_items.data

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

          - `class ExpressionColumn: …`

            Reference to a column from evaluation_items.data

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

            - `column: str`

              Column name from evaluation_items.data

            - `source: Optional[str]`

              Column source: 'data' or 'task_result_cache'

            - `type: Optional[Literal["COLUMN"]]`

              - `"COLUMN"`

          - `class ExpressionAggregation: …`

            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: str`

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

            - `function: Literal["COUNT", "SUM", "AVG", 7 more]`

              Supported aggregation functions

              - `"COUNT"`

              - `"SUM"`

              - `"AVG"`

              - `"MIN"`

              - `"MAX"`

              - `"STDDEV"`

              - `"VARIANCE"`

              - `"PERCENTILE"`

              - `"COUNT_DISTINCT"`

              - `"PERCENTAGE"`

            - `evaluation_ids: Optional[List[str]]`

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

            - `params: Optional[Dict[str, object]]`

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

            - `source: Optional[str]`

              Column source: 'data' or 'task_result_cache'

            - `type: Optional[Literal["AGGREGATION"]]`

              - `"AGGREGATION"`

        - `alias: Optional[str]`

          Optional alias for the selected item

      - `evaluation_ids: Optional[List[str]]`

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

      - `filter: Optional[Filter]`

        Filter conditions (WHERE clause)

        - `conditions: List[Condition]`

          - `column: str`

            Column name to filter on

          - `operator: Literal["=", "!=", ">", 9 more]`

            Comparison operator

            - `"="`

            - `"!="`

            - `">"`

            - `"<"`

            - `">="`

            - `"<="`

            - `"IN"`

            - `"NOT IN"`

            - `"LIKE"`

            - `"NOT LIKE"`

            - `"IS NULL"`

            - `"IS NOT NULL"`

          - `source: Optional[str]`

            Column source: 'data' or 'task_result_cache'

          - `value: Optional[Union[str, float, bool, 2 more]]`

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

            - `str`

            - `float`

            - `bool`

            - `List[object]`

        - `logical_operators: Optional[List[Literal["AND", "OR"]]]`

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

          - `"AND"`

          - `"OR"`

      - `group_by: Optional[List[str]]`

        Columns to group by

      - `latest_only: Optional[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: Optional[int]`

        Max rows to return

      - `order_by: Optional[List[OrderBy]]`

        Sort order

        - `column: str`

          Column name to sort by

        - `direction: Optional[Literal["ASC", "DESC"]]`

          Sort direction

          - `"ASC"`

          - `"DESC"`

        - `source: Optional[str]`

          Column source: 'data' or 'task_result_cache'

    - `class MetricQuery: …`

      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: List[SelectItem]`

        - `expression: Expression`

          Reference to a column from evaluation_items.data

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

        - `alias: Optional[str]`

          Optional alias for the selected item

      - `evaluation_ids: Optional[List[str]]`

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

      - `filter: Optional[Filter]`

        Filter conditions (WHERE clause)

      - `latest_only: Optional[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: Optional[EvaluationDashboardWidgetResultResponse]`

    Computed result for this widget

    - `id: str`

      Unique identifier of the widget result

    - `computation_status: str`

      Status: pending, completed, or failed

    - `widget_id: str`

      Widget ID this result belongs to

    - `computed_at: Optional[datetime]`

      When computation completed

    - `computed_result: Optional[Dict[str, object]]`

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

    - `error_message: Optional[str]`

      Error message if computation failed

### Example

```python
import os
from scale_gp_beta import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
evaluation_dashboard_widget_with_result = client.evaluation_dashboards.widgets.create(
    dashboard_id="dashboard_id",
    title="x",
    type="bar",
)
print(evaluation_dashboard_widget_with_result.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

`evaluation_dashboards.widgets.update(strwidget_id, WidgetUpdateParams**kwargs)  -> EvaluationDashboardWidgetWithResult`

**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

- `dashboard_id: str`

- `widget_id: str`

- `config: Optional[Dict[str, object]]`

  Chart-specific display configuration

- `query: Optional[Query]`

  Structured query AST for metric computation (SeriesQuery or MetricQuery)

  - `class SeriesQuery: …`

    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: List[SelectItem]`

      - `expression: Expression`

        Reference to a column from evaluation_items.data

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

        - `class ExpressionColumn: …`

          Reference to a column from evaluation_items.data

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

          - `column: str`

            Column name from evaluation_items.data

          - `source: Optional[str]`

            Column source: 'data' or 'task_result_cache'

          - `type: Optional[Literal["COLUMN"]]`

            - `"COLUMN"`

        - `class ExpressionAggregation: …`

          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: str`

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

          - `function: Literal["COUNT", "SUM", "AVG", 7 more]`

            Supported aggregation functions

            - `"COUNT"`

            - `"SUM"`

            - `"AVG"`

            - `"MIN"`

            - `"MAX"`

            - `"STDDEV"`

            - `"VARIANCE"`

            - `"PERCENTILE"`

            - `"COUNT_DISTINCT"`

            - `"PERCENTAGE"`

          - `evaluation_ids: Optional[List[str]]`

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

          - `params: Optional[Dict[str, object]]`

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

          - `source: Optional[str]`

            Column source: 'data' or 'task_result_cache'

          - `type: Optional[Literal["AGGREGATION"]]`

            - `"AGGREGATION"`

      - `alias: Optional[str]`

        Optional alias for the selected item

    - `evaluation_ids: Optional[List[str]]`

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

    - `filter: Optional[Filter]`

      Filter conditions (WHERE clause)

      - `conditions: List[Condition]`

        - `column: str`

          Column name to filter on

        - `operator: Literal["=", "!=", ">", 9 more]`

          Comparison operator

          - `"="`

          - `"!="`

          - `">"`

          - `"<"`

          - `">="`

          - `"<="`

          - `"IN"`

          - `"NOT IN"`

          - `"LIKE"`

          - `"NOT LIKE"`

          - `"IS NULL"`

          - `"IS NOT NULL"`

        - `source: Optional[str]`

          Column source: 'data' or 'task_result_cache'

        - `value: Optional[Union[str, float, bool, 2 more]]`

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

          - `str`

          - `float`

          - `bool`

          - `List[object]`

      - `logical_operators: Optional[List[Literal["AND", "OR"]]]`

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

        - `"AND"`

        - `"OR"`

    - `group_by: Optional[List[str]]`

      Columns to group by

    - `latest_only: Optional[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: Optional[int]`

      Max rows to return

    - `order_by: Optional[List[OrderBy]]`

      Sort order

      - `column: str`

        Column name to sort by

      - `direction: Optional[Literal["ASC", "DESC"]]`

        Sort direction

        - `"ASC"`

        - `"DESC"`

      - `source: Optional[str]`

        Column source: 'data' or 'task_result_cache'

  - `class MetricQuery: …`

    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: List[SelectItem]`

      - `expression: Expression`

        Reference to a column from evaluation_items.data

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

      - `alias: Optional[str]`

        Optional alias for the selected item

    - `evaluation_ids: Optional[List[str]]`

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

    - `filter: Optional[Filter]`

      Filter conditions (WHERE clause)

    - `latest_only: Optional[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: Optional[str]`

  Widget title

### Returns

- `class EvaluationDashboardWidgetWithResult: …`

  Response model for widget creation - includes widget and computed result

  - `id: str`

    Unique identifier of the widget

  - `account_id: str`

    Account that owns this widget

  - `created_at: datetime`

    When the widget was created

  - `title: str`

    Widget title

  - `type: EvaluationWidgetTypeEnum`

    Widget type

    - `"bar"`

    - `"histogram"`

    - `"donut"`

    - `"scatter"`

    - `"metric"`

    - `"table"`

    - `"markdown"`

    - `"heading"`

    - `"timeseries"`

  - `config: Optional[Dict[str, object]]`

    Display configuration

  - `object: Optional[Literal["evaluation_widget"]]`

    - `"evaluation_widget"`

  - `query: Optional[Query]`

    Structured query AST for computation (SeriesQuery or MetricQuery)

    - `class SeriesQuery: …`

      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: List[SelectItem]`

        - `expression: Expression`

          Reference to a column from evaluation_items.data

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

          - `class ExpressionColumn: …`

            Reference to a column from evaluation_items.data

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

            - `column: str`

              Column name from evaluation_items.data

            - `source: Optional[str]`

              Column source: 'data' or 'task_result_cache'

            - `type: Optional[Literal["COLUMN"]]`

              - `"COLUMN"`

          - `class ExpressionAggregation: …`

            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: str`

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

            - `function: Literal["COUNT", "SUM", "AVG", 7 more]`

              Supported aggregation functions

              - `"COUNT"`

              - `"SUM"`

              - `"AVG"`

              - `"MIN"`

              - `"MAX"`

              - `"STDDEV"`

              - `"VARIANCE"`

              - `"PERCENTILE"`

              - `"COUNT_DISTINCT"`

              - `"PERCENTAGE"`

            - `evaluation_ids: Optional[List[str]]`

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

            - `params: Optional[Dict[str, object]]`

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

            - `source: Optional[str]`

              Column source: 'data' or 'task_result_cache'

            - `type: Optional[Literal["AGGREGATION"]]`

              - `"AGGREGATION"`

        - `alias: Optional[str]`

          Optional alias for the selected item

      - `evaluation_ids: Optional[List[str]]`

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

      - `filter: Optional[Filter]`

        Filter conditions (WHERE clause)

        - `conditions: List[Condition]`

          - `column: str`

            Column name to filter on

          - `operator: Literal["=", "!=", ">", 9 more]`

            Comparison operator

            - `"="`

            - `"!="`

            - `">"`

            - `"<"`

            - `">="`

            - `"<="`

            - `"IN"`

            - `"NOT IN"`

            - `"LIKE"`

            - `"NOT LIKE"`

            - `"IS NULL"`

            - `"IS NOT NULL"`

          - `source: Optional[str]`

            Column source: 'data' or 'task_result_cache'

          - `value: Optional[Union[str, float, bool, 2 more]]`

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

            - `str`

            - `float`

            - `bool`

            - `List[object]`

        - `logical_operators: Optional[List[Literal["AND", "OR"]]]`

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

          - `"AND"`

          - `"OR"`

      - `group_by: Optional[List[str]]`

        Columns to group by

      - `latest_only: Optional[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: Optional[int]`

        Max rows to return

      - `order_by: Optional[List[OrderBy]]`

        Sort order

        - `column: str`

          Column name to sort by

        - `direction: Optional[Literal["ASC", "DESC"]]`

          Sort direction

          - `"ASC"`

          - `"DESC"`

        - `source: Optional[str]`

          Column source: 'data' or 'task_result_cache'

    - `class MetricQuery: …`

      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: List[SelectItem]`

        - `expression: Expression`

          Reference to a column from evaluation_items.data

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

        - `alias: Optional[str]`

          Optional alias for the selected item

      - `evaluation_ids: Optional[List[str]]`

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

      - `filter: Optional[Filter]`

        Filter conditions (WHERE clause)

      - `latest_only: Optional[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: Optional[EvaluationDashboardWidgetResultResponse]`

    Computed result for this widget

    - `id: str`

      Unique identifier of the widget result

    - `computation_status: str`

      Status: pending, completed, or failed

    - `widget_id: str`

      Widget ID this result belongs to

    - `computed_at: Optional[datetime]`

      When computation completed

    - `computed_result: Optional[Dict[str, object]]`

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

    - `error_message: Optional[str]`

      Error message if computation failed

### Example

```python
import os
from scale_gp_beta import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
evaluation_dashboard_widget_with_result = client.evaluation_dashboards.widgets.update(
    widget_id="widget_id",
    dashboard_id="dashboard_id",
)
print(evaluation_dashboard_widget_with_result.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

`evaluation_dashboards.widgets.remove(strwidget_id, WidgetRemoveParams**kwargs)`

**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

- `dashboard_id: str`

- `widget_id: str`

### Example

```python
import os
from scale_gp_beta import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
client.evaluation_dashboards.widgets.remove(
    widget_id="widget_id",
    dashboard_id="dashboard_id",
)
```

## Domain Types

### Evaluation Dashboard Widget

- `class EvaluationDashboardWidget: …`

  - `id: str`

    Unique identifier of the widget

  - `account_id: str`

    Account that owns this widget

  - `created_at: datetime`

    When the widget was created

  - `title: str`

    Widget title

  - `type: EvaluationWidgetTypeEnum`

    Widget type

    - `"bar"`

    - `"histogram"`

    - `"donut"`

    - `"scatter"`

    - `"metric"`

    - `"table"`

    - `"markdown"`

    - `"heading"`

    - `"timeseries"`

  - `archived_at: Optional[datetime]`

    When the widget was archived (soft-deleted)

  - `config: Optional[Dict[str, object]]`

    Chart-specific display configuration

  - `object: Optional[Literal["evaluation_dashboard_widget"]]`

    - `"evaluation_dashboard_widget"`

  - `query: Optional[Query]`

    Structured query AST for metric computation (SeriesQuery or MetricQuery)

    - `class SeriesQuery: …`

      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: List[SelectItem]`

        - `expression: Expression`

          Reference to a column from evaluation_items.data

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

          - `class ExpressionColumn: …`

            Reference to a column from evaluation_items.data

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

            - `column: str`

              Column name from evaluation_items.data

            - `source: Optional[str]`

              Column source: 'data' or 'task_result_cache'

            - `type: Optional[Literal["COLUMN"]]`

              - `"COLUMN"`

          - `class ExpressionAggregation: …`

            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: str`

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

            - `function: Literal["COUNT", "SUM", "AVG", 7 more]`

              Supported aggregation functions

              - `"COUNT"`

              - `"SUM"`

              - `"AVG"`

              - `"MIN"`

              - `"MAX"`

              - `"STDDEV"`

              - `"VARIANCE"`

              - `"PERCENTILE"`

              - `"COUNT_DISTINCT"`

              - `"PERCENTAGE"`

            - `evaluation_ids: Optional[List[str]]`

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

            - `params: Optional[Dict[str, object]]`

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

            - `source: Optional[str]`

              Column source: 'data' or 'task_result_cache'

            - `type: Optional[Literal["AGGREGATION"]]`

              - `"AGGREGATION"`

        - `alias: Optional[str]`

          Optional alias for the selected item

      - `evaluation_ids: Optional[List[str]]`

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

      - `filter: Optional[Filter]`

        Filter conditions (WHERE clause)

        - `conditions: List[Condition]`

          - `column: str`

            Column name to filter on

          - `operator: Literal["=", "!=", ">", 9 more]`

            Comparison operator

            - `"="`

            - `"!="`

            - `">"`

            - `"<"`

            - `">="`

            - `"<="`

            - `"IN"`

            - `"NOT IN"`

            - `"LIKE"`

            - `"NOT LIKE"`

            - `"IS NULL"`

            - `"IS NOT NULL"`

          - `source: Optional[str]`

            Column source: 'data' or 'task_result_cache'

          - `value: Optional[Union[str, float, bool, 2 more]]`

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

            - `str`

            - `float`

            - `bool`

            - `List[object]`

        - `logical_operators: Optional[List[Literal["AND", "OR"]]]`

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

          - `"AND"`

          - `"OR"`

      - `group_by: Optional[List[str]]`

        Columns to group by

      - `latest_only: Optional[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: Optional[int]`

        Max rows to return

      - `order_by: Optional[List[OrderBy]]`

        Sort order

        - `column: str`

          Column name to sort by

        - `direction: Optional[Literal["ASC", "DESC"]]`

          Sort direction

          - `"ASC"`

          - `"DESC"`

        - `source: Optional[str]`

          Column source: 'data' or 'task_result_cache'

    - `class MetricQuery: …`

      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: List[SelectItem]`

        - `expression: Expression`

          Reference to a column from evaluation_items.data

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

        - `alias: Optional[str]`

          Optional alias for the selected item

      - `evaluation_ids: Optional[List[str]]`

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

      - `filter: Optional[Filter]`

        Filter conditions (WHERE clause)

      - `latest_only: Optional[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

- `class EvaluationDashboardWidgetResult: …`

  - `id: str`

    Unique identifier of the widget result

  - `account_id: str`

    Account that owns this widget result

  - `computation_status: Literal["pending", "completed", "failed"]`

    Status of the computation

    - `"pending"`

    - `"completed"`

    - `"failed"`

  - `created_at: datetime`

    When the widget result was created

  - `widget_id: str`

    Unique identifier of the widget

  - `computation_job_id: Optional[str]`

    Temporal workflow ID or job ID for async computation tracking

  - `computed_at: Optional[datetime]`

    Timestamp when computation completed successfully

  - `computed_result: Optional[Dict[str, object]]`

    Cached computation results

  - `error_message: Optional[str]`

    Error message if computation failed

  - `evaluation_group_id: Optional[str]`

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

  - `evaluation_id: Optional[str]`

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

  - `object: Optional[Literal["evaluation_dashboard_widget_result"]]`

    - `"evaluation_dashboard_widget_result"`

  - `widget: Optional[EvaluationDashboardWidget]`

    Widget that this result is for

    - `id: str`

      Unique identifier of the widget

    - `account_id: str`

      Account that owns this widget

    - `created_at: datetime`

      When the widget was created

    - `title: str`

      Widget title

    - `type: EvaluationWidgetTypeEnum`

      Widget type

      - `"bar"`

      - `"histogram"`

      - `"donut"`

      - `"scatter"`

      - `"metric"`

      - `"table"`

      - `"markdown"`

      - `"heading"`

      - `"timeseries"`

    - `archived_at: Optional[datetime]`

      When the widget was archived (soft-deleted)

    - `config: Optional[Dict[str, object]]`

      Chart-specific display configuration

    - `object: Optional[Literal["evaluation_dashboard_widget"]]`

      - `"evaluation_dashboard_widget"`

    - `query: Optional[Query]`

      Structured query AST for metric computation (SeriesQuery or MetricQuery)

      - `class SeriesQuery: …`

        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: List[SelectItem]`

          - `expression: Expression`

            Reference to a column from evaluation_items.data

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

            - `class ExpressionColumn: …`

              Reference to a column from evaluation_items.data

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

              - `column: str`

                Column name from evaluation_items.data

              - `source: Optional[str]`

                Column source: 'data' or 'task_result_cache'

              - `type: Optional[Literal["COLUMN"]]`

                - `"COLUMN"`

            - `class ExpressionAggregation: …`

              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: str`

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

              - `function: Literal["COUNT", "SUM", "AVG", 7 more]`

                Supported aggregation functions

                - `"COUNT"`

                - `"SUM"`

                - `"AVG"`

                - `"MIN"`

                - `"MAX"`

                - `"STDDEV"`

                - `"VARIANCE"`

                - `"PERCENTILE"`

                - `"COUNT_DISTINCT"`

                - `"PERCENTAGE"`

              - `evaluation_ids: Optional[List[str]]`

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

              - `params: Optional[Dict[str, object]]`

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

              - `source: Optional[str]`

                Column source: 'data' or 'task_result_cache'

              - `type: Optional[Literal["AGGREGATION"]]`

                - `"AGGREGATION"`

          - `alias: Optional[str]`

            Optional alias for the selected item

        - `evaluation_ids: Optional[List[str]]`

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

        - `filter: Optional[Filter]`

          Filter conditions (WHERE clause)

          - `conditions: List[Condition]`

            - `column: str`

              Column name to filter on

            - `operator: Literal["=", "!=", ">", 9 more]`

              Comparison operator

              - `"="`

              - `"!="`

              - `">"`

              - `"<"`

              - `">="`

              - `"<="`

              - `"IN"`

              - `"NOT IN"`

              - `"LIKE"`

              - `"NOT LIKE"`

              - `"IS NULL"`

              - `"IS NOT NULL"`

            - `source: Optional[str]`

              Column source: 'data' or 'task_result_cache'

            - `value: Optional[Union[str, float, bool, 2 more]]`

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

              - `str`

              - `float`

              - `bool`

              - `List[object]`

          - `logical_operators: Optional[List[Literal["AND", "OR"]]]`

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

            - `"AND"`

            - `"OR"`

        - `group_by: Optional[List[str]]`

          Columns to group by

        - `latest_only: Optional[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: Optional[int]`

          Max rows to return

        - `order_by: Optional[List[OrderBy]]`

          Sort order

          - `column: str`

            Column name to sort by

          - `direction: Optional[Literal["ASC", "DESC"]]`

            Sort direction

            - `"ASC"`

            - `"DESC"`

          - `source: Optional[str]`

            Column source: 'data' or 'task_result_cache'

      - `class MetricQuery: …`

        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: List[SelectItem]`

          - `expression: Expression`

            Reference to a column from evaluation_items.data

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

          - `alias: Optional[str]`

            Optional alias for the selected item

        - `evaluation_ids: Optional[List[str]]`

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

        - `filter: Optional[Filter]`

          Filter conditions (WHERE clause)

        - `latest_only: Optional[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

- `class EvaluationDashboardWidgetResultResponse: …`

  Computed result for a widget - used in widget creation response

  - `id: str`

    Unique identifier of the widget result

  - `computation_status: str`

    Status: pending, completed, or failed

  - `widget_id: str`

    Widget ID this result belongs to

  - `computed_at: Optional[datetime]`

    When computation completed

  - `computed_result: Optional[Dict[str, object]]`

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

  - `error_message: Optional[str]`

    Error message if computation failed

### Evaluation Dashboard Widget With Result

- `class EvaluationDashboardWidgetWithResult: …`

  Response model for widget creation - includes widget and computed result

  - `id: str`

    Unique identifier of the widget

  - `account_id: str`

    Account that owns this widget

  - `created_at: datetime`

    When the widget was created

  - `title: str`

    Widget title

  - `type: EvaluationWidgetTypeEnum`

    Widget type

    - `"bar"`

    - `"histogram"`

    - `"donut"`

    - `"scatter"`

    - `"metric"`

    - `"table"`

    - `"markdown"`

    - `"heading"`

    - `"timeseries"`

  - `config: Optional[Dict[str, object]]`

    Display configuration

  - `object: Optional[Literal["evaluation_widget"]]`

    - `"evaluation_widget"`

  - `query: Optional[Query]`

    Structured query AST for computation (SeriesQuery or MetricQuery)

    - `class SeriesQuery: …`

      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: List[SelectItem]`

        - `expression: Expression`

          Reference to a column from evaluation_items.data

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

          - `class ExpressionColumn: …`

            Reference to a column from evaluation_items.data

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

            - `column: str`

              Column name from evaluation_items.data

            - `source: Optional[str]`

              Column source: 'data' or 'task_result_cache'

            - `type: Optional[Literal["COLUMN"]]`

              - `"COLUMN"`

          - `class ExpressionAggregation: …`

            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: str`

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

            - `function: Literal["COUNT", "SUM", "AVG", 7 more]`

              Supported aggregation functions

              - `"COUNT"`

              - `"SUM"`

              - `"AVG"`

              - `"MIN"`

              - `"MAX"`

              - `"STDDEV"`

              - `"VARIANCE"`

              - `"PERCENTILE"`

              - `"COUNT_DISTINCT"`

              - `"PERCENTAGE"`

            - `evaluation_ids: Optional[List[str]]`

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

            - `params: Optional[Dict[str, object]]`

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

            - `source: Optional[str]`

              Column source: 'data' or 'task_result_cache'

            - `type: Optional[Literal["AGGREGATION"]]`

              - `"AGGREGATION"`

        - `alias: Optional[str]`

          Optional alias for the selected item

      - `evaluation_ids: Optional[List[str]]`

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

      - `filter: Optional[Filter]`

        Filter conditions (WHERE clause)

        - `conditions: List[Condition]`

          - `column: str`

            Column name to filter on

          - `operator: Literal["=", "!=", ">", 9 more]`

            Comparison operator

            - `"="`

            - `"!="`

            - `">"`

            - `"<"`

            - `">="`

            - `"<="`

            - `"IN"`

            - `"NOT IN"`

            - `"LIKE"`

            - `"NOT LIKE"`

            - `"IS NULL"`

            - `"IS NOT NULL"`

          - `source: Optional[str]`

            Column source: 'data' or 'task_result_cache'

          - `value: Optional[Union[str, float, bool, 2 more]]`

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

            - `str`

            - `float`

            - `bool`

            - `List[object]`

        - `logical_operators: Optional[List[Literal["AND", "OR"]]]`

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

          - `"AND"`

          - `"OR"`

      - `group_by: Optional[List[str]]`

        Columns to group by

      - `latest_only: Optional[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: Optional[int]`

        Max rows to return

      - `order_by: Optional[List[OrderBy]]`

        Sort order

        - `column: str`

          Column name to sort by

        - `direction: Optional[Literal["ASC", "DESC"]]`

          Sort direction

          - `"ASC"`

          - `"DESC"`

        - `source: Optional[str]`

          Column source: 'data' or 'task_result_cache'

    - `class MetricQuery: …`

      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: List[SelectItem]`

        - `expression: Expression`

          Reference to a column from evaluation_items.data

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

        - `alias: Optional[str]`

          Optional alias for the selected item

      - `evaluation_ids: Optional[List[str]]`

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

      - `filter: Optional[Filter]`

        Filter conditions (WHERE clause)

      - `latest_only: Optional[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: Optional[EvaluationDashboardWidgetResultResponse]`

    Computed result for this widget

    - `id: str`

      Unique identifier of the widget result

    - `computation_status: str`

      Status: pending, completed, or failed

    - `widget_id: str`

      Widget ID this result belongs to

    - `computed_at: Optional[datetime]`

      When computation completed

    - `computed_result: Optional[Dict[str, object]]`

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

    - `error_message: Optional[str]`

      Error message if computation failed

### Evaluation Widget Type Enum

- `Literal["bar", "histogram", "donut", 6 more]`

  Widget types for dashboard visualizations

  - `"bar"`

  - `"histogram"`

  - `"donut"`

  - `"scatter"`

  - `"metric"`

  - `"table"`

  - `"markdown"`

  - `"heading"`

  - `"timeseries"`

### Filter

- `class Filter: …`

  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: List[Condition]`

    - `column: str`

      Column name to filter on

    - `operator: Literal["=", "!=", ">", 9 more]`

      Comparison operator

      - `"="`

      - `"!="`

      - `">"`

      - `"<"`

      - `">="`

      - `"<="`

      - `"IN"`

      - `"NOT IN"`

      - `"LIKE"`

      - `"NOT LIKE"`

      - `"IS NULL"`

      - `"IS NOT NULL"`

    - `source: Optional[str]`

      Column source: 'data' or 'task_result_cache'

    - `value: Optional[Union[str, float, bool, 2 more]]`

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

      - `str`

      - `float`

      - `bool`

      - `List[object]`

  - `logical_operators: Optional[List[Literal["AND", "OR"]]]`

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

    - `"AND"`

    - `"OR"`

### Metric Query

- `class MetricQuery: …`

  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: List[SelectItem]`

    - `expression: Expression`

      Reference to a column from evaluation_items.data

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

      - `class ExpressionColumn: …`

        Reference to a column from evaluation_items.data

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

        - `column: str`

          Column name from evaluation_items.data

        - `source: Optional[str]`

          Column source: 'data' or 'task_result_cache'

        - `type: Optional[Literal["COLUMN"]]`

          - `"COLUMN"`

      - `class ExpressionAggregation: …`

        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: str`

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

        - `function: Literal["COUNT", "SUM", "AVG", 7 more]`

          Supported aggregation functions

          - `"COUNT"`

          - `"SUM"`

          - `"AVG"`

          - `"MIN"`

          - `"MAX"`

          - `"STDDEV"`

          - `"VARIANCE"`

          - `"PERCENTILE"`

          - `"COUNT_DISTINCT"`

          - `"PERCENTAGE"`

        - `evaluation_ids: Optional[List[str]]`

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

        - `params: Optional[Dict[str, object]]`

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

        - `source: Optional[str]`

          Column source: 'data' or 'task_result_cache'

        - `type: Optional[Literal["AGGREGATION"]]`

          - `"AGGREGATION"`

    - `alias: Optional[str]`

      Optional alias for the selected item

  - `evaluation_ids: Optional[List[str]]`

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

  - `filter: Optional[Filter]`

    Filter conditions (WHERE clause)

    - `conditions: List[Condition]`

      - `column: str`

        Column name to filter on

      - `operator: Literal["=", "!=", ">", 9 more]`

        Comparison operator

        - `"="`

        - `"!="`

        - `">"`

        - `"<"`

        - `">="`

        - `"<="`

        - `"IN"`

        - `"NOT IN"`

        - `"LIKE"`

        - `"NOT LIKE"`

        - `"IS NULL"`

        - `"IS NOT NULL"`

      - `source: Optional[str]`

        Column source: 'data' or 'task_result_cache'

      - `value: Optional[Union[str, float, bool, 2 more]]`

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

        - `str`

        - `float`

        - `bool`

        - `List[object]`

    - `logical_operators: Optional[List[Literal["AND", "OR"]]]`

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

      - `"AND"`

      - `"OR"`

  - `latest_only: Optional[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

- `class SelectItem: …`

  Column in SELECT clause

  - `expression: Expression`

    Reference to a column from evaluation_items.data

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

    - `class ExpressionColumn: …`

      Reference to a column from evaluation_items.data

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

      - `column: str`

        Column name from evaluation_items.data

      - `source: Optional[str]`

        Column source: 'data' or 'task_result_cache'

      - `type: Optional[Literal["COLUMN"]]`

        - `"COLUMN"`

    - `class ExpressionAggregation: …`

      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: str`

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

      - `function: Literal["COUNT", "SUM", "AVG", 7 more]`

        Supported aggregation functions

        - `"COUNT"`

        - `"SUM"`

        - `"AVG"`

        - `"MIN"`

        - `"MAX"`

        - `"STDDEV"`

        - `"VARIANCE"`

        - `"PERCENTILE"`

        - `"COUNT_DISTINCT"`

        - `"PERCENTAGE"`

      - `evaluation_ids: Optional[List[str]]`

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

      - `params: Optional[Dict[str, object]]`

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

      - `source: Optional[str]`

        Column source: 'data' or 'task_result_cache'

      - `type: Optional[Literal["AGGREGATION"]]`

        - `"AGGREGATION"`

  - `alias: Optional[str]`

    Optional alias for the selected item

### Series Query

- `class SeriesQuery: …`

  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: List[SelectItem]`

    - `expression: Expression`

      Reference to a column from evaluation_items.data

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

      - `class ExpressionColumn: …`

        Reference to a column from evaluation_items.data

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

        - `column: str`

          Column name from evaluation_items.data

        - `source: Optional[str]`

          Column source: 'data' or 'task_result_cache'

        - `type: Optional[Literal["COLUMN"]]`

          - `"COLUMN"`

      - `class ExpressionAggregation: …`

        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: str`

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

        - `function: Literal["COUNT", "SUM", "AVG", 7 more]`

          Supported aggregation functions

          - `"COUNT"`

          - `"SUM"`

          - `"AVG"`

          - `"MIN"`

          - `"MAX"`

          - `"STDDEV"`

          - `"VARIANCE"`

          - `"PERCENTILE"`

          - `"COUNT_DISTINCT"`

          - `"PERCENTAGE"`

        - `evaluation_ids: Optional[List[str]]`

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

        - `params: Optional[Dict[str, object]]`

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

        - `source: Optional[str]`

          Column source: 'data' or 'task_result_cache'

        - `type: Optional[Literal["AGGREGATION"]]`

          - `"AGGREGATION"`

    - `alias: Optional[str]`

      Optional alias for the selected item

  - `evaluation_ids: Optional[List[str]]`

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

  - `filter: Optional[Filter]`

    Filter conditions (WHERE clause)

    - `conditions: List[Condition]`

      - `column: str`

        Column name to filter on

      - `operator: Literal["=", "!=", ">", 9 more]`

        Comparison operator

        - `"="`

        - `"!="`

        - `">"`

        - `"<"`

        - `">="`

        - `"<="`

        - `"IN"`

        - `"NOT IN"`

        - `"LIKE"`

        - `"NOT LIKE"`

        - `"IS NULL"`

        - `"IS NOT NULL"`

      - `source: Optional[str]`

        Column source: 'data' or 'task_result_cache'

      - `value: Optional[Union[str, float, bool, 2 more]]`

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

        - `str`

        - `float`

        - `bool`

        - `List[object]`

    - `logical_operators: Optional[List[Literal["AND", "OR"]]]`

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

      - `"AND"`

      - `"OR"`

  - `group_by: Optional[List[str]]`

    Columns to group by

  - `latest_only: Optional[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: Optional[int]`

    Max rows to return

  - `order_by: Optional[List[OrderBy]]`

    Sort order

    - `column: str`

      Column name to sort by

    - `direction: Optional[Literal["ASC", "DESC"]]`

      Sort direction

      - `"ASC"`

      - `"DESC"`

    - `source: Optional[str]`

      Column source: 'data' or 'task_result_cache'
