import { APIResource } from '../../core/resource.js'; import * as SessionsAPI from '../sessions/sessions.js'; import { APIPromise } from '../../core/api-promise.js'; import { RequestOptions } from '../../internal/request-options.js'; export declare class Tokens extends APIResource { /** * Create a new feedback ingest token. */ create(params: TokenCreateParams, options?: RequestOptions): APIPromise; /** * Create a new feedback with a token. */ retrieve(token: string, query?: TokenRetrieveParams | null | undefined, options?: RequestOptions): APIPromise; /** * Create a new feedback with a token. */ update(token: string, body: TokenUpdateParams, options?: RequestOptions): APIPromise; /** * List all feedback ingest tokens for a run. */ list(query: TokenListParams, options?: RequestOptions): APIPromise; } /** * Feedback ingest token create schema. */ export interface FeedbackIngestTokenCreateSchema { feedback_key: string; run_id: string; expires_at?: string | null; /** * Timedelta input. */ expires_in?: SessionsAPI.TimedeltaInput | null; feedback_config?: FeedbackIngestTokenCreateSchema.FeedbackConfig | null; } export declare namespace FeedbackIngestTokenCreateSchema { interface FeedbackConfig { /** * Enum for feedback types. */ type: 'continuous' | 'categorical' | 'freeform'; categories?: Array | null; max?: number | null; min?: number | null; } namespace FeedbackConfig { /** * Specific value and label pair for feedback */ interface Category { value: number; label?: string | null; } } } /** * Feedback ingest token schema. */ export interface FeedbackIngestTokenSchema { id: string; expires_at: string; feedback_key: string; url: string; } /** * Feedback ingest token schema. */ export type TokenCreateResponse = FeedbackIngestTokenSchema | Array; export type TokenRetrieveResponse = unknown; export type TokenUpdateResponse = unknown; export type TokenListResponse = Array; export type TokenCreateParams = TokenCreateParams.FeedbackIngestTokenCreateSchema | TokenCreateParams.Variant1; export declare namespace TokenCreateParams { interface FeedbackIngestTokenCreateSchema { feedback_key: string; run_id: string; expires_at?: string | null; /** * Timedelta input. */ expires_in?: SessionsAPI.TimedeltaInput | null; feedback_config?: FeedbackIngestTokenCreateSchema.FeedbackConfig | null; } namespace FeedbackIngestTokenCreateSchema { interface FeedbackConfig { /** * Enum for feedback types. */ type: 'continuous' | 'categorical' | 'freeform'; categories?: Array | null; max?: number | null; min?: number | null; } namespace FeedbackConfig { /** * Specific value and label pair for feedback */ interface Category { value: number; label?: string | null; } } } interface Variant1 { body: Array; } } export interface TokenRetrieveParams { comment?: string | null; correction?: string | null; score?: number | boolean | null; value?: number | boolean | string | null; } export interface TokenUpdateParams { comment?: string | null; correction?: { [key: string]: unknown; } | string | null; metadata?: { [key: string]: unknown; } | null; score?: number | boolean | null; value?: number | boolean | string | null; } export interface TokenListParams { run_id: string; } export declare namespace Tokens { export { type FeedbackIngestTokenCreateSchema as FeedbackIngestTokenCreateSchema, type FeedbackIngestTokenSchema as FeedbackIngestTokenSchema, type TokenCreateResponse as TokenCreateResponse, type TokenRetrieveResponse as TokenRetrieveResponse, type TokenUpdateResponse as TokenUpdateResponse, type TokenListResponse as TokenListResponse, type TokenCreateParams as TokenCreateParams, type TokenRetrieveParams as TokenRetrieveParams, type TokenUpdateParams as TokenUpdateParams, type TokenListParams as TokenListParams, }; }