{"version":3,"file":"index.mjs","sources":["../src/Applications/index.ts","../src/types.ts","../src/Calibrations/index.ts","../src/DatasetExports/index.ts","../src/DatasetItems/index.ts","../src/Datasets/index.ts","../src/FinetunedModels/index.ts","../src/Integrations/index.ts","../src/Labels/index.ts","../src/Projects/index.ts","../src/consts.ts","../src/RefuelBase/index.ts","../src/TaskModels/index.ts","../src/TaskRuns/index.ts","../src/Tasks/index.ts","../src/Taxonomies/index.ts","../src/TaxonomyLabels/index.ts","../src/Team/index.ts","../src/TeamModels/index.ts","../src/TeamUsage/index.ts","../src/Users/index.ts","../src/ApplicationUsage/index.ts","../src/TaskRunMetrics/index.ts","../src/utils.ts","../src/index.ts"],"sourcesContent":["import { RefuelBase } from \"../RefuelBase\";\nimport {\n    Application,\n    ApplicationCreateOptions,\n    ApplicationLabelOptions,\n    ApplicationLabelResponse,\n    ApplicationOutputAsync,\n    ApplicationOutputSync,\n    Dataset,\n} from \"../types\";\n\n/**\n * Handles operations related to applications.\n * This class is not intended to be instantiated directly.\n * Instead, access it through an instance of the Refuel class.\n */\nexport class Applications {\n    private readonly base: RefuelBase;\n\n    /** @internal */\n    constructor(base: RefuelBase) {\n        this.base = base;\n    }\n\n    /**\n     * Deploy a specific task as an application\n     *\n     * @example\n     * ```ts\n     * const application = await refuel.applications.create({\n     *     projectId,\n     *     taskId,\n     * });\n     * ```\n     */\n    async create(options: ApplicationCreateOptions): Promise<Application> {\n        const params = new URLSearchParams();\n        params.append(\"task_id\", options.taskId);\n\n        if (options.name) {\n            params.append(\"name\", options.name);\n        }\n\n        return this.base.request<Application>(\n            `/projects/${options.projectId}/applications?${params.toString()}`,\n            {\n                method: \"POST\",\n            }\n        );\n    }\n\n    /**\n     * Get an application by ID\n     *\n     * @example\n     * ```ts\n     * const application = await refuel.applications.get(applicationId);\n     * ```\n     */\n    async get(applicationId: string): Promise<Application> {\n        return this.base.request<Application>(`/applications/${applicationId}`);\n    }\n\n    /**\n     * List all applications\n     *\n     * @example\n     * ```ts\n     * const applications = await refuel.applications.list();\n     * ```\n     */\n    async list(projectId?: string): Promise<Application[]> {\n        const endpoint = projectId\n            ? `/projects/${projectId}/applications`\n            : \"/applications\";\n\n        return this.base.request<Application[]>(endpoint);\n    }\n\n    /**\n     * Delete a deployed application\n     *\n     * @example\n     * ```ts\n     * await refuel.applications.delete(applicationId);\n     * ```\n     */\n    async delete(applicationId: string): Promise<void> {\n        return this.base.request<void>(`/applications/${applicationId}`, {\n            method: \"DELETE\",\n        });\n    }\n\n    /**\n     * Get labels for a specific item\n     *\n     * @example\n     * ```ts\n     * const labeledItem = await refuel.applications.getLabeledItem(\n     *     applicationId,\n     *     itemId,\n     * );\n     * ```\n     */\n    async getLabeledItem<FieldKeys extends string>(\n        applicationId: string,\n        itemId: string\n    ) {\n        return this.base.request<\n            ApplicationLabelResponse<ApplicationOutputSync<FieldKeys>>\n        >(`/applications/${applicationId}/items/${itemId}`);\n    }\n\n    /**\n     * Labels an item with your application\n     *\n     * @example\n     * Label an item and console log the values\n     * ```ts\n     * const dataToLabel = [\n     *     {\n     *         menu_text: \"Grilled chicken sandwich with avocado and chipotle mayo\",\n     *     },\n     * ];\n     *\n     * const labeledItem = await refuel.applications.label(\n     *     applicationId,\n     *     dataToLabel,\n     * );\n     * console.log(labeledItem); // output label values\n     * ```\n     *\n     * @example\n     * You can also trigger the label processing to happen asynchronously\n     * ```ts\n     * const response = await refuel.applications.label(\n     *     applicationId,\n     *     dataToLabel,\n     *     { async: true }\n     * );\n     *\n     * const labeledItem = await refuel.applications.getLabeledItem(\n     *     response.application_id,\n     *     response.refuel_output[0].refuel_uuid,\n     * );\n     *\n     * console.log(labeledItem); // output label values\n     * ```\n     */\n    async label<\n        FieldKeys extends string,\n        A extends boolean | undefined = undefined\n    >(\n        applicationId: string,\n        data: Record<string, unknown>[],\n        options?: ApplicationLabelOptions & { async?: A }\n    ) {\n        const params = new URLSearchParams();\n        if (options?.modelId) {\n            params.append(\"model_id\", options.modelId);\n        }\n\n        if (options?.explain !== undefined) {\n            params.append(\"explain\", options.explain.toString());\n        }\n\n        if (options?.redactPII !== undefined) {\n            params.append(\"redact_pii\", options.redactPII.toString());\n        }\n\n        if (options?.async !== undefined) {\n            params.append(\"is_async\", options.async.toString());\n        }\n\n        return this.base.request<\n            A extends true\n                ? ApplicationLabelResponse<ApplicationOutputAsync>\n                : ApplicationLabelResponse<ApplicationOutputSync<FieldKeys>>,\n            Record<string, unknown>[]\n        >(`/applications/${applicationId}/label?${params.toString()}`, {\n            method: \"POST\",\n            data,\n        });\n    }\n\n    /**\n     * Provide the correct label for an item\n     *\n     * @example\n     * ```ts\n     * const correctLabelData = {\n     *     vegetarian: \"no\",\n     * };\n     *\n     * await refuel.applications.feedback(\n     *     applicationId,\n     *     itemId,\n     *     correctLabelData,\n     * );\n     * ```\n     */\n    async feedback(\n        applicationId: string,\n        itemId: string,\n        correctLabelData: Record<string, string>\n    ) {\n        const application = await this.get(applicationId);\n\n        const subtaskMap = Object.fromEntries(\n            application.subtasks?.map((subtask) => [\n                subtask.name,\n                subtask.id,\n            ]) ?? []\n        );\n\n        const feedbackData: Record<string, { label: string }> = {};\n        for (const [subtaskName, subtaskLabel] of Object.entries(\n            correctLabelData\n        )) {\n            const subtaskId = subtaskMap[subtaskName];\n            if (!subtaskId) {\n                throw new Error(`Invalid field: ${subtaskName}`);\n            }\n            feedbackData[subtaskId] = { label: subtaskLabel };\n        }\n\n        return this.base.request<Dataset>(\n            `/applications/${applicationId}/items/${itemId}/label`,\n            {\n                method: \"POST\",\n                data: feedbackData,\n            }\n        );\n    }\n}\n","export type DeepPartial<T> = {\n    [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];\n};\n\n/**\n * Options for a request to the Refuel API\n */\nexport interface RequestOptions<T> {\n    /**\n     * HTTP method to use\n     *\n     * @default \"GET\"\n     */\n    method?: string;\n\n    /** Data to send in the body of the request */\n    data?: T;\n\n    /** Number of retries attempted */\n    retries?: number;\n\n    /** Initial retry timeout (in milliseconds) */\n    initialRetryTimeout?: number;\n\n    /** Maximum number of retries */\n    maxRetries?: number;\n\n    /** Status codes to retry on */\n    retryStatusCodes?: number[];\n}\n\n/**\n * Options to initialize a Refuel client\n */\nexport type RefuelOptions = Pick<\n    RequestOptions<unknown>,\n    \"retries\" | \"initialRetryTimeout\" | \"maxRetries\" | \"retryStatusCodes\"\n> & {\n    /** Origin to send requests to */\n    baseUrl?: string;\n\n    /**\n     * Refuel API key\n     *\n     * @see https://app.refuel.ai/settings\n     */\n    apiKey?: string;\n};\n\n/**\n * Application for labeling items\n */\nexport interface Application {\n    /** Application ID */\n    id: string;\n\n    /** Date the application was created */\n    created_at: string;\n\n    /** Dataset ID the application is associated with */\n    dataset_id: string;\n\n    /** Application description */\n    description?: string;\n\n    /** Emoji for the application that can be used as the icon in the UI */\n    emoji: string | null;\n\n    /** Input columns for the application */\n    input_columns: string[];\n\n    /** Model name for the application */\n    model_name: string;\n\n    /** Application name */\n    name: string;\n\n    /** Project ID the application is associated with */\n    project_id: string;\n\n    /** Subtasks for the application */\n    subtasks: Subtask[];\n\n    /** Task ID the application is associated with */\n    task_id: string;\n\n    /** Name of the task the application is associated with */\n    task_name: string;\n\n    /** Date the related task was last updated */\n    task_updated_at: string | null;\n\n    /** Date the application was last updated */\n    updated_at: string;\n}\n\n/**\n * Options to create an application\n */\nexport interface ApplicationCreateOptions {\n    /** Project ID to deploy the application to */\n    projectId: string;\n\n    /** Task ID to deploy as an application */\n    taskId: string;\n\n    /** Application name */\n    name?: string;\n}\n\n/**\n * Label for an item labeled by an application\n */\nexport interface ApplicationLabel {\n    /** Label value */\n    label: string[];\n\n    /** Confidence score */\n    confidence: number;\n\n    /** Uncalibrated confidence score */\n    raw_confidence: number;\n\n    /** Explanation of the labeling decision */\n    explanation?: string;\n}\n\n/**\n * Output of a synchronous application request\n */\nexport interface ApplicationOutputSync<FieldKeys extends string = string> {\n    /** Refuel UUID for the output */\n    refuel_uuid: string;\n\n    /** Timestamp of the output */\n    refuel_api_timestamp: string;\n\n    /** Fields and their labels */\n    refuel_fields: Record<FieldKeys, ApplicationLabel>;\n\n    /** Telemetry metrics, such as how many tokens were used */\n    usage?: Record<string, unknown>;\n}\n\n/**\n * Output of an asynchronous application request\n */\nexport interface ApplicationOutputAsync {\n    /** Refuel UUID for the output */\n    refuel_uuid: string;\n\n    /** Timestamp of the output */\n    refuel_api_timestamp: string;\n\n    /** URI to the output value */\n    uri: string;\n}\n\n/**\n * Response from an application request\n */\nexport interface ApplicationLabelResponse<\n    T = ApplicationOutputSync | ApplicationOutputAsync\n> {\n    /** Application ID */\n    application_id: string;\n\n    /** Application name */\n    application_name: string;\n\n    /** Output of the application */\n    refuel_output: T[];\n}\n\n/**\n * Options for an application request\n */\nexport interface ApplicationLabelOptions {\n    /** Include an explanation of the labeling decision in the response */\n    explain?: boolean;\n\n    /** Process labels asynchronously */\n    async?: boolean;\n\n    /** Model to use */\n    modelId?: string;\n\n    /** Redact personally identifiable information */\n    redactPII?: boolean;\n}\n\n/**\n * Data to create a project\n */\nexport interface ProjectData {\n    /** Project name */\n    project_name: string;\n\n    /** Project description */\n    description?: string;\n}\n\n/**\n * Project for your team\n */\nexport interface Project {\n    /** Project ID */\n    id: string;\n\n    /** Date the project was created */\n    created_at: string;\n\n    /** Project description */\n    description?: string;\n\n    /** Project name */\n    project_name: string;\n\n    /** Team the project is associated with */\n    team: string | null;\n\n    /** Date the project was last updated */\n    updated_at: string;\n}\n\nexport interface Telemetry {\n    /** Model name */\n    model_name: string;\n\n    /** Type of telemetry (e.g. \"input_tokens\") */\n    telemetry_type: string;\n\n    /** Value of the telemetry (e.g. 100) */\n    telemetry_value: unknown;\n}\n\n/**\n * The source of a label value\n */\nexport enum LabelSource {\n    /** Label from an LLM */\n    LLM = \"LLM\",\n\n    /** Label from a human */\n    HUMAN = \"HUMAN\",\n}\n\n/**\n * Label for an item\n */\nexport interface DatasetItemLabel {\n    /** Confidence score */\n    confidence: number | null;\n\n    /** User who created the label */\n    created_by: string | null;\n\n    /** Error message if the label creation failed */\n    error_msg: string | null;\n\n    /** Expected label (either from ground truth in dataset or human verified value) */\n    expected_label: string | null;\n\n    /** An explanation of the labeling decision */\n    explanation: string | null;\n\n    /** Related subtask ID */\n    id: string;\n\n    /** Label value */\n    label: string;\n\n    /** Original label from the LLM */\n    llm_label: string | null;\n\n    /** Multilabel confidence */\n    multilabel_confidence: Record<string, number> | null;\n\n    /** Whether the label was overridden */\n    overridden: boolean;\n\n    /** Uncalibrated confidence score */\n    raw_confidence: number | null;\n\n    /** Raw response from the LLM */\n    raw_response: string | null;\n\n    /** List of labels the LLM selected from */\n    selected_labels: string[] | null;\n\n    /** The source of the label */\n    source: LabelSource;\n}\n\n/**\n * Data to update a label\n */\nexport type DatasetItemLabelUpdateData =\n    | {\n          label: string | number | boolean;\n          explanation?: string | null;\n      }\n    | {\n          label?: string | number | boolean | null;\n          explanation: string;\n      };\n\n/**\n * Data to update labels for an item\n */\nexport interface DatasetItemLabelsUpdate {\n    [subtaskId: string]: DatasetItemLabelUpdateData;\n}\n\n/**\n * Labels for an item\n */\nexport interface DatasetItemLabels {\n    [subtaskId: string]: DatasetItemLabel;\n}\n\n/**\n * Item in a dataset\n */\nexport interface LabeledDatasetItem {\n    /** Fields and their values */\n    fields: Record<string, unknown> | null;\n\n    /** Labels for the item */\n    labels: DatasetItemLabels | null;\n\n    /** Telemetry for the item (e.g. how many tokens were used) */\n    telemetry: Telemetry[] | null;\n\n    /** Whether the item is in the eval set */\n    in_evalset: boolean;\n}\n\n/**\n * Metadata for a column\n */\nexport interface Metadata {\n    /** Existing label task IDs */\n    existingLabelTaskIds?: string[] | null;\n\n    /** Whether the column is a confidence score */\n    is_confidence: boolean | null;\n\n    /** Whether the column is an LLM label */\n    is_llm_label: boolean | null;\n\n    /** Source of the column value */\n    source: \"refuel\" | \"user\" | null;\n\n    /** Task ID */\n    taskId: string | null;\n\n    /** Type of the column value */\n    type: \"string\" | \"integer\" | \"boolean\" | \"date\";\n}\n\n/**\n * Metadata for columns in a dataset\n */\nexport interface ColumnMetadata {\n    [key: string]: Metadata;\n}\n\n/**\n * The type of a column value\n */\nexport enum DatasetColumnType {\n    STRING = \"string\",\n    NUMBER = \"number\",\n    BOOLEAN = \"boolean\",\n    IMAGE = \"image\",\n    PDF = \"pdf\",\n}\n\n/**\n * A column in the dataset schema\n */\nexport interface DatasetSchemaColumn {\n    /** Column name */\n    name: string;\n\n    /** Column type */\n    type: DatasetColumnType;\n\n    /** Order of the column */\n    order: number;\n\n    primary_key?: boolean;\n\n    timestamp?: boolean;\n}\n\n/**\n * The schema for a dataset\n */\nexport interface DatasetSchema {\n    /** Properties in the schema */\n    properties: Record<string, DatasetSchemaColumn>;\n\n    /** Type of the schema */\n    type: string;\n\n    /** The schema URI */\n    $schema: string;\n}\n\nexport enum DatasetIngestStatus {\n    FAILED = \"failed\",\n    IN_PROGRESS = \"in_progress\",\n    SUCCESS = \"success\",\n}\n\nexport interface DatasetFromList {\n    /** Dataset ID */\n    id: string;\n\n    /** Dataset name */\n    dataset_name: string;\n\n    /** Date the dataset was created */\n    created_at: string;\n\n    /** Date the dataset was last updated */\n    updated_at: string | null;\n\n    /** Ingest status */\n    ingest_status: DatasetIngestStatus | null;\n\n    /** Dataset schema */\n    dataset_schema: DatasetSchema;\n\n    /** Source of the dataset */\n    source: string;\n\n    /** Project IDs this dataset is associated with */\n    projects: string[] | null;\n}\n\nexport interface Dataset {\n    /** Dataset ID */\n    id: string;\n\n    /** Metadata for the columns */\n    column_metadata: ColumnMetadata | null;\n\n    /** Dataset name */\n    name: string;\n\n    /** Dataset schema */\n    schema: DatasetSchema | null;\n\n    /** Ingest status */\n    ingest_status: DatasetIngestStatus | null;\n\n    /** Number of items included in the response */\n    response_count: number;\n\n    /** Total number of items in the dataset */\n    total_count: number;\n\n    /** Project IDs this dataset is associated with */\n    project_ids: string[] | null;\n\n    /** Tasks that will be scheduled to run on new items in the dataset */\n    scheduled_ids: string[] | null;\n}\n\nexport interface DatasetUnlabeled extends Dataset {\n    items: Record<string, unknown>[];\n}\n\nexport interface DatasetLabeled extends Dataset {\n    items: LabeledDatasetItem[];\n}\n\n/**\n * The category of a filter field\n */\nexport enum FilterFieldCategory {\n    /** Filter on a label */\n    LABEL = \"label\",\n\n    /** Filter on metadata */\n    METADATA = \"metadata\",\n}\n\n/**\n * The operator to use for a filter\n */\nexport enum FilterOperator {\n    /** Equal to */\n    EQUAL = \"=\",\n\n    /** Greater than */\n    GREATER_THAN = \">\",\n\n    /** Greater than or equal to */\n    GREATER_THAN_OR_EQUAL = \">=\",\n\n    /** ILIKE */\n    ILIKE = \"ILIKE\",\n\n    /** In a list */\n    IN = \"IN\",\n\n    /** Is not verified */\n    IS_NOT_VERIFIED = \"IS NOT VERIFIED\",\n\n    /** Is verified */\n    IS_VERIFIED = \"IS VERIFIED\",\n\n    /** Less than */\n    LESS_THAN = \"<\",\n\n    /** Less than or equal to */\n    LESS_THAN_OR_EQUAL = \"<=\",\n\n    /** Matches */\n    MATCHES = \"~*\",\n\n    /** Not equal to */\n    NOT_EQUAL = \"<>\",\n\n    /** Not ILIKE */\n    NOT_ILIKE = \"NOT ILIKE\",\n\n    /** Not matches */\n    NOT_MATCHES = \"!~*\",\n\n    /** Not null */\n    NOT_NULL = \"IS NOT NULL\",\n\n    /** Null */\n    NULL = \"IS NULL\",\n}\n\n/**\n * An operator option\n */\nexport type FilterOperatorOption = {\n    /** Label for the operator */\n    label: string;\n\n    /** Value of the operator */\n    value: FilterOperator;\n\n    /** Category of the operator */\n    category: \"operator\";\n\n    /** Types supported by the operator */\n    supportedTypes: string[];\n};\n\n/**\n * The type of a filter value\n */\nexport type FilterValueType = \"string\" | \"metadata\" | \"label\" | \"list\";\n\n/**\n * A filter to apply to a dataset or task run\n */\nexport interface SQLFilter {\n    /** Filter type */\n    filter_type: FilterFieldCategory;\n\n    /** Field to filter on */\n    field: string;\n\n    /** Operator to use */\n    operator: FilterOperator;\n\n    /** Value type */\n    value_type?: FilterValueType;\n\n    /** Value to filter on */\n    value?: string | string[];\n\n    /** Subtask ID */\n    subtask_id?: string;\n}\n\nexport type SortDirection = \"ascending\" | \"descending\";\n\n/**\n * The mode to used to generate the schema for a subtask\n */\nexport enum SchemaMode {\n    /** Automatically generate the schema from the guidelines */\n    AUTO = \"auto\",\n\n    /** Manually specify the schema */\n    MANUAL = \"manual\",\n}\n\nexport interface Subtask {\n    /** Subtask ID */\n    id: string;\n\n    /** Default value */\n    default_value?: string | null;\n\n    /** Guidelines */\n    guidelines: string | null;\n\n    /** Columns with a URL to an image */\n    image_columns: string[] | null;\n\n    /** Input columns */\n    input_columns: string[] | null;\n\n    /** Ground truth column */\n    label_column: string | null;\n\n    /** Number of labels to send to the LLM to select from */\n    label_selection?: number | null;\n\n    /** Labels */\n    labels: string[] | null;\n\n    /** Subtask name */\n    name: string | null;\n\n    /** Order of the subtask */\n    order?: number | null;\n\n    /** Hash of the guidelines used to generate the schema */\n    schema_guidelines_hash?: string | null;\n\n    /** Schema mode */\n    schema_mode?: SchemaMode | null;\n\n    /** JSON Schema the LLM output must conform to\n     * @see {@link https://platform.openai.com/docs/guides/structured-outputs#supported-schemas}\n     */\n    schema?: string | null;\n\n    /** Subtask type */\n    type: TaskType | null;\n\n    /** Related taxonomy ID */\n    taxonomy_id?: string | null;\n}\n\n/**\n * The type of enrichment\n */\nexport enum TransformType {\n    /** Search the web for information relevant to the input */\n    WEB_SEARCH = \"web_search\",\n\n    /** Search for a location on a map */\n    MAP_SEARCH = \"map_search\",\n\n    /** Transform a webpage into structured data */\n    WEBPAGE_TRANSFORM = \"webpage_transform\",\n\n    /** Extract text from an image or document */\n    OCR = \"ocr\",\n\n    /** Use a custom API to transform the data */\n    CUSTOM_API = \"custom_api\",\n}\n\n/**\n * An enrichment that can be added to a task\n */\nexport interface Transform\n    extends Pick<\n        Subtask,\n        \"id\" | \"name\" | \"guidelines\" | \"input_columns\" | \"order\"\n    > {\n    /** Type of enrichment */\n    type: TransformType;\n\n    /** Columns to output */\n    output_columns: string[] | null;\n\n    /** Parameters for the enrichment */\n    params: Record<string, unknown>;\n}\n\n/**\n * The type of task\n */\nexport enum TaskType {\n    /** Classify an item into one category */\n    CLASSIFICATION = \"classification\",\n\n    /** Classify an item into one or more categories */\n    MULTILABEL_CLASSIFICATION = \"multilabel_classification\",\n\n    /** Extract an answer from an item */\n    ANSWER_EXTRACTION = \"answer_extraction\",\n\n    /** Extract structured data from a document */\n    DOCUMENT_EXTRACTION = \"document_extraction\",\n\n    /** Extract attributes from an item */\n    ATTRIBUTE_EXTRACTION = \"attribute_extraction\",\n\n    /** Chain of tasks */\n    TASK_CHAIN = \"task_chain\",\n}\n\n/**\n * Labeling task\n */\nexport interface Task {\n    /** Task ID */\n    id: string | null;\n\n    /** Whether to compute confidence scores */\n    compute_confidence: boolean;\n\n    /** Context for the LLM to use when labeling */\n    context: string | null;\n\n    /** Date the task was created */\n    created_at: string | null;\n\n    /** Dataset ID */\n    dataset_id: string | null;\n\n    /** Whether the task is deployed as an application */\n    deployed: boolean | null;\n\n    /** Description of the task */\n    description: string | null;\n\n    /** Emoji for the task */\n    emoji: string | null;\n\n    /** Number of few-shot examples to use */\n    few_shot_num: number | null;\n\n    /** Whether the task is mutable */\n    mutable: boolean;\n\n    /** Project ID */\n    project_id: string | null;\n\n    /** Whether the task is runnable */\n    runnable: boolean;\n\n    /** Selected model ID */\n    selected_model_id: string | null;\n\n    /** Subtasks */\n    subtasks: Partial<Subtask>[] | null;\n\n    /** Task name */\n    task_name: string | null;\n\n    /** Task type */\n    task_type: TaskType | null;\n\n    /** Transforms */\n    transforms?: Partial<Transform>[] | null;\n\n    /** Date the task was last updated */\n    updated_at: string | null;\n\n    /**\n     * Whether to use beam search, which tries out\n     * multiple choices at each step to find the best\n     * overall result\n     */\n    use_beam_search: boolean | null;\n\n    /** Whether to use the LLM cache */\n    use_llm_cache: boolean | null;\n}\n\n/**\n * Telemetry metric for an application or task\n */\nexport interface UsageMetric {\n    /** Date the metric was recorded */\n    date: string;\n\n    /** Value of the metric */\n    value: number;\n}\n\n/**\n * Key for a telemetry metric\n */\nexport type TeamUsageMetricKey =\n    | \"volume\"\n    | \"input_tokens\"\n    | \"output_tokens\"\n    | \"volume_web_search\";\n\n/**\n * Key for a telemetry metric\n */\nexport type ApplicationUsageMetricKey =\n    | TeamUsageMetricKey\n    | \"error_4xx\"\n    | \"error_5xx\"\n    | \"latency\";\n\n/**\n * Data for a telemetry metric\n */\nexport type TeamUsageData = {\n    [key in TeamUsageMetricKey]: UsageMetric[];\n};\n\n/**\n * Data for a telemetry metric\n */\nexport type ApplicationUsageData = {\n    [key in ApplicationUsageMetricKey]: UsageMetric[];\n};\n\nexport enum FeatureFlagValues {\n    ENABLED = \"enabled\",\n    DISABLED = \"disabled\",\n}\n\n/**\n * Team for your organization\n */\nexport interface RefuelTeam {\n    /** Date the team was created */\n    created_at: string;\n\n    /** Feature flags for the team */\n    feature_flags: Record<string, FeatureFlagValues> | null;\n\n    /** Team name */\n    name: string;\n\n    /** Refuel API key\n     *\n     * This can be used to authenticate requests to the Refuel API or with the Refuel SDKs\n     */\n    refuel_api_key: string;\n}\n\n/**\n * Possible states for a user\n */\nexport enum UserState {\n    /** User is active */\n    ACTIVE = \"ACTIVE\",\n\n    /** User has been invited to the team */\n    INVITED = \"INVITED\",\n\n    /** User has been created but not invited */\n    CREATED = \"CREATED\",\n}\n\n/**\n * User for your team\n */\nexport interface User {\n    /** User name */\n    name: string | null;\n\n    /** User email */\n    email: string;\n\n    /** Team the user is associated with */\n    team: string;\n\n    /** URL to the user's picture */\n    picture: string | null;\n\n    /** User state */\n    state: UserState;\n}\n\n/**\n * Logged in user\n */\nexport interface AuthenticatedUser extends User {\n    /** User ID */\n    id: string;\n\n    /** API key */\n    api_key: string | null;\n\n    /** Date the user was created */\n    created_at: string;\n\n    /** Permissions the user has */\n    permissions: string[];\n\n    /** Date the user was last updated */\n    updated_at: string;\n\n    /** Access token used to authenticate requests */\n    access_token: string;\n}\n\n/**\n * Response from inviting users to the team\n */\nexport interface InviteUsersResponse {\n    /** Users that failed to be invited */\n    failed: string[];\n\n    /** Users that were invited */\n    success: string[];\n}\n\n/**\n * A taxonomy label\n */\nexport interface TaxonomyLabel {\n    /** Label ID */\n    id: string;\n\n    /** Label name */\n    name: string;\n\n    /** Label description */\n    description: string;\n\n    /** @alpha Label level */\n    level: number | null;\n\n    /** @alpha Parent labels */\n    parents: string[];\n}\n\n/**\n * Data to create or update a taxonomy label\n */\nexport interface TaxonomyLabelData {\n    /** Label name */\n    name: string;\n\n    /** Label description */\n    description?: string | null;\n}\n\n/**\n * Response from getting taxonomy labels\n */\nexport interface TaxonomyLabelsResponse {\n    /** ID of the task the labels are associated with */\n    id: string;\n\n    /** Date the labels were created */\n    created_at: string;\n\n    /** Labels */\n    labels: TaxonomyLabel[];\n\n    /** ID of the task the labels are associated with */\n    task_id: string;\n\n    /** Total number of labels */\n    total_count: number;\n\n    /** Date the labels were last updated */\n    updated_at: string;\n}\n\n/**\n * Configuration for an integration to an external service\n */\nexport type IntegrationConfig = Record<string, string | null>;\n\n/**\n * An integration with an external service\n */\nexport interface Integration {\n    /** Integration ID */\n    id: string;\n\n    /** Name of the external service */\n    name: string;\n\n    /** Integration category */\n    category: string;\n\n    /** Integration description */\n    description: string;\n\n    /** Whether the integration is connected */\n    is_connected: boolean;\n\n    /** Whether the integration is available */\n    is_available: boolean;\n\n    /** Integration configuration */\n    config: IntegrationConfig;\n\n    /** URL to the logo of the external service */\n    logo_url: string;\n\n    /** URL to the docs of the external service */\n    docs_url: string;\n}\n\n/**\n * Options for exporting a dataset\n */\nexport interface ExportDatasetOptions {\n    /** Email to send the export to */\n    email?: string;\n\n    /** Filters to apply to the dataset */\n    filters?: SQLFilter[];\n\n    /** Whether to include labels in the export */\n    includeLabels?: boolean;\n\n    /** Whether to include the Refuel UUID in the export */\n    includeUUID?: boolean;\n\n    /** Task ID */\n    taskId?: string;\n\n    /** Task run ID */\n    taskRunId?: string;\n\n    /** Whether this export is from a seed set */\n    seedSet?: boolean;\n\n    /** Whether this export is from an evaluation set */\n    evalSet?: boolean;\n\n    /** Dataset ID */\n    datasetId?: string;\n}\n\n/**\n * Options for getting the URL of a dataset export\n */\nexport interface GetDatasetExportOptions {\n    /** Dataset ID */\n    datasetId?: string;\n\n    /** Task ID */\n    taskId?: string;\n\n    /** Whether this export is from a seed set */\n    seedSet?: boolean;\n\n    /** Whether this export is from an evaluation set */\n    evalSet?: boolean;\n}\n\n/**\n * Response from exporting a dataset\n */\nexport interface ExportDatasetResponse {\n    /** ID of the export */\n    export_id: string;\n\n    /** URI of the export */\n    uri: string;\n}\n\n/**\n * Sort order direction\n */\nexport type OrderDirection = \"ASC\" | \"DESC\";\n\n/**\n * Order by options\n */\nexport interface OrderBy {\n    /** Field to order by */\n    field: string;\n\n    /** Order direction */\n    direction: OrderDirection;\n\n    /** Order by a subtask ID */\n    subtask_id?: string;\n}\n\n/**\n * Options for getting dataset items\n */\nexport interface ListDatasetItemsOptions {\n    /** Dataset ID */\n    datasetId?: string;\n\n    /** Task ID */\n    taskId?: string;\n\n    /** Whether to get results from the seed set */\n    seedSet?: boolean;\n\n    /** Whether to get results from the evaluation set */\n    evalSet?: boolean;\n\n    /** ID of the model to use */\n    modelId?: string;\n\n    /** Filters to apply to the dataset */\n    filters?: SQLFilter[];\n\n    /** Maximum number of items to return */\n    maxItems?: number;\n\n    /** Offset to start the items at */\n    offset?: number;\n\n    /** Order by */\n    orderBy?: OrderBy | OrderBy[];\n}\n\nexport interface GetDatasetItemOptions {\n    /** Task ID */\n    taskId?: string;\n\n    /** Model ID */\n    modelId?: string;\n}\n\n/**\n * The format of a metric\n */\nexport enum MetricFormat {\n    /** Numeric metric */\n    NUMERIC = \"numeric\",\n\n    /** Percentage metric */\n    PERCENTAGE = \"percentage\",\n\n    /** Histogram metric */\n    HISTOGRAM = \"histogram\",\n\n    /** Dictionary metric */\n    DICT = \"dict\",\n}\n\n/**\n * A metric result\n */\nexport interface MetricResult {\n    /** Metric name */\n    name: string;\n\n    /** Metric value */\n    value: unknown;\n\n    /** Metric type */\n    type: MetricFormat;\n\n    /** Support */\n    support: number;\n}\n\n/**\n * Metrics for a task run\n */\nexport interface TaskRunMetricsResponse {\n    /** Metrics for the overall task */\n    task: MetricResult[] | null;\n\n    /** Metrics for the subtasks */\n    subtasks: Record<string, MetricResult[]> | null;\n}\n\n/**\n * Evaluation statistics for a model\n */\nexport interface EvaluationStat {\n    /** Metrics for the task run */\n    metrics?: TaskRunMetricsResponse | null;\n\n    /** Model ID */\n    model?: string | null;\n}\n\n/**\n * Finetuning hyperparameters\n */\nexport interface FinetuningHyperparameters {\n    adapter?: string;\n\n    /**\n     * Adjusts how fast the model learns — the higher it\n     * is, the quicker it adapts but with increased risk of\n     * instability\n     */\n    learning_rate_multiplier: number;\n\n    /**\n     * Sets how much the model adapts during finetuning —\n     * the higher the rank, the more complex patterns it\n     * can learn, but it also requires more training data\n     * to avoid overfitting\n     */\n    lora_r?: 8 | 16 | 32 | 64;\n\n    /**\n     * Sets the number of times the model will go through\n     * the entire training data to improve its learning\n     */\n    num_epochs: number;\n}\n\n/**\n * A stage in the finetuning run timeline\n */\nexport interface FinetuningRunStage {\n    /** Stage details */\n    detail: string | null;\n\n    /** Stage index */\n    index: number;\n\n    /** Stage ID */\n    stage_id: string;\n\n    /** Stage status */\n    status: \"NOT STARTED\" | \"IN PROGRESS\" | \"COMPLETED\" | \"FAILED\";\n}\n\n/**\n * The availability status of a labeling model\n */\nexport enum AvailabilityStatus {\n    UNAVAILABLE = \"UNAVAILABLE\",\n    AVAILABLE = \"AVAILABLE\",\n}\n\n/**\n * The status of a finetuning run\n */\nexport enum FinetuningRunStatus {\n    INITIALIZATION_IN_PROGRESS = \"INITIALIZATION IN PROGRESS\",\n    INITIALIZATION_COMPLETE = \"INITIALIZATION COMPLETE\",\n\n    DATASET_PREP_NOT_STARTED = \"DATASET PREPARATION NOT STARTED\",\n    DATASET_PREP_IN_PROGRESS = \"DATASET PREPARATION IN PROGRESS\",\n    DATASET_PREP_COMPLETED = \"DATASET PREPARATION COMPLETED\",\n    DATASET_PREP_FAILED = \"DATASET PREPARATION FAILED\",\n\n    RESOURCE_ALLOCATION_NOT_STARTED = \"RESOURCE ALLOCATION NOT STARTED\",\n    RESOURCE_ALLOCATION_IN_PROGRESS = \"RESOURCE ALLOCATION IN PROGRESS\",\n    RESOURCE_ALLOCATION_COMPLETED = \"RESOURCE ALLOCATION COMPLETED\",\n    RESOURCE_ALLOCATION_FAILED = \"RESOURCE ALLOCATION FAILED\",\n\n    TRAINING_NOT_STARTED = \"TRAINING NOT STARTED\",\n    TRAINING_IN_PROGRESS = \"TRAINING IN PROGRESS\",\n    TRAINING_COMPLETED = \"TRAINING COMPLETED\",\n    TRAINING_FAILED = \"TRAINING FAILED\",\n\n    DEPLOY_NOT_STARTED = \"DEPLOYMENT NOT STARTED\",\n    DEPLOY_IN_PROGRESS = \"DEPLOYMENT IN PROGRESS\",\n    DEPLOY_COMPLETED = \"DEPLOYMENT COMPLETED\",\n    DEPLOY_FAILED = \"DEPLOYMENT FAILED\",\n\n    EVALUATION_NOT_STARTED = \"EVALUATION NOT STARTED\",\n    EVALUATION_IN_PROGRESS = \"EVALUATION IN PROGRESS\",\n    EVALUATION_COMPLETED = \"EVALUATION COMPLETED\",\n    EVALUATION_FAILED = \"EVALUATION FAILED\",\n\n    INTERRUPTED = \"INTERRUPTED\",\n}\n\n/**\n * LLM labeling model\n */\nexport interface LabelingModel {\n    /** Labeling model ID */\n    id: string;\n\n    /** Availability status */\n    availability_status: AvailabilityStatus;\n\n    /** Generate labels with this model and include them in the training data */\n    augmented_finetuning_model: string | null;\n\n    /** Base model */\n    base_model: string;\n\n    /** Model to evaluate the finetuned model against */\n    comparison_model?: string | null;\n\n    /** Date the labeling model was created */\n    created_at: string | null;\n\n    /** Datasets the labeling model is associated with */\n    datasets: string[];\n\n    /** Evaluation statistics */\n    evaluation_stats: EvaluationStat[];\n\n    /** Finetuning run status */\n    finetuning_run_status: FinetuningRunStatus | null;\n\n    /** Finetuning run timeline */\n    finetuning_run_timeline: FinetuningRunStage[] | null;\n\n    /** Finetuning hyperparameters */\n    hyperparameters: FinetuningHyperparameters | null;\n\n    /** Whether to use LoRA finetuning */\n    lora: boolean;\n\n    /** Labeling model name */\n    name: string;\n\n    /** Project ID */\n    project_id: string | null;\n\n    /** Provider */\n    provider: string;\n\n    /** Task ID */\n    task_id: string | null;\n\n    /** Training statistics */\n    training_stats: {\n        /**\n         * Shows how well the model is learning from\n         * the training data over time, with lower\n         * values indicating better performance\n         */\n        training_loss: [number, number][] | null;\n\n        /**\n         * Measures the model's performance on unseen\n         * data to detect overfitting, ideally decreasing\n         * along with training loss.\n         */\n        evaluation_loss: [number, number][] | null;\n\n        /**\n         * Points during training where the model's\n         * progress was saved, useful for tracking\n         * and correlating loss values.\n         */\n        checkpoint_index: number[];\n    } | null;\n\n    /** Date the labeling model was last updated */\n    updated_at: string | null;\n}\n\n/**\n * Options for creating a finetuned model\n */\nexport type FinetunedModelCreateOptions = Pick<\n    LabelingModel,\n    | \"augmented_finetuning_model\"\n    | \"base_model\"\n    | \"comparison_model\"\n    | \"datasets\"\n    | \"hyperparameters\"\n    | \"lora\"\n    | \"project_id\"\n    | \"task_id\"\n>;\n\n/**\n * LLM model available to a team\n */\nexport interface TeamModel {\n    /** Model name */\n    name: string;\n\n    /** Model provider */\n    provider: string;\n\n    /** Model display name */\n    display_name: string;\n\n    /** Model parameters */\n    params: Record<string, unknown>;\n}\n\n/**\n * The status of a task run\n */\nexport type TaskRunStatus =\n    | \"restarted\"\n    | \"not_started\"\n    | \"active\"\n    | \"completed\"\n    | \"failed\"\n    | \"preview\"\n    | \"cancelled\";\n\n/**\n * A task run\n */\nexport interface TaskRun {\n    /** Task run ID */\n    id: string;\n\n    /** Project ID */\n    project_id: string;\n\n    /** Task ID */\n    task_id: string;\n\n    /** Task name */\n    task_name: string;\n\n    /** Model name */\n    model_name: string;\n\n    /** Dataset ID */\n    dataset_id: string;\n\n    /** Dataset name */\n    dataset_name: string;\n\n    /** Task run status */\n    status: TaskRunStatus;\n\n    /** Whether the task run is an evaluation run */\n    is_eval_run: boolean;\n\n    /** Date the task run was created */\n    created_at: string;\n\n    /** Date the task run was last updated */\n    updated_at: string;\n\n    /** Model(s) used to label the items in this run */\n    model_ids: string[];\n}\n\n/**\n * Options for getting task runs\n */\nexport interface TaskRunListOptions {\n    /** Dataset ID */\n    datasetId?: string;\n\n    /** Whether to get the eval set */\n    evalSet?: boolean;\n}\n\n/**\n * Options for creating a task run\n */\nexport interface TaskRunCreateOptions {\n    /** Maximum number of items to label */\n    numItems?: number;\n\n    /** Whether to get the eval set */\n    evalSet?: boolean;\n\n    /** Filters to apply to the dataset */\n    filters?: SQLFilter[];\n\n    /** Model(s) used to label the items in this run */\n    modelIds?: string[];\n\n    /** Dataset ID */\n    datasetId?: string;\n}\n\n/**\n * Options for canceling a task run\n */\nexport interface TaskRunCancelOptions {\n    /** Whether this is an evaluation run */\n    evalSet?: boolean;\n\n    /** Dataset ID */\n    datasetId?: string;\n}\n\n/**\n * Options for listing labels for an item\n */\nexport interface LabelListOptions {\n    /** Override the model used for labeling */\n    modelId?: string;\n\n    /** Specify the subtask to label */\n    subtaskId?: string;\n\n    /**\n     * Generate the label if it is missing\n     *\n     * @default false\n     */\n    generateMissingLabels?: boolean;\n\n    /**\n     * Generate explanations for the label\n     *\n     * @default false\n     */\n    generateMissingExplanations?: boolean;\n}\n\n/**\n * The status of a confidence calibration\n */\nexport enum CalibrationStatus {\n    IN_PROGRESS = \"IN_PROGRESS\",\n    DELETED = \"DELETED\",\n    INTERRUPTED = \"INTERRUPTED\",\n    COMPLETED = \"COMPLETED\",\n}\n\n/**\n * The model used for confidence calibration\n */\nexport enum CalibrationModel {\n    LINEAR_REGRESSION = \"LINEAR_REGRESSION\",\n}\n\n/**\n * Confidence calibration\n */\nexport interface Calibration {\n    /** Calibration ID */\n    id: string;\n\n    /** Calibration name */\n    name: string;\n\n    /** Project ID */\n    project_id: string;\n\n    /** Task ID */\n    task_id: string;\n\n    /** Calibration status */\n    status: CalibrationStatus;\n\n    /** Training hyperparameters */\n    training_hyperparameters: string;\n\n    /** Calibration model */\n    model: CalibrationModel;\n\n    /** Model artifacts */\n    model_artifacts: Record<string, unknown>;\n\n    /** Date the calibration was created */\n    created_at: string;\n\n    /** Date the calibration was last updated */\n    updated_at: string;\n\n    /** Team ID */\n    team: string;\n}\n\nexport enum SamplingStrategy {\n    RANDOM = \"random\",\n    STRATIFIED = \"stratified\",\n    SORTED = \"sorted\",\n}\n\nexport enum EvalsetSamplingStrategy {\n    NO_SAMPLING = \"no sampling\",\n    RANDOM = \"random\",\n    STRATIFIED = \"stratified\",\n    BALANCED = \"balanced\",\n}\n\nexport enum SampleColumnType {\n    LABEL = \"label\",\n    METADATA = \"metadata\",\n    CONFIDENCE = \"confidence\",\n}\n\nexport interface SamplingColumn {\n    column_name?: string;\n    column_type: SampleColumnType;\n    subtask_id?: string;\n}\n\nexport interface SamplingEvent {\n    sample_strategy: EvalsetSamplingStrategy;\n    sample_size?: number;\n    sampling_column?: SamplingColumn;\n    num_buckets?: number;\n    sample_size_per_group?: number;\n}\n\nexport interface SampleDatasetParams {\n    column?: string | null;\n    filters?: string[];\n    sample_name: string;\n    sample_size: number;\n    sample_type: SamplingStrategy;\n    sort_direction?: string | null;\n    dataset_id: string | null;\n}\n\n/**\n * Options for getting team usage metrics\n */\nexport interface TeamUsageGetOptions {\n    /** Application ID */\n    applicationId?: string;\n\n    /** Task ID */\n    taskId?: string;\n\n    /** Model ID */\n    modelId?: string;\n}\n\nexport interface TaskRunMetricsListOptions {\n    filters?: SQLFilter[];\n    modelId?: string;\n    datasetId?: string;\n    evalSet?: boolean;\n}\n","import { RefuelBase } from \"../RefuelBase\";\nimport { Calibration, CalibrationStatus } from \"../types\";\n\n/**\n * Handles operations related to confidence calibrations.\n * This class is not intended to be instantiated directly.\n * Instead, access it through an instance of the Refuel class.\n */\nexport class Calibrations {\n    private readonly base: RefuelBase;\n\n    constructor(base: RefuelBase) {\n        this.base = base;\n    }\n\n    /**\n     * Calibrate the confidence of a task\n     *\n     * @example\n     * ```ts\n     * const calibration = await refuel.calibrations.create(taskId);\n     * ```\n     */\n    async create(taskId: string): Promise<Calibration> {\n        return this.base.request<Calibration>(`/tasks/${taskId}/calibrations`, {\n            method: \"POST\",\n            data: {\n                status: CalibrationStatus.IN_PROGRESS,\n            },\n        });\n    }\n\n    /**\n     * Get a confidence calibration by ID\n     *\n     * @example\n     * ```ts\n     * const task = await refuel.calibrations.get(taskId, calibrationId);\n     * ```\n     */\n    async get(taskId: string, calibrationId: string): Promise<Calibration> {\n        return this.base.request<Calibration>(\n            `/tasks/${taskId}/calibrations/${calibrationId}`\n        );\n    }\n\n    /**\n     * List all confidence calibrations for a task\n     *\n     * @example\n     * ```ts\n     * const calibrations = await refuel.calibrations.list(taskId);\n     * ```\n     */\n    async list(taskId: string): Promise<Calibration[]> {\n        return this.base.request<Calibration[]>(\n            `/tasks/${taskId}/calibrations`\n        );\n    }\n\n    /**\n     * Update a confidence calibration\n     *\n     * @example\n     * ```ts\n     * const calibration = await refuel.calibrations.update(taskId, calibrationId, {\n     *  status: CalibrationStatus.INTERRUPTED\n     * });\n     * ```\n     */\n    async update(\n        taskId: string,\n        calibrationId: string,\n        data: Partial<Pick<Calibration, \"status\">>\n    ): Promise<Calibration> {\n        return this.base.request<Calibration, Partial<Calibration>>(\n            `/tasks/${taskId}/calibrations/${calibrationId}`,\n            {\n                method: \"PATCH\",\n                data,\n            }\n        );\n    }\n}\n","import { RefuelBase } from \"../RefuelBase\";\nimport {\n    ExportDatasetOptions,\n    ExportDatasetResponse,\n    GetDatasetExportOptions,\n} from \"../types\";\n\n/**\n * Handles operations related to dataset exports.\n * This class is not intended to be instantiated directly.\n * Instead, access it through an instance of the Refuel class.\n */\nexport class DatasetExports {\n    private readonly base: RefuelBase;\n\n    /** @internal */\n    constructor(base: RefuelBase) {\n        this.base = base;\n    }\n\n    /**\n     * Get the URL of a dataset export\n     *\n     * @example\n     * ```ts\n     * const export = await refuel.datasetExports.get(exportId, { datasetId });\n     * ```\n     */\n    async get(\n        exportId: string,\n        options: GetDatasetExportOptions\n    ): Promise<string> {\n        let path;\n\n        if (options.evalSet) {\n            if (!options.taskId) {\n                throw new Error(\n                    \"Task ID is required for evaluation set exports\"\n                );\n            }\n            path = `/tasks/${options.taskId}/evalset/exports/${exportId}`;\n        } else if (options.seedSet) {\n            if (!options.taskId) {\n                throw new Error(\"Task ID is required for seed set exports\");\n            }\n            path = `/tasks/${options.taskId}/seedset/exports/${exportId}`;\n        } else {\n            if (!options.datasetId) {\n                throw new Error(\"Dataset ID is required for dataset exports\");\n            }\n            path = `/datasets/${options.datasetId}/exports/${exportId}`;\n        }\n\n        if (!path) {\n            throw new Error(\"Invalid export options\");\n        }\n\n        return this.base.request<string>(path);\n    }\n\n    /**\n     * Email a secure, expiring link to download a dataset\n     *\n     * @example\n     * ```ts\n     * const export = await refuel.datasetExports.create({ datasetId: \"123\", email: \"example@example.com\" });\n     * ```\n     */\n    async create(\n        options: ExportDatasetOptions\n    ): Promise<ExportDatasetResponse> {\n        const params = new URLSearchParams();\n\n        let path;\n\n        if (options.evalSet) {\n            if (!options.taskId) {\n                throw new Error(\n                    \"Task ID is required for evaluation set exports\"\n                );\n            }\n            path = `/tasks/${options.taskId}/evalset/exports`;\n        } else if (options.seedSet) {\n            if (!options.taskId) {\n                throw new Error(\"Task ID is required for seed set exports\");\n            }\n            path = `/tasks/${options.taskId}/seedset/exports`;\n        } else {\n            if (!options.datasetId) {\n                throw new Error(\"Dataset ID is required for dataset exports\");\n            }\n            path = `/datasets/${options.datasetId}/exports`;\n        }\n\n        if (!path) {\n            throw new Error(\"Invalid export options\");\n        }\n\n        if (options?.email) {\n            params.append(\"email\", options.email);\n        }\n\n        if (options?.taskId) {\n            params.append(\"task_id\", options.taskId);\n        }\n\n        if (options?.includeUUID !== undefined) {\n            params.append(\"include_uuid\", options.includeUUID.toString());\n        }\n\n        if (options?.includeLabels !== undefined) {\n            params.append(\"include_labels\", options.includeLabels.toString());\n        }\n\n        if (options?.taskRunId) {\n            params.append(\"task_run_id\", options.taskRunId);\n        }\n\n        if (Array.isArray(options?.filters)) {\n            options.filters.forEach((filter) => {\n                params.append(\"filters\", JSON.stringify(filter));\n            });\n        }\n\n        return this.base.request<ExportDatasetResponse>(\n            `${path}?${params.toString()}`,\n            {\n                method: \"POST\",\n            }\n        );\n    }\n}\n","import { RefuelBase } from \"../RefuelBase\";\nimport {\n    Dataset,\n    DatasetLabeled,\n    DatasetUnlabeled,\n    EvalsetSamplingStrategy,\n    GetDatasetItemOptions,\n    LabeledDatasetItem,\n    ListDatasetItemsOptions,\n    SamplingEvent,\n    SQLFilter,\n} from \"../types\";\n\nexport class DatasetItems {\n    private readonly base: RefuelBase;\n\n    /** @internal */\n    constructor(base: RefuelBase) {\n        this.base = base;\n    }\n\n    /**\n     * Add data to a dataset\n     *\n     * @example\n     * ```ts\n     * const dataset = await refuel.datasetItems.create(datasetId, [{ \"name\": \"John Doe\" }, { \"name\": \"Jane Doe\" }]);\n     * ```\n     */\n    async create(\n        datasetId: string,\n        data: Record<string, unknown>[]\n    ): Promise<Dataset> {\n        return this.base.request<Dataset>(`/datasets/${datasetId}/items`, {\n            method: \"POST\",\n            data,\n        });\n    }\n\n    /**\n     * Get a dataset item by ID\n     *\n     * @example\n     * ```ts\n     * const item = await refuel.datasetItems.get(datasetId, itemId);\n     * ```\n     */\n    async get<T extends GetDatasetItemOptions>(\n        datasetId: string,\n        itemId: string,\n        options?: T\n    ) {\n        const params = new URLSearchParams();\n\n        if (options?.taskId) {\n            params.append(\"task_id\", options.taskId);\n        }\n\n        if (options?.modelId) {\n            params.append(\"model_id\", options.modelId);\n        }\n\n        const path = options?.taskId\n            ? `/tasks/${options.taskId}/datasets/${datasetId}/items/${itemId}`\n            : `/datasets/${datasetId}/items/${itemId}`;\n\n        const response = await this.base.request<\n            T extends { taskId: string }\n                ? LabeledDatasetItem\n                : Record<string, unknown>[]\n        >(`${path}?${params.toString()}`);\n\n        if (Array.isArray(response)) {\n            return response[0];\n        }\n\n        return response;\n    }\n\n    async list<T extends ListDatasetItemsOptions>(options: T) {\n        const params = new URLSearchParams();\n\n        let path: string | undefined;\n\n        if (options.taskId && options.evalSet) {\n            path = `/tasks/${options.taskId}/evalset`;\n        } else if (options.taskId && options.seedSet) {\n            path = `/tasks/${options.taskId}/seedset`;\n        } else if (options.taskId && options.datasetId) {\n            path = `/tasks/${options.taskId}/datasets/${options.datasetId}`;\n        } else if (options.datasetId) {\n            path = `/datasets/${options.datasetId}`;\n        } else {\n            throw new Error(\"Missing required parameters\");\n        }\n\n        if (options.filters) {\n            options.filters.forEach((filter) => {\n                params.append(\"filters\", JSON.stringify(filter));\n            });\n        }\n\n        if (options.maxItems) {\n            params.append(\"max_items\", options.maxItems.toString());\n        }\n\n        if (options.orderBy) {\n            const orderBys = Array.isArray(options.orderBy)\n                ? options.orderBy\n                : [options.orderBy];\n\n            orderBys.forEach((orderBy) => {\n                params.append(\"order_bys\", JSON.stringify(orderBy));\n            });\n        }\n\n        if (options.offset) {\n            params.append(\"offset\", options.offset.toString());\n        }\n\n        return this.base.request<\n            T extends { taskId: string } ? DatasetLabeled : DatasetUnlabeled\n        >(`${path}?${params.toString()}`);\n    }\n\n    /**\n     * Delete a dataset item\n     *\n     * @example\n     * ```ts\n     * await refuel.datasetItems.delete(datasetId, itemId);\n     * ```\n     */\n    async delete(\n        itemId: string | string[],\n        options: Pick<\n            ListDatasetItemsOptions,\n            \"datasetId\" | \"seedSet\" | \"evalSet\" | \"taskId\"\n        >\n    ): Promise<void> {\n        const itemIds = Array.isArray(itemId) ? itemId : [itemId];\n\n        let basePath: string;\n\n        if (options.taskId && options.seedSet) {\n            basePath = `/tasks/${options.taskId}/seedset/items`;\n        } else if (options.taskId && options.evalSet) {\n            basePath = `/tasks/${options.taskId}/evalset/items`;\n        } else if (options.datasetId) {\n            basePath = `/datasets/${options.datasetId}/items`;\n        } else {\n            throw new Error(\"Missing required parameters\");\n        }\n\n        await Promise.all(\n            itemIds.map((id) =>\n                this.base.request<void>(`${basePath}/${id}`, {\n                    method: \"DELETE\",\n                })\n            )\n        );\n    }\n\n    async addToEvalSet(\n        taskId: string,\n        datasetId: string,\n        options?: {\n            itemId?: string | string[];\n            samplingEvent?: SamplingEvent;\n            filters?: SQLFilter[];\n        }\n    ) {\n        if (options?.itemId) {\n            const itemIds = Array.isArray(options.itemId)\n                ? options.itemId\n                : [options.itemId];\n\n            return Promise.all(\n                itemIds.map((id) => {\n                    const params = new URLSearchParams({\n                        dataset_id: datasetId,\n                        item_id: id,\n                    });\n                    return this.base.request<void>(\n                        `/tasks/${taskId}/evalset/items?${params.toString()}`,\n                        {\n                            method: \"POST\",\n                        }\n                    );\n                })\n            );\n        }\n\n        const params = new URLSearchParams({\n            dataset_id: datasetId,\n        });\n\n        if (options?.filters) {\n            options.filters.forEach((filter) => {\n                params.append(\"filters\", JSON.stringify(filter));\n            });\n        }\n\n        const data: SamplingEvent = {\n            sample_strategy: EvalsetSamplingStrategy.NO_SAMPLING,\n            ...options?.samplingEvent,\n        };\n\n        return this.base.request<void>(\n            `/tasks/${taskId}/evalset/items?${params.toString()}`,\n            {\n                method: \"POST\",\n                data,\n            }\n        );\n    }\n}\n","import { RefuelBase } from \"../RefuelBase\";\nimport { Dataset, DatasetFromList } from \"../types\";\n\n/**\n * Handles operations related to datasets.\n * This class is not intended to be instantiated directly.\n * Instead, access it through an instance of the Refuel class.\n */\nexport class Datasets {\n    private readonly base: RefuelBase;\n\n    /** @internal */\n    constructor(base: RefuelBase) {\n        this.base = base;\n    }\n\n    /**\n     * Get a dataset by ID\n     *\n     * @example\n     * ```ts\n     * const dataset = await refuel.datasets.get(datasetId);\n     * ```\n     */\n    async get(datasetId: string): Promise<Dataset> {\n        return this.base.request<Dataset>(`/datasets/${datasetId}`);\n    }\n\n    /**\n     * List all datasets\n     *\n     * @example\n     * ```ts\n     * const datasets = await refuel.datasets.list();\n     * ```\n     */\n    async list(projectId?: string): Promise<DatasetFromList[]> {\n        const params = new URLSearchParams();\n\n        if (projectId) {\n            params.append(\"project_id\", projectId);\n        }\n\n        return this.base.request<DatasetFromList[]>(\n            `/datasets?${params.toString()}`\n        );\n    }\n\n    /**\n     * Delete a dataset\n     *\n     * @example\n     * ```ts\n     * await refuel.datasets.delete(datasetId);\n     * ```\n     */\n    async delete(datasetId: string): Promise<void> {\n        return this.base.request<void>(`/datasets/${datasetId}`, {\n            method: \"DELETE\",\n        });\n    }\n\n    /**\n     * Update a dataset\n     *\n     * @example\n     * ```ts\n     * await refuel.datasets.update(datasetId, { scheduled_ids: [\"taskId\"] });\n     * ```\n     */\n    async update(\n        datasetId: string,\n        data: Partial<Pick<Dataset, \"scheduled_ids\">>\n    ) {\n        return this.base.request<Dataset>(`/datasets/${datasetId}`, {\n            method: \"PATCH\",\n            data,\n        });\n    }\n}\n","import { RefuelBase } from \"../RefuelBase\";\nimport { LabelingModel, FinetunedModelCreateOptions } from \"../types\";\n\nexport class FinetunedModels {\n    private base: RefuelBase;\n\n    /** @internal */\n    constructor(base: RefuelBase) {\n        this.base = base;\n    }\n\n    /**\n     * Create a new finetuned model\n     *\n     * @example\n     * ```ts\n     * const model = await refuel.finetunedModels.create({\n     *     project_id: \"c4a7d428-3c8d-4e39-b887-6f3ad8d23f1c\",\n     *     task_id: \"9b2e7f15-6d4a-4c31-b518-3a69e0f98d42\",\n     *     datasets: [\"c4a7d428-3c8d-4e39-b887-6f3ad8d23f1c\"],\n     *     base_model: \"refuel-llm-2-large\",\n     *     augmented_finetuning_model: \"gpt-4o\",\n     *     hyperparameters: {\n     *         learning_rate_multiplier: 20,\n     *         num_epochs: 10,\n     *         lora_r: 32,\n     *     },\n     *     lora: true,\n     * });\n     * ```\n     */\n    async create(data: FinetunedModelCreateOptions): Promise<LabelingModel> {\n        return this.base.request<LabelingModel>(\n            `/projects/${data.project_id}/finetuned_models`,\n            {\n                method: \"POST\",\n                data,\n            }\n        );\n    }\n\n    /**\n     * Get a finetuned model by ID\n     *\n     * @example\n     * ```ts\n     * const model = await refuel.finetunedModels.get(modelId);\n     * ```\n     */\n    async get(modelId: string): Promise<LabelingModel> {\n        return this.base.request<LabelingModel>(`/finetuned_models/${modelId}`);\n    }\n\n    /**\n     * List all finetuned models for a project or task\n     *\n     * @example\n     * ```ts\n     * const models = await refuel.finetunedModels.list(projectId);\n     * ```\n     */\n    async list(projectId: string, taskId?: string): Promise<LabelingModel[]> {\n        const params = new URLSearchParams();\n        if (taskId) {\n            params.append(\"task_id\", taskId);\n        }\n\n        return this.base.request<LabelingModel[]>(\n            `/projects/${projectId}/finetuned_models?${params.toString()}`\n        );\n    }\n\n    async update(\n        modelId: string,\n        data: Partial<LabelingModel>\n    ): Promise<LabelingModel> {\n        return this.base.request<LabelingModel, Partial<LabelingModel>>(\n            `/finetuned_models/${modelId}`,\n            {\n                method: \"PATCH\",\n                data,\n            }\n        );\n    }\n\n    /**\n     * Delete a finetuned model\n     *\n     * @example\n     * ```ts\n     * await refuel.finetunedModels.delete(modelId);\n     * ```\n     */\n    async delete(modelId: string): Promise<void> {\n        return this.base.request<void>(`/finetuned_models/${modelId}`, {\n            method: \"DELETE\",\n        });\n    }\n\n    /**\n     * Check if a task is trainable\n     *\n     * @example\n     * ```ts\n     * const isTrainable = await refuel.finetunedModels.isTaskTrainable(taskId);\n     * ```\n     */\n    async isTaskTrainable(taskId: string): Promise<boolean> {\n        const response = await this.base.request<{ trainable: boolean }>(\n            `/tasks/${taskId}/trainable`\n        );\n\n        return response.trainable;\n    }\n}\n","import { RefuelBase } from \"../RefuelBase\";\nimport { Integration } from \"../types\";\n\n/**\n * Handles operations related to third party integrations.\n * This class is not intended to be instantiated directly.\n * Instead, access it through an instance of the Refuel class.\n */\nexport class Integrations {\n    private base: RefuelBase;\n\n    constructor(base: RefuelBase) {\n        this.base = base;\n    }\n\n    /**\n     * Get a third party integration by ID\n     *\n     * @example\n     * ```ts\n     * const integration = await refuel.integrations.get(integrationId);\n     * ```\n     */\n    async get(integrationId: string): Promise<Integration> {\n        return this.base.request<Integration>(`/integrations/${integrationId}`);\n    }\n\n    /**\n     * List all third party integrations\n     *\n     * @example\n     * ```ts\n     * const integrations = await refuel.integrations.list();\n     * ```\n     */\n    async list(): Promise<Integration[]> {\n        return this.base.request<Integration[]>(\"/integrations\");\n    }\n\n    /**\n     * Update a third party integration\n     *\n     * @example\n     * ```ts\n     * const integration = await refuel.integrations.update(integrationId, { is_connected: false });\n     * ```\n     */\n    async update(\n        integrationId: string,\n        data: Partial<Integration>\n    ): Promise<Integration> {\n        return this.base.request<Integration, Partial<Integration>>(\n            `/integrations/${integrationId}`,\n            {\n                method: \"PATCH\",\n                data,\n            }\n        );\n    }\n}\n","import { RefuelBase } from \"../RefuelBase\";\nimport {\n    DatasetItemLabels,\n    DatasetItemLabelsUpdate,\n    DatasetLabeled,\n    LabelListOptions,\n} from \"../types\";\n\n/**\n * Handles operations related to labels.\n * This class is not intended to be instantiated directly.\n * Instead, access it through an instance of the Refuel class.\n */\nexport class Labels {\n    private base: RefuelBase;\n\n    constructor(base: RefuelBase) {\n        this.base = base;\n    }\n\n    private getLabelsFromResponse(response: DatasetLabeled): DatasetItemLabels {\n        const labels = response.items[0].labels;\n\n        if (!labels) {\n            throw new Error(\"No labels found\");\n        }\n\n        return labels;\n    }\n\n    /**\n     * List all labels for a dataset item\n     *\n     * @example\n     * ```ts\n     * const labels = await refuel.labels.list(taskId, datasetId, itemId);\n     * ```\n     */\n    async list(\n        taskId: string,\n        datasetId: string,\n        itemId: string,\n        options?: LabelListOptions\n    ): Promise<DatasetItemLabels> {\n        const params = new URLSearchParams();\n\n        if (options?.modelId) {\n            params.append(\"model_id\", options.modelId);\n        }\n\n        if (options?.subtaskId) {\n            params.append(\"subtask_id\", options.subtaskId);\n        }\n\n        if (typeof options?.generateMissingLabels === \"boolean\") {\n            params.append(\n                \"generate_missing_labels\",\n                options.generateMissingLabels.toString()\n            );\n        }\n\n        if (typeof options?.generateMissingExplanations === \"boolean\") {\n            params.append(\n                \"generate_missing_explanations\",\n                options.generateMissingExplanations.toString()\n            );\n        }\n\n        const response = await this.base.request<DatasetLabeled>(\n            `/tasks/${taskId}/datasets/${datasetId}/items/${itemId}/label?${params.toString()}`\n        );\n\n        return this.getLabelsFromResponse(response);\n    }\n\n    /**\n     * Update labels for a dataset item\n     *\n     * @example\n     * ```ts\n     * const labels = await refuel.labels.update(taskId, datasetId, itemId, { \"subtask_id\": \"label_value\" });\n     * ```\n     */\n    async update(\n        taskId: string,\n        datasetId: string,\n        itemId: string,\n        labels: DatasetItemLabelsUpdate\n    ): Promise<DatasetItemLabels> {\n        const response = await this.base.request<DatasetLabeled>(\n            `/tasks/${taskId}/datasets/${datasetId}/items/${itemId}/label`,\n            {\n                method: \"POST\",\n                data: labels,\n            }\n        );\n\n        return this.getLabelsFromResponse(response);\n    }\n\n    /**\n     * Approve labels for a dataset item\n     *\n     * @example\n     * ```ts\n     * const labels = await refuel.labels.approve(taskId, datasetId, itemId, subtaskId);\n     * ```\n     */\n    async approve(\n        taskId: string,\n        datasetId: string,\n        itemId: string,\n        options?: {\n            subtaskId?: string;\n            modelId?: string;\n        }\n    ): Promise<DatasetItemLabels> {\n        const existingLabels = await this.list(\n            taskId,\n            datasetId,\n            itemId,\n            options\n        );\n\n        let updatedLabels: DatasetItemLabelsUpdate = {};\n\n        if (options?.subtaskId) {\n            const existingSubtaskLabels = existingLabels[options.subtaskId];\n\n            if (!existingSubtaskLabels) {\n                throw new Error(\n                    `No labels found for subtask ${options.subtaskId}`\n                );\n            }\n\n            updatedLabels[options.subtaskId] = existingSubtaskLabels;\n        } else {\n            updatedLabels = existingLabels;\n        }\n\n        return this.update(taskId, datasetId, itemId, updatedLabels);\n    }\n\n    async generateExplanations(\n        taskId: string,\n        datasetId: string,\n        itemId: string,\n        options?: {\n            subtaskId?: string;\n            modelId?: string;\n        }\n    ): Promise<DatasetItemLabels> {\n        const params = new URLSearchParams();\n        params.append(\"generate_missing_explanations\", \"true\");\n\n        if (options?.subtaskId) {\n            params.append(\"subtask_id\", options.subtaskId);\n        }\n\n        if (options?.modelId) {\n            params.append(\"model_id\", options.modelId);\n        }\n\n        const response = await this.base.request<DatasetLabeled>(\n            `/tasks/${taskId}/datasets/${datasetId}/items/${itemId}/label?${params.toString()}`\n        );\n\n        return this.getLabelsFromResponse(response);\n    }\n}\n","import { RefuelBase } from \"../RefuelBase\";\nimport { Project, ProjectData } from \"../types\";\n\n/**\n * Handles operations related to projects.\n * This class is not intended to be instantiated directly.\n * Instead, access it through an instance of the Refuel class.\n */\nexport class Projects {\n    private base: RefuelBase;\n\n    constructor(base: RefuelBase) {\n        this.base = base;\n    }\n\n    /**\n     * Create a new project\n     *\n     * @example\n     * ```ts\n     * const project = await refuel.projects.create({\n     *     project_name: \"My Project\",\n     * });\n     * ```\n     */\n    async create(data: ProjectData): Promise<Project> {\n        const params = new URLSearchParams();\n        params.append(\"project_name\", data.project_name);\n        params.append(\"description\", data.description || \"\");\n\n        return this.base.request<Project>(`/projects?${params.toString()}`, {\n            method: \"POST\",\n            data,\n        });\n    }\n\n    /**\n     * Get a project by ID\n     *\n     * @example\n     * ```ts\n     * const project = await refuel.projects.get(projectId);\n     * ```\n     */\n    async get(projectId: string): Promise<Project> {\n        return this.base.request<Project>(`/projects/${projectId}`);\n    }\n\n    /**\n     * List all projects\n     *\n     * @example\n     * ```ts\n     * const projects = await refuel.projects.list();\n     * ```\n     */\n    async list(): Promise<Project[]> {\n        return this.base.request<Project[]>(\"/projects\");\n    }\n\n    /**\n     * Delete a project and all associated resources\n     *\n     * @example\n     * ```ts\n     * await refuel.projects.delete(projectId);\n     * ```\n     */\n    async delete(projectId: string): Promise<void> {\n        return this.base.request<void>(`/projects/${projectId}`, {\n            method: \"DELETE\",\n        });\n    }\n}\n","export const DEFAULT_BASE_URL = \"https://cloud-api.refuel.ai\";\nexport const DEFAULT_MAX_RETRIES = 5;\nexport const DEFAULT_INITIAL_RETRY_TIMEOUT = 2_500;\nexport const DEFAULT_RETRY_STATUS_CODES = [202, 429, 504];\n","import {\n    DEFAULT_BASE_URL,\n    DEFAULT_MAX_RETRIES,\n    DEFAULT_RETRY_STATUS_CODES,\n    DEFAULT_INITIAL_RETRY_TIMEOUT,\n} from \"../consts\";\nimport { RefuelOptions, RequestOptions } from \"../types\";\n\nexport class RefuelAPIError extends Error {\n    constructor(\n        public readonly response?: Response,\n        public readonly url: string | undefined = response?.url,\n        public readonly status: number | undefined = response?.status\n    ) {\n        super(`${response?.statusText || \"Network error\"} (${url})`);\n        this.name = \"RefuelAPIError\";\n    }\n}\n\n/** @internal */\nexport class RefuelBase {\n    protected readonly accessToken: string;\n    protected readonly baseUrl: string;\n    protected readonly maxRetries: number;\n    protected readonly initialRetryTimeout: number;\n    protected readonly retryStatusCodes: number[];\n\n    constructor(accessToken: string, options: RefuelOptions = {}) {\n        this.accessToken = accessToken;\n        this.baseUrl = options.baseUrl ?? DEFAULT_BASE_URL;\n        this.maxRetries = options.maxRetries ?? DEFAULT_MAX_RETRIES;\n        this.initialRetryTimeout =\n            options.initialRetryTimeout ?? DEFAULT_INITIAL_RETRY_TIMEOUT;\n        this.retryStatusCodes =\n            options.retryStatusCodes ?? DEFAULT_RETRY_STATUS_CODES;\n    }\n\n    public async request<Response, RequestBody = unknown>(\n        endpoint: string,\n        options?: RequestOptions<RequestBody>\n    ): Promise<Response> {\n        const {\n            method = \"GET\",\n            data,\n            maxRetries = this.maxRetries,\n            initialRetryTimeout = this.initialRetryTimeout,\n            retryStatusCodes = this.retryStatusCodes,\n        } = options || {};\n\n        const url = `${this.baseUrl}${endpoint}`;\n        const headers: HeadersInit = {\n            Authorization: `Bearer ${this.accessToken}`,\n        };\n\n        let body: BodyInit | undefined;\n\n        if (data instanceof FormData) {\n            body = data;\n        } else if (data) {\n            headers[\"Content-Type\"] = \"application/json\";\n            body = JSON.stringify(data);\n        }\n\n        let retries = 0;\n\n        while (true) {\n            let response: globalThis.Response | undefined = undefined;\n\n            try {\n                response = await fetch(url, {\n                    method,\n                    headers,\n                    body,\n                });\n            } catch {}\n\n            if (\n                method.toUpperCase() === \"GET\" &&\n                (!response || retryStatusCodes.includes(response.status))\n            ) {\n                if (retries >= maxRetries) {\n                    throw new RefuelAPIError(response, url);\n                }\n                // Proceed to retry logic\n            } else if (!response?.ok) {\n                // Non-retriable error\n                throw new RefuelAPIError(response, url);\n            } else {\n                // Successful response\n                const responseJSON = await response.json();\n                return (responseJSON.data || responseJSON) as Response;\n            }\n\n            // Retry logic\n            // Calculate exponential backoff with jitter\n            const baseBackoff = initialRetryTimeout * Math.pow(2, retries);\n            const jitter = Math.random() * 1_000;\n            const backoffTime = baseBackoff + jitter;\n\n            // Wait for the calculated backoff time\n            await new Promise((resolve) => setTimeout(resolve, backoffTime));\n\n            retries += 1;\n        }\n    }\n}\n","import { RefuelBase } from \"../RefuelBase\";\nimport { LabelingModel } from \"../types\";\n\n/**\n * Handles operations related to labeling models.\n * This class is not intended to be instantiated directly.\n * Instead, access it through an instance of the Refuel class.\n */\nexport class TaskModels {\n    private base: RefuelBase;\n\n    constructor(base: RefuelBase) {\n        this.base = base;\n    }\n\n    /**\n     * List all models available for a task\n     *\n     * @example\n     * ```ts\n     * const models = await refuel.taskModels.list(taskId);\n     * ```\n     */\n    async list(taskId: string): Promise<LabelingModel[]> {\n        const response = await this.base.request<{ models: LabelingModel[] }>(\n            `/tasks/${taskId}/models`\n        );\n        return response.models;\n    }\n}\n","import { RefuelBase } from \"../RefuelBase\";\nimport {\n    TaskRun,\n    TaskRunCancelOptions,\n    TaskRunCreateOptions,\n    TaskRunListOptions,\n} from \"../types\";\n\n/**\n * Handles operations related to task runs.\n * This class is not intended to be instantiated directly.\n * Instead, access it through an instance of the Refuel class.\n */\nexport class TaskRuns {\n    private base: RefuelBase;\n\n    constructor(base: RefuelBase) {\n        this.base = base;\n    }\n\n    /**\n     * Create a task run\n     *\n     * @example\n     * ```ts\n     * const taskRun = await refuel.taskRuns.create(taskId, { datasetId });\n     * ```\n     */\n    async create(\n        taskId: string,\n        options?: TaskRunCreateOptions\n    ): Promise<TaskRun> {\n        if (!options?.datasetId && !options?.evalSet) {\n            throw new Error(\"Either datasetId or evalSet must be provided\");\n        }\n\n        const params = new URLSearchParams();\n\n        if (options?.numItems) {\n            params.append(\"num_items\", options.numItems.toString());\n        }\n\n        if (options?.filters) {\n            options.filters.forEach((filter) => {\n                params.append(\"filters\", JSON.stringify(filter));\n            });\n        }\n\n        if (options?.modelIds?.length) {\n            options.modelIds.forEach((modelId) => {\n                params.append(\"model_ids\", modelId);\n            });\n        }\n\n        if (options?.datasetId) {\n            params.append(\"dataset_id\", options.datasetId);\n        }\n\n        const endpoint = options?.evalSet\n            ? `/tasks/${taskId}/evalset/runs?${params.toString()}`\n            : `/tasks/${taskId}/runs?${params.toString()}`;\n\n        return this.base.request<TaskRun>(endpoint, {\n            method: \"POST\",\n        });\n    }\n\n    /**\n     * Cancel a task run\n     *\n     * @example\n     * ```ts\n     * await refuel.taskRuns.cancel(taskId, { datasetId });\n     * ```\n     */\n    async cancel(taskId: string, options: TaskRunCancelOptions): Promise<void> {\n        if (!options.datasetId && !options.evalSet) {\n            throw new Error(\"Either datasetId or evalSet must be provided\");\n        }\n\n        const params = new URLSearchParams();\n\n        params.append(\"cancel_run\", \"true\");\n\n        if (options?.datasetId) {\n            params.append(\"dataset_id\", options.datasetId);\n        }\n\n        const endpoint = options?.evalSet\n            ? `/tasks/${taskId}/evalset/runs`\n            : `/tasks/${taskId}/runs?${params.toString()}`;\n\n        return this.base.request<void>(endpoint, {\n            method: \"POST\",\n        });\n    }\n\n    /**\n     * List all task runs\n     *\n     * @example\n     * ```ts\n     * const taskRuns = await refuel.taskRuns.list(taskId);\n     * ```\n     */\n    async list(\n        taskId: string,\n        options?: TaskRunListOptions\n    ): Promise<TaskRun[]> {\n        let endpoint = `/tasks/${taskId}/runs`;\n\n        if (options?.datasetId && options?.evalSet) {\n            throw new Error(\"Cannot provide both datasetId and evalSet\");\n        }\n\n        if (options?.datasetId) {\n            endpoint += `/${options.datasetId}`;\n        } else if (options?.evalSet) {\n            endpoint = `/tasks/${taskId}/evalset/runs`;\n        }\n\n        const response = await this.base.request<TaskRun | TaskRun[]>(endpoint);\n\n        if (Array.isArray(response)) {\n            return response;\n        }\n\n        return [response];\n    }\n}\n","import { RefuelBase } from \"../RefuelBase\";\nimport { Task } from \"../types\";\n\n/**\n * Handles operations related to tasks.\n * This class is not intended to be instantiated directly.\n * Instead, access it through an instance of the Refuel class.\n */\nexport class Tasks {\n    private readonly base: RefuelBase;\n\n    constructor(base: RefuelBase) {\n        this.base = base;\n    }\n\n    /**\n     * Create a task\n     *\n     * @example\n     * ```ts\n     * const task = await refuel.tasks.create({ task_name: \"My Task\", project_id: \"123\" });\n     * ```\n     */\n    async create(data: Partial<Task>): Promise<Task> {\n        if (!data.task_name) {\n            throw new Error(\"task name is required\");\n        }\n\n        if (!data.project_id) {\n            throw new Error(\"project id is required\");\n        }\n\n        const params = new URLSearchParams({\n            task_name: data.task_name,\n            project_id: data.project_id,\n        });\n\n        return this.base.request<Task>(\n            `/projects/${data.project_id}/tasks?${params.toString()}`,\n            {\n                method: \"POST\",\n                data,\n            }\n        );\n    }\n\n    /**\n     * Get a task by ID\n     *\n     * @example\n     * ```ts\n     * const task = await refuel.tasks.get(taskId);\n     * ```\n     */\n    async get(taskId: string): Promise<Task> {\n        return this.base.request<Task>(`/tasks/${taskId}`);\n    }\n\n    /**\n     * List all tasks\n     *\n     * @example\n     * ```ts\n     * const tasks = await refuel.tasks.list();\n     * ```\n     */\n    async list(projectId?: string): Promise<Task[]> {\n        const endpoint = projectId ? `/projects/${projectId}/tasks` : \"/tasks\";\n\n        return this.base.request<Task[]>(endpoint);\n    }\n\n    /**\n     * Update a task\n     *\n     * @example\n     * ```ts\n     * const task = await refuel.tasks.update(taskId, { name: \"New Name\" });\n     * ```\n     */\n    async update(taskId: string, data: Partial<Task>): Promise<Task> {\n        return this.base.request<Task, Partial<Task>>(`/tasks/${taskId}`, {\n            method: \"POST\",\n            data,\n        });\n    }\n\n    /**\n     * Delete a task\n     *\n     * @example\n     * ```ts\n     * await refuel.tasks.delete(taskId);\n     * ```\n     */\n    async delete(taskId: string): Promise<void> {\n        return this.base.request<void>(`/tasks/${taskId}`, {\n            method: \"DELETE\",\n        });\n    }\n\n    /**\n     * Duplicate a task\n     *\n     * @example\n     * ```ts\n     * const task = await refuel.tasks.duplicate(taskId);\n     * ```\n     */\n    async duplicate(taskId: string): Promise<Task> {\n        const task = await this.get(taskId);\n\n        if (!task.id) {\n            throw new Error(\"task id is required\");\n        }\n\n        if (!task.project_id) {\n            throw new Error(\"project id is required\");\n        }\n\n        const duplicateName = `${task.task_name} (Copy)`;\n        const params = new URLSearchParams({\n            ref_task_id: task.id,\n            project_id: task.project_id,\n            task_name: duplicateName,\n        });\n\n        return this.base.request<Task>(\n            `/projects/${task.project_id}/tasks?${params.toString()}`,\n            {\n                method: \"POST\",\n            }\n        );\n    }\n\n    /**\n     * Reset all LLM and human verified labels\n     *\n     * @example\n     * ```ts\n     * await refuel.tasks.reset(taskId);\n     * ```\n     */\n    async reset(taskId: string): Promise<void> {\n        const params = new URLSearchParams({\n            clear_labels_and_feedback: \"true\",\n        });\n\n        return this.base.request<void>(\n            `/tasks/${taskId}?${params.toString()}`,\n            {\n                method: \"POST\",\n            }\n        );\n    }\n\n    /**\n     * Delete a subtask field from a task\n     *\n     * @example\n     * ```ts\n     * await refuel.tasks.deleteSubtask(taskId, subtaskId);\n     * ```\n     */\n    async deleteSubtask(\n        taskId: string,\n        subtaskId: string | string[]\n    ): Promise<void> {\n        const subtaskIds = Array.isArray(subtaskId) ? subtaskId : [subtaskId];\n\n        await Promise.all(\n            subtaskIds.map((id) =>\n                this.base.request<void>(`/tasks/${taskId}/subtasks/${id}`, {\n                    method: \"DELETE\",\n                })\n            )\n        );\n    }\n\n    /**\n     * Delete an enrichment field from a task\n     *\n     * @example\n     * ```ts\n     * await refuel.tasks.deleteEnrichment(taskId, enrichmentId);\n     * ```\n     */\n    async deleteEnrichment(\n        taskId: string,\n        enrichmentId: string | string[]\n    ): Promise<void> {\n        const enrichmentIds = Array.isArray(enrichmentId)\n            ? enrichmentId\n            : [enrichmentId];\n\n        await Promise.all(\n            enrichmentIds.map((id) =>\n                this.base.request<void>(`/tasks/${taskId}/transforms/${id}`, {\n                    method: \"DELETE\",\n                })\n            )\n        );\n    }\n}\n","import { RefuelBase } from \"../RefuelBase\";\nimport { TaxonomyLabelData, TaxonomyLabelsResponse } from \"../types\";\n\n/**\n * Handles operations related to taxonomies.\n * This class is not intended to be instantiated directly.\n * Instead, access it through an instance of the Refuel class.\n */\nexport class Taxonomies {\n    private readonly base: RefuelBase;\n\n    constructor(base: RefuelBase) {\n        this.base = base;\n    }\n\n    /**\n     * Create a taxonomy for a task\n     *\n     * @example\n     * ```ts\n     * const taxonomy = await refuel.taxonomies.create(taskId, [\n     *  { name: \"Label 1\" },\n     *  { name: \"Label 2\" },\n     * ]);\n     * ```\n     */\n    async create(\n        taskId: string,\n        labels: TaxonomyLabelData | TaxonomyLabelData[] = []\n    ): Promise<TaxonomyLabelsResponse> {\n        const data = new FormData();\n\n        data.append(\n            \"labels\",\n            JSON.stringify(Array.isArray(labels) ? labels : [labels])\n        );\n\n        return this.base.request<TaxonomyLabelsResponse>(\n            `/tasks/${taskId}/taxonomies`,\n            {\n                method: \"POST\",\n                data,\n            }\n        );\n    }\n\n    async get(taskId: string, taxonomyId: string) {\n        return this.base.request<TaxonomyLabelsResponse>(\n            `/tasks/${taskId}/taxonomies/${taxonomyId}`\n        );\n    }\n\n    /**\n     * Delete a taxonomy\n     *\n     * @example\n     * ```ts\n     * await refuel.taxonomies.delete(taskId, taxonomyId);\n     * ```\n     */\n    async delete(taskId: string, taxonomyId: string): Promise<void> {\n        return this.base.request<void>(\n            `/tasks/${taskId}/taxonomies/${taxonomyId}`,\n            {\n                method: \"DELETE\",\n            }\n        );\n    }\n\n    /**\n     * Create a duplicate of an existing taxonomy\n     *\n     * @example\n     * ```ts\n     * const taxonomy = await refuel.taxonomies.duplicate(taskId, taxonomyId);\n     * ```\n     */\n    async duplicate(\n        taskId: string,\n        taxonomyId: string\n    ): Promise<TaxonomyLabelsResponse> {\n        return this.base.request<TaxonomyLabelsResponse>(\n            `/tasks/${taskId}/taxonomies/${taxonomyId}/duplicate`,\n            {\n                method: \"POST\",\n            }\n        );\n    }\n}\n","import { RefuelBase } from \"../RefuelBase\";\nimport {\n    TaxonomyLabelsResponse,\n    TaxonomyLabel,\n    TaxonomyLabelData,\n} from \"../types\";\n\n/**\n * Handles operations related to taxonomy labels.\n * This class is not intended to be instantiated directly.\n * Instead, access it through an instance of the Refuel class.\n */\nexport class TaxonomyLabels {\n    private readonly base: RefuelBase;\n\n    constructor(base: RefuelBase) {\n        this.base = base;\n    }\n\n    /**\n     * Add labels to a taxonomy\n     *\n     * @example\n     * ```ts\n     * const label = await refuel.taxonomyLabels.create(taskId, taxonomyId, [\n     *  { name: \"Label 1\" },\n     *  { name: \"Label 2\" },\n     * ]);\n     * ```\n     */\n    async create(\n        taskId: string,\n        taxonomyId: string,\n        labels: TaxonomyLabelData | TaxonomyLabelData[]\n    ): Promise<void> {\n        const data = new FormData();\n\n        data.append(\n            \"labels\",\n            JSON.stringify(Array.isArray(labels) ? labels : [labels])\n        );\n\n        return this.base.request<void>(\n            `/tasks/${taskId}/taxonomies/${taxonomyId}`,\n            {\n                method: \"POST\",\n                data,\n            }\n        );\n    }\n\n    /**\n     * List all labels in a taxonomy\n     *\n     * @example\n     * ```ts\n     * const labels = await refuel.taxonomyLabels.list(taskId, taxonomyId);\n     * ```\n     */\n    async list(\n        taskId: string,\n        taxonomyId: string,\n        options?: {\n            filter?: string;\n            offset?: number;\n            maxItems?: number;\n        }\n    ): Promise<TaxonomyLabelsResponse> {\n        const params = new URLSearchParams();\n\n        if (options?.offset) {\n            params.append(\"offset\", options.offset.toString());\n        }\n\n        if (options?.maxItems) {\n            params.append(\"max_items\", options.maxItems.toString());\n        }\n\n        if (options?.filter) {\n            params.append(\"filter\", options?.filter);\n        }\n\n        return this.base.request<TaxonomyLabelsResponse>(\n            `/tasks/${taskId}/taxonomies/${taxonomyId}?${params.toString()}`\n        );\n    }\n\n    /**\n     * Update a label in a taxonomy\n     *\n     * @example\n     * ```ts\n     * const label = await refuel.taxonomyLabels.update(taskId, taxonomyId, labelId, { name: \"New Name\" });\n     * ```\n     */\n    async update(\n        taskId: string,\n        taxonomyId: string,\n        labelId: string,\n        data: Partial<TaxonomyLabelData>\n    ): Promise<TaxonomyLabel> {\n        return this.base.request<TaxonomyLabel>(\n            `/tasks/${taskId}/taxonomies/${taxonomyId}/labels/${labelId}`,\n            {\n                method: \"PATCH\",\n                data,\n            }\n        );\n    }\n\n    /**\n     * Delete a label from a taxonomy\n     *\n     * @example\n     * ```ts\n     * await refuel.taxonomyLabels.delete(taskId, taxonomyId, labelId);\n     * ```\n     */\n    async delete(\n        taskId: string,\n        taxonomyId: string,\n        labelId: string\n    ): Promise<void> {\n        return this.base.request<void>(\n            `/tasks/${taskId}/taxonomies/${taxonomyId}/labels/${labelId}`,\n            {\n                method: \"DELETE\",\n            }\n        );\n    }\n}\n","import { RefuelBase } from \"../RefuelBase\";\nimport { RefuelTeam } from \"../types\";\n\nexport class Team {\n    private readonly base: RefuelBase;\n\n    constructor(base: RefuelBase) {\n        this.base = base;\n    }\n\n    /**\n     * Get the current team\n     *\n     * @example\n     * ```ts\n     * const team = await refuel.team.get();\n     * ```\n     */\n    async get(): Promise<RefuelTeam> {\n        return this.base.request<RefuelTeam>(\"/team\");\n    }\n\n    /**\n     * Regenerate the API key for the current team\n     *\n     * @example\n     * ```ts\n     * const apiKey = await refuel.team.regenerateApiKey();\n     * ```\n     */\n    async regenerateApiKey(): Promise<string> {\n        const params = new URLSearchParams({ regenerate_api_key: \"true\" });\n        await this.base.request<void>(`/team?${params.toString()}`, {\n            method: \"POST\",\n        });\n        return (await this.get()).refuel_api_key;\n    }\n\n    /**\n     * Sign a URL\n     *\n     * @example\n     * ```ts\n     * const signedUrl = await refuel.team.signUrl(\"https://example.com\");\n     * ```\n     */\n    async signUrl(url: string): Promise<{ url: string }> {\n        const params = new URLSearchParams();\n        params.append(\"url\", url);\n\n        return this.base.request<{ url: string }>(\n            `/team/sign-url?${params.toString()}`\n        );\n    }\n}\n","import { RefuelBase } from \"../RefuelBase\";\nimport { TeamModel } from \"../types\";\n\nexport class TeamModels {\n    private base: RefuelBase;\n\n    constructor(base: RefuelBase) {\n        this.base = base;\n    }\n\n    async list(): Promise<TeamModel[]> {\n        return this.base.request<TeamModel[]>(\"/models\");\n    }\n}\n","import { RefuelBase } from \"../RefuelBase\";\nimport { TeamUsageData, TeamUsageGetOptions } from \"../types\";\n\nexport class TeamUsage {\n    private readonly base: RefuelBase;\n\n    constructor(base: RefuelBase) {\n        this.base = base;\n    }\n\n    /**\n     * Get usage data for a specific time period\n     *\n     * @example\n     * ```ts\n     * const usage = await refuel.usage.get(\"2024-01-01\", \"2024-01-31\");\n     * ```\n     */\n    async get(\n        startDate: string,\n        endDate: string,\n        options?: TeamUsageGetOptions\n    ): Promise<TeamUsageData> {\n        const params = new URLSearchParams();\n        params.append(\"start_date\", startDate);\n        params.append(\"end_date\", endDate);\n\n        if (options?.applicationId) {\n            params.append(\"application_id\", options.applicationId);\n        }\n\n        if (options?.taskId) {\n            params.append(\"task_id\", options.taskId);\n        }\n\n        if (options?.modelId) {\n            params.append(\"model\", options.modelId);\n        }\n\n        return this.base.request<TeamUsageData>(`/usage?${params.toString()}`);\n    }\n}\n","import { RefuelBase } from \"../RefuelBase\";\nimport { InviteUsersResponse, User } from \"../types\";\n\n/**\n * Handles operations related to users.\n * This class is not intended to be instantiated directly.\n * Instead, access it through an instance of the Refuel class.\n */\nexport class Users {\n    private readonly base: RefuelBase;\n\n    constructor(base: RefuelBase) {\n        this.base = base;\n    }\n\n    /**\n     * Invite users to your team\n     *\n     * @example\n     * ```ts\n     * const response = await refuel.users.create([\"user1@example.com\", \"user2@example.com\"]);\n     * ```\n     */\n    async create(email: string | string[]) {\n        const data = Array.isArray(email) ? email : [email];\n        return this.base.request<InviteUsersResponse, string[]>(\"/users\", {\n            method: \"POST\",\n            data,\n        });\n    }\n\n    /**\n     * Get a user by ID\n     *\n     * @example\n     * ```ts\n     * const user = await refuel.users.get(userId);\n     * ```\n     */\n    async get(userId: string): Promise<User> {\n        return this.base.request<User>(`/users/${userId}`);\n    }\n\n    /**\n     * List all users in your team\n     *\n     * @example\n     * ```ts\n     * const users = await refuel.users.list();\n     * ```\n     */\n    async list(): Promise<User[]> {\n        return this.base.request<User[]>(\"/users\");\n    }\n}\n","import { RefuelBase } from \"../RefuelBase\";\nimport { ApplicationUsageData } from \"../types\";\n\nexport class ApplicationUsage {\n    private readonly base: RefuelBase;\n\n    constructor(base: RefuelBase) {\n        this.base = base;\n    }\n\n    /**\n     * Get usage data for a specific time period\n     *\n     * @example\n     * ```ts\n     * const usage = await refuel.applicationUsage.get(\"123\", \"2024-01-01\", \"2024-01-31\");\n     * ```\n     */\n    async get(\n        applicationId: string,\n        startDate: string,\n        endDate: string,\n        /** period in seconds */\n        period?: number\n    ): Promise<ApplicationUsageData> {\n        const params = new URLSearchParams();\n        params.append(\"start_date\", startDate);\n        params.append(\"end_date\", endDate);\n\n        if (period) {\n            params.append(\"period\", period.toString());\n        }\n\n        return this.base.request<ApplicationUsageData>(\n            `/applications/${applicationId}/usage?${params.toString()}`\n        );\n    }\n}\n","import { RefuelBase } from \"../RefuelBase\";\nimport { TaskRunMetricsListOptions, TaskRunMetricsResponse } from \"../types\";\n\n/**\n * Handles operations related to task metrics.\n * This class is not intended to be instantiated directly.\n * Instead, access it through an instance of the Refuel class.\n */\nexport class TaskRunMetrics {\n    private base: RefuelBase;\n\n    constructor(base: RefuelBase) {\n        this.base = base;\n    }\n\n    /**\n     * Get metrics for a task run\n     *\n     * @example\n     * ```ts\n     * const metrics = await refuel.taskRunMetrics.get(taskId, { datasetId: \"123\" });\n     * ```\n     */\n    async list(\n        taskId: string,\n        options: TaskRunMetricsListOptions\n    ): Promise<TaskRunMetricsResponse> {\n        if (options.datasetId && options.evalSet) {\n            throw new Error(\n                \"Cannot specify both datasetId and evalSet. Please specify one or the other.\"\n            );\n        }\n\n        const path = options.evalSet\n            ? `/tasks/${taskId}/evalset/metrics`\n            : `/tasks/${taskId}/runs/${options.datasetId}/metrics`;\n\n        const params = new URLSearchParams();\n\n        if (options.filters) {\n            options.filters.forEach((filter) => {\n                params.append(\"filters\", JSON.stringify(filter));\n            });\n        }\n\n        if (options.modelId) {\n            params.append(\"model_id\", options.modelId);\n        }\n\n        return this.base.request<TaskRunMetricsResponse>(\n            `${path}?${params.toString()}`\n        );\n    }\n}\n","import { RefuelAPIError } from \"./RefuelBase\";\nimport { DatasetLabeled, LabeledDatasetItem, Telemetry } from \"./types\";\n\nexport const isLabeledDatasetItem = (\n    arg: unknown\n): arg is LabeledDatasetItem => {\n    return (\n        typeof arg === \"object\" &&\n        arg !== null &&\n        \"fields\" in arg &&\n        \"labels\" in arg &&\n        Array.isArray(arg[\"labels\"])\n    );\n};\n\nexport const isDatasetLabeled = (arg: unknown): arg is DatasetLabeled => {\n    return (\n        typeof arg === \"object\" &&\n        arg !== null &&\n        \"items\" in arg &&\n        Array.isArray(arg?.items) &&\n        isLabeledDatasetItem(arg.items[0])\n    );\n};\n\nexport const isTelemetry = (arg: unknown): arg is Telemetry => {\n    return (\n        typeof arg === \"object\" &&\n        arg !== null &&\n        \"telemetry_type\" in arg &&\n        \"telemetry_value\" in arg\n    );\n};\n\nexport const isRefuelAPIError = (arg: unknown): arg is RefuelAPIError => {\n    return arg instanceof RefuelAPIError;\n};\n","import { Applications } from \"./Applications\";\nimport { Calibrations } from \"./Calibrations\";\nimport { DatasetExports } from \"./DatasetExports\";\nimport { DatasetItems } from \"./DatasetItems\";\nimport { Datasets } from \"./Datasets\";\nimport { FinetunedModels } from \"./FinetunedModels\";\nimport { Integrations } from \"./Integrations\";\nimport { Labels } from \"./Labels\";\nimport { Projects } from \"./Projects\";\nimport { RefuelBase } from \"./RefuelBase\";\nimport { TaskModels } from \"./TaskModels\";\nimport { TaskRuns } from \"./TaskRuns\";\nimport { Tasks } from \"./Tasks\";\nimport { Taxonomies } from \"./Taxonomies\";\nimport { TaxonomyLabels } from \"./TaxonomyLabels\";\nimport { Team } from \"./Team\";\nimport { TeamModels } from \"./TeamModels\";\nimport { RefuelOptions } from \"./types\";\nimport { TeamUsage } from \"./TeamUsage\";\nimport { Users } from \"./Users\";\nimport { ApplicationUsage } from \"./ApplicationUsage\";\nimport { TaskRunMetrics } from \"./TaskRunMetrics\";\n\n/**\n * Main class for interacting with the Refuel API.\n *\n * @example\n * ```ts\n * // Initialize the Refuel class with your access token\n * const refuel = new Refuel(accessToken);\n *\n * // List all projects\n * const projects = await refuel.projects.list();\n * console.log(projects);\n * ```\n */\nexport class Refuel {\n    public readonly base: RefuelBase;\n\n    public readonly applications: Applications;\n    public readonly applicationUsage: ApplicationUsage;\n    public readonly calibrations: Calibrations;\n    public readonly datasetExports: DatasetExports;\n    public readonly datasetItems: DatasetItems;\n    public readonly datasets: Datasets;\n    public readonly finetunedModels: FinetunedModels;\n    public readonly integrations: Integrations;\n    public readonly labels: Labels;\n    public readonly projects: Projects;\n    public readonly taskModels: TaskModels;\n    public readonly taskRunMetrics: TaskRunMetrics;\n    public readonly taskRuns: TaskRuns;\n    public readonly tasks: Tasks;\n    public readonly taxonomies: Taxonomies;\n    public readonly taxonomyLabels: TaxonomyLabels;\n    public readonly team: Team;\n    public readonly teamModels: TeamModels;\n    public readonly teamUsage: TeamUsage;\n    public readonly users: Users;\n\n    constructor(options?: RefuelOptions | string) {\n        let apiKey = typeof options === \"string\" ? options : options?.apiKey;\n\n        if (!apiKey && typeof process !== \"undefined\") {\n            apiKey = process.env.REFUEL_API_KEY;\n        }\n\n        if (!apiKey) {\n            throw new Error(\"Refuel API key is required\");\n        }\n\n        this.base = new RefuelBase(\n            apiKey,\n            typeof options === \"string\" ? undefined : options\n        );\n\n        this.applications = new Applications(this.base);\n        this.applicationUsage = new ApplicationUsage(this.base);\n        this.calibrations = new Calibrations(this.base);\n        this.datasets = new Datasets(this.base);\n        this.datasetItems = new DatasetItems(this.base);\n        this.datasetExports = new DatasetExports(this.base);\n        this.finetunedModels = new FinetunedModels(this.base);\n        this.integrations = new Integrations(this.base);\n        this.labels = new Labels(this.base);\n        this.projects = new Projects(this.base);\n        this.taskModels = new TaskModels(this.base);\n        this.taskRunMetrics = new TaskRunMetrics(this.base);\n        this.taskRuns = new TaskRuns(this.base);\n        this.tasks = new Tasks(this.base);\n        this.taxonomies = new Taxonomies(this.base);\n        this.taxonomyLabels = new TaxonomyLabels(this.base);\n        this.team = new Team(this.base);\n        this.teamModels = new TeamModels(this.base);\n        this.teamUsage = new TeamUsage(this.base);\n        this.users = new Users(this.base);\n    }\n}\n\nexport * from \"./types\";\nexport * from \"./utils\";\n"],"names":[],"mappings":"AAWA;;;;AAIG;MACU,YAAY,CAAA;;AAIrB,IAAA,WAAA,CAAY,IAAgB,EAAA;AACxB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;;AAGpB;;;;;;;;;;AAUG;IACH,MAAM,MAAM,CAAC,OAAiC,EAAA;AAC1C,QAAA,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE;QACpC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC;AAExC,QAAA,IAAI,OAAO,CAAC,IAAI,EAAE;YACd,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC;;AAGvC,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CACpB,CAAa,UAAA,EAAA,OAAO,CAAC,SAAS,iBAAiB,MAAM,CAAC,QAAQ,EAAE,EAAE,EAClE;AACI,YAAA,MAAM,EAAE,MAAM;AACjB,SAAA,CACJ;;AAGL;;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