import { APIResource } from '../../core/resource.js'; import * as BulkAPI from './bulk.js'; import { Bulk, BulkCreateParams, BulkCreateResponse, BulkPatchAllParams, BulkPatchAllResponse } from './bulk.js'; import * as ValidateAPI from './validate.js'; import { ExampleValidationResult, Validate, ValidateBulkResponse } from './validate.js'; import { APIPromise } from '../../core/api-promise.js'; import { OffsetPaginationTopLevelArray, type OffsetPaginationTopLevelArrayParams, PagePromise } from '../../core/pagination.js'; import { type Uploadable } from '../../core/uploads.js'; import { RequestOptions } from '../../internal/request-options.js'; export declare class Examples extends APIResource { bulk: BulkAPI.Bulk; validate: ValidateAPI.Validate; /** * Create a new example. */ create(body: ExampleCreateParams, options?: RequestOptions): APIPromise; /** * Get a specific example. */ retrieve(exampleID: string, query?: ExampleRetrieveParams | null | undefined, options?: RequestOptions): APIPromise; /** * Update a specific example. */ update(exampleID: string, body: ExampleUpdateParams, options?: RequestOptions): APIPromise; /** * Get all examples by query params */ list(query?: ExampleListParams | null | undefined, options?: RequestOptions): PagePromise; /** * Soft delete an example. Only deletes the example in the 'latest' version of the * dataset. */ delete(exampleID: string, options?: RequestOptions): APIPromise; /** * Soft delete examples. Only deletes the examples in the 'latest' version of the * dataset. */ deleteAll(params: ExampleDeleteAllParams, options?: RequestOptions): APIPromise; /** * Count all examples by query params */ retrieveCount(query?: ExampleRetrieveCountParams | null | undefined, options?: RequestOptions): APIPromise; /** * Upload examples from a CSV file. * * Note: For non-csv upload, please use the POST * /v1/platform/datasets/{dataset_id}/examples endpoint which provides more * efficient upload. */ uploadFromCsv(datasetID: string, body: ExampleUploadFromCsvParams, options?: RequestOptions): APIPromise; } export type ExamplesOffsetPaginationTopLevelArray = OffsetPaginationTopLevelArray; export interface AttachmentsOperations { /** * Mapping of old attachment names to new names */ rename?: { [key: string]: string; }; /** * List of attachment names to keep */ retain?: Array; } /** * Example schema. */ export interface Example { id: string; dataset_id: string; inputs: { [key: string]: unknown; }; name: string; attachment_urls?: { [key: string]: unknown; } | null; created_at?: string; metadata?: { [key: string]: unknown; } | null; modified_at?: string | null; outputs?: { [key: string]: unknown; } | null; source_run_id?: string | null; } export type ExampleSelect = 'id' | 'created_at' | 'modified_at' | 'name' | 'dataset_id' | 'source_run_id' | 'metadata' | 'inputs' | 'outputs' | 'attachment_urls'; export type ExampleUpdateResponse = unknown; export type ExampleDeleteResponse = unknown; export type ExampleDeleteAllResponse = unknown; export type ExampleRetrieveCountResponse = number; export type ExampleUploadFromCsvResponse = Array; export interface ExampleCreateParams { dataset_id: string; id?: string | null; created_at?: string; inputs?: { [key: string]: unknown; } | null; metadata?: { [key: string]: unknown; } | null; outputs?: { [key: string]: unknown; } | null; source_run_id?: string | null; split?: Array | string | null; /** * Use Legacy Message Format for LLM runs */ use_legacy_message_format?: boolean; use_source_run_attachments?: Array; use_source_run_io?: boolean; } export interface ExampleRetrieveParams { /** * Only modifications made on or before this time are included. If None, the latest * version of the dataset is used. */ as_of?: (string & {}) | string; dataset?: string | null; } export interface ExampleUpdateParams { attachments_operations?: AttachmentsOperations | null; dataset_id?: string | null; inputs?: { [key: string]: unknown; } | null; metadata?: { [key: string]: unknown; } | null; outputs?: { [key: string]: unknown; } | null; overwrite?: boolean; split?: Array | string | null; } export interface ExampleListParams extends OffsetPaginationTopLevelArrayParams { id?: Array | null; /** * Only modifications made on or before this time are included. If None, the latest * version of the dataset is used. */ as_of?: (string & {}) | string; dataset?: string | null; descending?: boolean | null; filter?: string | null; full_text_contains?: Array | null; metadata?: string | null; order?: 'recent' | 'random' | 'recently_created' | 'id'; random_seed?: number | null; select?: Array; splits?: Array | null; } export interface ExampleDeleteAllParams { example_ids: Array; } export interface ExampleRetrieveCountParams { id?: Array | null; /** * Only modifications made on or before this time are included. If None, the latest * version of the dataset is used. */ as_of?: (string & {}) | string; dataset?: string | null; filter?: string | null; full_text_contains?: Array | null; metadata?: string | null; splits?: Array | null; } export interface ExampleUploadFromCsvParams { file: Uploadable; input_keys: Array; metadata_keys?: Array; output_keys?: Array; } export declare namespace Examples { export { type AttachmentsOperations as AttachmentsOperations, type Example as Example, type ExampleSelect as ExampleSelect, type ExampleUpdateResponse as ExampleUpdateResponse, type ExampleDeleteResponse as ExampleDeleteResponse, type ExampleDeleteAllResponse as ExampleDeleteAllResponse, type ExampleRetrieveCountResponse as ExampleRetrieveCountResponse, type ExampleUploadFromCsvResponse as ExampleUploadFromCsvResponse, type ExamplesOffsetPaginationTopLevelArray as ExamplesOffsetPaginationTopLevelArray, type ExampleCreateParams as ExampleCreateParams, type ExampleRetrieveParams as ExampleRetrieveParams, type ExampleUpdateParams as ExampleUpdateParams, type ExampleListParams as ExampleListParams, type ExampleDeleteAllParams as ExampleDeleteAllParams, type ExampleRetrieveCountParams as ExampleRetrieveCountParams, type ExampleUploadFromCsvParams as ExampleUploadFromCsvParams, }; export { Bulk as Bulk, type BulkCreateResponse as BulkCreateResponse, type BulkPatchAllResponse as BulkPatchAllResponse, type BulkCreateParams as BulkCreateParams, type BulkPatchAllParams as BulkPatchAllParams, }; export { Validate as Validate, type ExampleValidationResult as ExampleValidationResult, type ValidateBulkResponse as ValidateBulkResponse, }; }