/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { llmEvalsCancelRun } from "../funcs/llmEvalsCancelRun.js"; import { llmEvalsCreateRun } from "../funcs/llmEvalsCreateRun.js"; import { llmEvalsCreateSchedule } from "../funcs/llmEvalsCreateSchedule.js"; import { llmEvalsCreateSuite } from "../funcs/llmEvalsCreateSuite.js"; import { llmEvalsCreateSuiteVersion } from "../funcs/llmEvalsCreateSuiteVersion.js"; import { llmEvalsDeleteRun } from "../funcs/llmEvalsDeleteRun.js"; import { llmEvalsDeleteSchedule } from "../funcs/llmEvalsDeleteSchedule.js"; import { llmEvalsDeleteSuite } from "../funcs/llmEvalsDeleteSuite.js"; import { llmEvalsGetArtifacts } from "../funcs/llmEvalsGetArtifacts.js"; import { llmEvalsGetRun } from "../funcs/llmEvalsGetRun.js"; import { llmEvalsGetSampleAudio } from "../funcs/llmEvalsGetSampleAudio.js"; import { llmEvalsGetSchedule } from "../funcs/llmEvalsGetSchedule.js"; import { llmEvalsGetSuite } from "../funcs/llmEvalsGetSuite.js"; import { llmEvalsGetSuiteVersion } from "../funcs/llmEvalsGetSuiteVersion.js"; import { llmEvalsImportHistoricalResults } from "../funcs/llmEvalsImportHistoricalResults.js"; import { llmEvalsListRuns } from "../funcs/llmEvalsListRuns.js"; import { llmEvalsListSamples } from "../funcs/llmEvalsListSamples.js"; import { llmEvalsListScheduleRuns } from "../funcs/llmEvalsListScheduleRuns.js"; import { llmEvalsListSchedules } from "../funcs/llmEvalsListSchedules.js"; import { llmEvalsListSuiteLeaderboardRuns } from "../funcs/llmEvalsListSuiteLeaderboardRuns.js"; import { llmEvalsListSuites } from "../funcs/llmEvalsListSuites.js"; import { llmEvalsListSuiteVersions } from "../funcs/llmEvalsListSuiteVersions.js"; import { llmEvalsRerunFailedSamples } from "../funcs/llmEvalsRerunFailedSamples.js"; import { llmEvalsRetryFailedRun } from "../funcs/llmEvalsRetryFailedRun.js"; import { llmEvalsTriggerSchedule } from "../funcs/llmEvalsTriggerSchedule.js"; import { llmEvalsUpdateSchedule } from "../funcs/llmEvalsUpdateSchedule.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Evals extends ClientSDK { /** * Create an eval suite * * @remarks * Creates a team-scoped declarative eval suite. Dataset and Python grader files must be uploaded separately with purpose 'evals'. */ async createSuite( request: operations.CreateEvalSuiteRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsCreateSuite( this, request, options, )); } /** * List eval suites * * @remarks * Returns eval suites visible to the authenticated team context. */ async listSuites( request: operations.ListEvalSuitesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsListSuites( this, request, options, )); } /** * Get an eval suite * * @remarks * Retrieves an eval suite by ID. */ async getSuite( request: operations.GetEvalSuiteRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsGetSuite( this, request, options, )); } /** * Delete an eval suite * * @remarks * Soft-deletes an eval suite and all of its eval runs so they no longer appear in user-facing reads. */ async deleteSuite( request: operations.DeleteEvalSuiteRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsDeleteSuite( this, request, options, )); } /** * Create an eval suite version * * @remarks * Creates an immutable suite version. Use this endpoint for edits to an existing eval suite. */ async createSuiteVersion( request: operations.CreateEvalSuiteVersionRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsCreateSuiteVersion( this, request, options, )); } /** * List eval suite versions * * @remarks * Returns immutable versions for an eval suite, including each version manifest. */ async listSuiteVersions( request: operations.ListEvalSuiteVersionsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsListSuiteVersions( this, request, options, )); } /** * Get an eval suite version * * @remarks * Retrieves an immutable eval suite version and its manifest. */ async getSuiteVersion( request: operations.GetEvalSuiteVersionRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsGetSuiteVersion( this, request, options, )); } /** * List leaderboard runs for an eval suite * * @remarks * Returns each ranking group's most recent completed runs for a suite in one request, with the group assignments in `groups`. A group is (model, targeted task) for task_ids-restricted runs and (model) for unrestricted runs (task_id null). Build boards from `groups`, not from run.models/run.task_ids — a returned run may name models or tasks whose groups it did not rank in. `truncated: true` means a server ceiling trimmed the aggregate; whole runs are kept in (best rank, first model, first task, id) order, so every group's newest runs survive before any group's fallbacks and no group is dropped for being old. Resume a truncated board by passing `next_cursor` back as `cursor` and unioning the responses. See the evals docs for grouping rationale and cost characteristics. */ async listSuiteLeaderboardRuns( request: operations.ListEvalSuiteLeaderboardRunsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsListSuiteLeaderboardRuns( this, request, options, )); } /** * Create an eval run * * @remarks * Starts a durable eval run over the selected suite version, tasks, and models. */ async createRun( request: operations.CreateEvalRunRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsCreateRun( this, request, options, )); } /** * List eval runs * * @remarks * Returns eval runs visible to the authenticated team context. suite_version is a per-suite ordinal and must be paired with suite_id; supplying it alone returns 400. */ async listRuns( request: operations.ListEvalRunsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsListRuns( this, request, options, )); } /** * Get an eval run * * @remarks * Retrieves an eval run by ID. */ async getRun( request: operations.GetEvalRunRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsGetRun( this, request, options, )); } /** * Delete an eval run * * @remarks * Soft-deletes an eval run so it no longer appears in run lists, details, or score leaderboards. */ async deleteRun( request: operations.DeleteEvalRunRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsDeleteRun( this, request, options, )); } /** * Cancel an eval run * * @remarks * Requests cancellation for a queued or running eval run. */ async cancelRun( request: operations.CancelEvalRunRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsCancelRun( this, request, options, )); } /** * Rerun failed eval samples * * @remarks * Queues a completed eval run to retry only samples with sample status 'failed'. Retried samples keep the same run ID and sample IDs, replacing errored sample results in place. */ async rerunFailedSamples( request: operations.RerunFailedEvalSamplesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsRerunFailedSamples( this, request, options, )); } /** * Retry an eval run * * @remarks * Queues a failed or cancelled eval run to retry in place. Completed samples keep their results, generated-but-unscored cancelled samples resume at scoring, unfinished samples are requeued, and runs with no persisted samples are prepared from scratch with the same run ID. */ async retryFailedRun( request: operations.RetryFailedEvalRunRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsRetryFailedRun( this, request, options, )); } /** * List eval samples * * @remarks * Returns prompt, target, model output, extraction, score, and judge details for an eval run. */ async listSamples( request: operations.ListEvalSamplesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsListSamples( this, request, options, )); } /** * Get eval sample audio * * @remarks * Returns `{ object, audio, sample_index, task_id, model }` for a single transcription sample — the clip reference (a base64 `data:` URI or a URL) read from the un-redacted `dataset_row` (list responses redact inline `data:` blobs), plus the resolved task/model. Prefers the task's configured `audio_column`, falling back to a heuristic scan. The clip differs across tasks, so pass `task_id` when a run has more than one transcription task; if the index spans multiple tasks and `task_id` is omitted, returns 400 rather than guessing. `model` is optional (the clip is identical across models) and only extends the index prefix. Returns 404 when the sample or its audio is absent, 413 when the inline clip is too large. Returns 503 when object storage is briefly unreachable, as distinct from 404 for a clip that is genuinely gone. */ async getSampleAudio( request: operations.GetEvalSampleAudioRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsGetSampleAudio( this, request, options, )); } /** * Get eval run artifacts * * @remarks * Returns generated result and sample artifact file IDs for a completed eval run. */ async getArtifacts( request: operations.GetEvalArtifactsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsGetArtifacts( this, request, options, )); } /** * Import historical eval results from Hugging Face * * @remarks * Imports simplified historical samples.jsonl-style eval results from a Hugging Face dataset repository into a completed eval suite run shape. Aggregates are recomputed from samples and include canonical score metrics for leaderboards. */ async importHistoricalResults( request: operations.ImportHistoricalEvalResultsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsImportHistoricalResults( this, request, options, )); } /** * Create an eval schedule * * @remarks * Schedules an eval run to fire on a cron or interval cadence, with optional webhook notifications of run status. */ async createSchedule( request: operations.CreateEvalScheduleRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsCreateSchedule( this, request, options, )); } /** * List eval schedules * * @remarks * Returns eval schedules visible to the authenticated team context. */ async listSchedules( request: operations.ListEvalSchedulesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsListSchedules( this, request, options, )); } /** * Get an eval schedule * * @remarks * Retrieves an eval schedule by ID, including the next scheduled fire time from Temporal when resolvable. */ async getSchedule( request: operations.GetEvalScheduleRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsGetSchedule( this, request, options, )); } /** * Update an eval schedule * * @remarks * Updates an eval schedule's cadence, run config, webhook, overlap policy, or enabled state. */ async updateSchedule( request: operations.UpdateEvalScheduleRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsUpdateSchedule( this, request, options, )); } /** * Delete an eval schedule * * @remarks * Soft-deletes an eval schedule and removes its Temporal schedule. Historical runs are preserved. */ async deleteSchedule( request: operations.DeleteEvalScheduleRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsDeleteSchedule( this, request, options, )); } /** * Trigger an eval schedule now * * @remarks * Fires the schedule immediately, in addition to its normal cadence. */ async triggerSchedule( request: operations.TriggerEvalScheduleRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsTriggerSchedule( this, request, options, )); } /** * List runs created by an eval schedule * * @remarks * Returns eval runs that were created by the given schedule. suite_version may be used without suite_id here, since the schedule already pins the suite; supplying a suite_id that is not the schedule's returns 400. */ async listScheduleRuns( request: operations.ListEvalScheduleRunsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmEvalsListScheduleRuns( this, request, options, )); } }