import { APIResource } from "../../../core/resource.js"; import { APIPromise } from "../../../core/api-promise.js"; import { RequestOptions } from "../../../internal/request-options.js"; export declare class Preferences extends APIResource { /** * Returns a single preference by type. value=null when the user has not set this * preference yet. model-preference-value requires the chatbot_id query parameter. * Requires X-Tenant-ID header. */ retrieve(preferenceType: UserPreferenceSlug, params?: PreferenceRetrieveParams | null | undefined, options?: RequestOptions): APIPromise; /** * Creates or updates a preference (idempotent). Invalidates the server-side cache * on success. model-preference-value requires the chatbot_id query parameter. * Requires X-Tenant-ID header. */ update(preferenceType: UserPreferenceSlug, params: PreferenceUpdateParams, options?: RequestOptions): APIPromise; } /** * Single preference item returned by GET and PUT endpoints. * * Attributes: type (UserPreferenceType): The preference type identifier. value * (dict | None): Type-specific payload; null if not yet configured. updated_at * (datetime | None): Last update timestamp; null when value is null. */ export interface UserPreferenceResponse { /** * Supported user preference types. * * MODEL_PREFERENCE_SELECTION: user's model mode choice (SAVE_LAST_USAGE / * SYSTEM_DEFAULT); global. MODEL_PREFERENCE_VALUE: last-used model per chatbot * (model_id); chatbot-scoped, system-managed. ANONYMIZE_DATA_PREFERENCE_SELECTION: * user's anonymize mode choice + global enabled toggle; global. * ANONYMIZE_DATA_PREFERENCE_VALUE: last-used anonymize enabled flag per chatbot; * chatbot-scoped, system-managed. GREETING_NAME_PREFERENCE: user's custom greeting * name shown on the welcome page; global. */ type: UserPreferenceType; updated_at: string | null; value: { [key: string]: unknown; } | null; } /** * Public URL slugs for user preference types (lowercase kebab-case). * * Member names mirror UserPreferenceType so the two stay 1:1. Internal enum values * are never exposed in URLs; legacy uppercase values are only accepted on input by * the router. */ export type UserPreferenceSlug = 'model-preference-selection' | 'model-preference-value' | 'anonymize-data-preference-selection' | 'anonymize-data-preference-value' | 'project-preference' | 'greeting-name-preference'; /** * Supported user preference types. * * MODEL_PREFERENCE_SELECTION: user's model mode choice (SAVE_LAST_USAGE / * SYSTEM_DEFAULT); global. MODEL_PREFERENCE_VALUE: last-used model per chatbot * (model_id); chatbot-scoped, system-managed. ANONYMIZE_DATA_PREFERENCE_SELECTION: * user's anonymize mode choice + global enabled toggle; global. * ANONYMIZE_DATA_PREFERENCE_VALUE: last-used anonymize enabled flag per chatbot; * chatbot-scoped, system-managed. GREETING_NAME_PREFERENCE: user's custom greeting * name shown on the welcome page; global. */ export type UserPreferenceType = 'MODEL_PREFERENCE_SELECTION' | 'MODEL_PREFERENCE_VALUE' | 'ANONYMIZE_DATA_PREFERENCE_SELECTION' | 'ANONYMIZE_DATA_PREFERENCE_VALUE' | 'PROJECT_PREFERENCE' | 'GREETING_NAME_PREFERENCE'; export interface PreferenceRetrieveParams { /** * Query param: Required for model-preference-value */ chatbot_id?: string | null; /** * Header param */ 'Accept-Language'?: string; /** * Header param: Set to `structured` to receive errors in the structured envelope. * Omit it to keep the legacy error body. */ 'X-Error-Format'?: string; } export interface PreferenceUpdateParams { /** * Body param */ value: { [key: string]: unknown; }; /** * Query param: Required for model-preference-value */ chatbot_id?: string | null; /** * Header param */ 'Accept-Language'?: string; /** * Header param: Set to `structured` to receive errors in the structured envelope. * Omit it to keep the legacy error body. */ 'X-Error-Format'?: string; } export declare namespace Preferences { export { type UserPreferenceResponse as UserPreferenceResponse, type UserPreferenceSlug as UserPreferenceSlug, type UserPreferenceType as UserPreferenceType, type PreferenceRetrieveParams as PreferenceRetrieveParams, type PreferenceUpdateParams as PreferenceUpdateParams, }; } //# sourceMappingURL=preferences.d.ts.map