import { APIResource } from "../../core/resource.mjs"; import * as Shared from "../shared.mjs"; import * as CompletionsAPI from "../chat/completions.mjs"; import * as CriteriaAPI from "./criteria.mjs"; import { Criteria, CriterionCreateParams, CriterionListVersionsParams, CriterionListVersionsResponse, CriterionUpdateParams, RubricCriteriaInput, RubricCriteriaResponse, RubricCriteriaSummaryResponse } from "./criteria.mjs"; import { APIPromise } from "../../core/api-promise.mjs"; import { CursorPage, type CursorPageParams, PagePromise } from "../../core/pagination.mjs"; import { RequestOptions } from "../../internal/request-options.mjs"; export declare class Rubrics extends APIResource { criteria: CriteriaAPI.Criteria; /** * Create a rubric, optionally with its initial criteria in the same request. * * The rubric is created for the caller's account at version 1. If the optional * `criteria` field is supplied it must contain at least one entry, and each entry * is created as a criterion attached to the new rubric; omit it to create an empty * rubric and add criteria later via the criteria endpoint. The response returns * the created rubric together with the full detail of any criteria created in this * call. */ create(body: RubricCreateParams, options?: RequestOptions): APIPromise; /** * Retrieve a single rubric with the full detail of its current criteria. * * Returns the latest version of the rubric along with all of its current * (latest-version) criteria in full — not the slim title/weight summary returned * by the list endpoint. Archived rubrics remain retrievable through this endpoint * even though they are hidden from the list endpoint. */ retrieve(rubricID: string, options?: RequestOptions): APIPromise; /** * Update a rubric's fields, or restore a previously archived rubric. * * The request body is a discriminated union. Send `{"restore": true}` to restore * an archived rubric (clearing its archived state); send any other field set (such * as `title` or `tags`) to update those fields, carrying forward any field not * supplied. Both paths are append-only and produce a new version of the rubric * rather than mutating the existing row. Updating the fields of an archived rubric * is rejected — restore it first. Restoring a rubric that is not archived is a * no-op that returns it unchanged without creating a new version. */ update(rubricID: string, params: RubricUpdateParams, options?: RequestOptions): APIPromise; /** * List the current account's rubrics, paginated. * * Only the latest version of each rubric is returned, and archived rubrics are * excluded (this endpoint has no option to include them). The optional `title` * filter matches as a case-insensitive substring, and the optional `tags` filter * narrows results to rubrics carrying the given tags. Each returned rubric carries * only a slim criteria summary (title and weight per criterion) rather than full * criteria; use the get-rubric endpoint to retrieve full criteria detail. */ list(query?: RubricListParams | null | undefined, options?: RequestOptions): PagePromise; /** * Archive a rubric (soft delete). * * This is a soft delete, not a permanent one: it records an archived timestamp on * the rubric while retaining the rubric and its version history, so it can later * be brought back via the restore variant of the update endpoint. An archived * rubric is hidden from the list endpoint but stays retrievable by id. The * rubric's criteria are left untouched — archiving does not cascade to or delete * them. Archiving a rubric that is already archived is rejected. */ archive(rubricID: string, options?: RequestOptions): APIPromise; } export type RubricResponsesCursorPage = CursorPage; export interface RestoreRequest { /** * Set to true to restore the entity from the database. */ restore: true; } export interface RubricResponse { id: string; created_at: string; /** * The identity that created the entity. */ created_by: Shared.Identity; /** * The tags associated with the entity */ tags: Array | null; title: string; version: number; archived_at?: string; /** * Full criteria on get, summary (title + weight) on list */ criteria?: Array; object?: 'rubric'; updated_at?: string; } export interface RubricArchiveResponse { id: string; deleted: boolean; object?: 'rubric'; } export interface RubricCreateParams { /** * The rubric title */ title: string; /** * Initial criteria to create with the rubric */ criteria?: Array; /** * The tags associated with the entity */ tags?: Array; } export interface RubricUpdateParams { rubric: RubricUpdateParams.PartialRubricRequestBase | RestoreRequest; } export declare namespace RubricUpdateParams { interface PartialRubricRequestBase { /** * The tags associated with the entity */ tags?: Array; /** * The rubric title */ title?: string; } } export interface RubricListParams extends CursorPageParams { sort_by?: string; sort_order?: CompletionsAPI.SortOrder; /** * Filter by tags */ tags?: Array; /** * Filter by title (case-insensitive) */ title?: string; } export declare namespace Rubrics { export { type RestoreRequest as RestoreRequest, type RubricResponse as RubricResponse, type RubricArchiveResponse as RubricArchiveResponse, type RubricResponsesCursorPage as RubricResponsesCursorPage, type RubricCreateParams as RubricCreateParams, type RubricUpdateParams as RubricUpdateParams, type RubricListParams as RubricListParams, }; export { Criteria as Criteria, type RubricCriteriaInput as RubricCriteriaInput, type RubricCriteriaResponse as RubricCriteriaResponse, type RubricCriteriaSummaryResponse as RubricCriteriaSummaryResponse, type CriterionListVersionsResponse as CriterionListVersionsResponse, type CriterionCreateParams as CriterionCreateParams, type CriterionUpdateParams as CriterionUpdateParams, type CriterionListVersionsParams as CriterionListVersionsParams, }; } //# sourceMappingURL=rubrics.d.mts.map