import { APIResource } from "../../core/resource.js"; import * as SavedItemsAPI from "./saved-items.js"; import * as FilesAPI from "./files/files.js"; import { APIPromise } from "../../core/api-promise.js"; import { RequestOptions } from "../../internal/request-options.js"; export declare class SavedItems extends APIResource { /** * The caller's own saved items whose source is the given conversation, so the chat * can show Save / Saved and unsave with `DELETE /library/files/{id}`. Requires * X-Tenant-ID header. */ retrieveLookup(params: SavedItemRetrieveLookupParams, options?: RequestOptions): APIPromise; /** * Save a file attached to the caller's conversation, an image or a table in an * answer, or a file cited as a source of an answer, as a Library file * (`source_type = saved`). The request only names the item (`conversation_id`, * `message_id` and the `attachment_id`, `media_key`, `table_index` or * `reference_id`); the server finds the content itself and never fetches a URL * sent by the client. A table is stored as a `.csv` file. A knowledge-base source * is read from LLM Labs while the caller can still use the conversation's chatbot, * and keeps its knowledge base's `information_classification`: a `confidential` or * `restricted` copy can't be shared. Saving is idempotent: saving the same item * again returns the first copy with `already_saved = true`. The Library's * extension, size and per-user file limits apply. Web, YouTube and SQL sources, * and knowledge-base, web or YouTube images, cannot be saved. Requires X-Tenant-ID * header. */ savedItems(params: SavedItemSavedItemsParams, options?: RequestOptions): APIPromise; } /** * What was saved from a conversation. */ export type LibrarySavedItemKind = 'attachment' | 'image' | 'table' | 'source'; /** * What the caller saved from one conversation, so the chat can show Save / Saved. */ export interface SavedItemRetrieveLookupResponse { /** * The caller's saved items. */ items?: Array; } export declare namespace SavedItemRetrieveLookupResponse { /** * One saved item of a conversation. */ interface Item { /** * The item's reference within the conversation. */ item_ref: string; /** * `attachment`, `image` or `table`. */ kind: SavedItemsAPI.LibrarySavedItemKind; /** * Library file ID; use it to unsave with `DELETE /library/files/{id}`. */ library_file_id: string; /** * The message the item was saved from, if any. */ message_id?: string | null; } } /** * The Library file an item was saved as. */ export interface SavedItemSavedItemsResponse { /** * True when the item was saved before; the first copy is returned and nothing new * is stored. */ already_saved: boolean; /** * The saved Library file. */ file: FilesAPI.LibraryFileItem; } export interface SavedItemRetrieveLookupParams { /** * Query param: The source conversation ID. */ conversation_id: string; /** * 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 SavedItemSavedItemsParams { /** * Body param: The caller's conversation. */ conversation_id: string; /** * Body param: `attachment`, `image`, `table` or `source`. */ kind: LibrarySavedItemKind; /** * Body param: Required for `attachment`: the attachment `id` from the message or * the conversation's `attachments`. */ attachment_id?: string | null; /** * Body param: Optional file name; used for `table` only. */ filename?: string | null; /** * Body param: Required for `image`: the key of the image in the message's * `media_mapping`. */ media_key?: string | null; /** * Body param: The message holding the item. Required for `image`, `table` and * `source`, optional for `attachment`. */ message_id?: string | null; /** * Body param: Required for `source`: the `id` of a source (reference) of the * answer message, as listed in its Sources panel. A source can be a knowledge-base * file or the caller's own upload. */ reference_id?: string | null; /** * Body param: Required for `table`: the 0-based position of the table in the * message. */ table_index?: number | 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 SavedItems { export { type LibrarySavedItemKind as LibrarySavedItemKind, type SavedItemRetrieveLookupResponse as SavedItemRetrieveLookupResponse, type SavedItemSavedItemsResponse as SavedItemSavedItemsResponse, type SavedItemRetrieveLookupParams as SavedItemRetrieveLookupParams, type SavedItemSavedItemsParams as SavedItemSavedItemsParams, }; } //# sourceMappingURL=saved-items.d.ts.map