import { APIResource } from "../../core/resource.js"; import * as Shared from "../shared.js"; import * as CompletionsAPI from "../chat/completions.js"; import * as WidgetsAPI from "./widgets.js"; import { EvaluationDashboardWidget, EvaluationDashboardWidgetResult, EvaluationDashboardWidgetResultResponse, EvaluationDashboardWidgetWithResult, EvaluationWidgetTypeEnum, Filter, MetricQuery, SelectItem, SeriesQuery, WidgetCreateParams, WidgetRemoveParams, WidgetUpdateParams, Widgets } from "./widgets.js"; import { APIPromise } from "../../core/api-promise.js"; import { CursorPage, type CursorPageParams, PagePromise } from "../../core/pagination.js"; import { RequestOptions } from "../../internal/request-options.js"; export declare class EvaluationDashboards extends APIResource { widgets: WidgetsAPI.Widgets; /** * 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. */ create(body: EvaluationDashboardCreateParams, options?: RequestOptions): APIPromise; /** * 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. */ retrieve(dashboardID: string, query?: EvaluationDashboardRetrieveParams | null | undefined, options?: RequestOptions): APIPromise; /** * 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. */ update(dashboardID: string, body: EvaluationDashboardUpdateParams, options?: RequestOptions): APIPromise; /** * 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. */ list(query?: EvaluationDashboardListParams | null | undefined, options?: RequestOptions): PagePromise; /** * 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. */ archive(dashboardID: string, options?: RequestOptions): APIPromise; } export type EvaluationDashboardsCursorPage = CursorPage; export interface EvaluationDashboard { /** * Unique identifier of the dashboard */ id: string; /** * Account that owns this dashboard */ account_id: string; /** * When the dashboard was created */ created_at: string; /** * The identity that created the entity. */ created_by: Shared.Identity; /** * Dashboard name */ name: string; /** * The tags associated with the entity */ tags: Array | null; /** * When the dashboard was last updated */ updated_at: string; /** * When the dashboard was archived (soft-deleted) */ archived_at?: string; /** * Dashboard description */ description?: string; /** * Error message if computation failed */ error_message?: string; /** * Evaluation group ID */ evaluation_group_id?: string; /** * Evaluation ID */ evaluation_id?: string; object?: 'evaluation_dashboard'; /** * Ordered array of widget IDs */ widget_order?: Array; /** * Widget results for this dashboard. Populated with 'widget_results' view. */ widget_results?: Array; /** * Widgets associated with this dashboard. Populated with 'widgets' view. */ widgets?: Array; } export interface EvaluationDashboardCreateParams { /** * Dashboard name */ name: string; /** * Optional description of the dashboard */ description?: string; /** * Evaluation group ID (XOR with evaluation_id) */ evaluation_group_id?: string; /** * Evaluation ID (XOR with evaluation_group_id) */ evaluation_id?: string; /** * The tags associated with the entity */ tags?: Array; /** * Optional dashboard ID to use as template. Copies widget_order from template. */ template_dashboard_id?: string; /** * Ordered array of widget IDs to display on this dashboard */ widget_order?: Array; } export interface EvaluationDashboardRetrieveParams { include_archived?: boolean; /** * Optional relationships to include: 'widgets', 'widget_results' */ views?: Array<'widgets' | 'widget_results'>; } export interface EvaluationDashboardUpdateParams { /** * Dashboard description */ description?: string; /** * Dashboard name */ name?: string; /** * The tags associated with the entity */ tags?: Array; /** * Ordered array of widget IDs (for reordering widgets) */ widget_order?: Array; } export interface EvaluationDashboardListParams extends CursorPageParams { /** * Filter by creator user IDs */ created_by_ids?: Array; evaluation_group_id?: string; evaluation_id?: string; include_archived?: boolean; /** * Search in name and tags */ search?: string; sort_by?: string; sort_order?: CompletionsAPI.SortOrder; /** * Filter by tags (case-insensitive) */ tags?: Array; } export declare namespace EvaluationDashboards { export { type EvaluationDashboard as EvaluationDashboard, type EvaluationDashboardsCursorPage as EvaluationDashboardsCursorPage, type EvaluationDashboardCreateParams as EvaluationDashboardCreateParams, type EvaluationDashboardRetrieveParams as EvaluationDashboardRetrieveParams, type EvaluationDashboardUpdateParams as EvaluationDashboardUpdateParams, type EvaluationDashboardListParams as EvaluationDashboardListParams, }; export { Widgets as Widgets, type EvaluationDashboardWidget as EvaluationDashboardWidget, type EvaluationDashboardWidgetResult as EvaluationDashboardWidgetResult, type EvaluationDashboardWidgetResultResponse as EvaluationDashboardWidgetResultResponse, type EvaluationDashboardWidgetWithResult as EvaluationDashboardWidgetWithResult, type EvaluationWidgetTypeEnum as EvaluationWidgetTypeEnum, type Filter as Filter, type MetricQuery as MetricQuery, type SelectItem as SelectItem, type SeriesQuery as SeriesQuery, type WidgetCreateParams as WidgetCreateParams, type WidgetUpdateParams as WidgetUpdateParams, type WidgetRemoveParams as WidgetRemoveParams, }; } //# sourceMappingURL=evaluation-dashboards.d.ts.map