import { APIResource } from "../../../../core/resource.mjs"; import * as KnowledgeBasesAPI from "./knowledge-bases.mjs"; import { AgentDocumentsCursor } from "./knowledge-bases.mjs"; import { APIPromise } from "../../../../core/api-promise.mjs"; import { type CursorParams, PagePromise } from "../../../../core/pagination.mjs"; import { RequestOptions } from "../../../../internal/request-options.mjs"; export declare class Documents extends APIResource { /** * Add a document to a knowledge base. The document will be automatically processed * for RAG. * * @example * ```ts * const document = * await client.senders.agent.knowledgeBases.documents.create( * 'kbId', * { * senderId: 'senderId', * content: * 'Our return policy allows returns within 30 days of purchase...', * title: 'Return Policy', * }, * ); * ``` */ create(kbID: string, params: DocumentCreateParams, options?: RequestOptions): APIPromise; /** * List documents in a knowledge base. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const agentDocument of client.senders.agent.knowledgeBases.documents.list( * 'kbId', * { senderId: 'senderId' }, * )) { * // ... * } * ``` */ list(kbID: string, params: DocumentListParams, options?: RequestOptions): PagePromise; /** * Delete a document from a knowledge base. * * @example * ```ts * await client.senders.agent.knowledgeBases.documents.delete( * 'docId', * { senderId: 'senderId', kbId: 'kbId' }, * ); * ``` */ delete(docID: string, params: DocumentDeleteParams, options?: RequestOptions): APIPromise; /** * Get a single document from a knowledge base. * * @example * ```ts * const response = * await client.senders.agent.knowledgeBases.documents.retrieveDocument( * 'docId', * { senderId: 'senderId', kbId: 'kbId' }, * ); * ``` */ retrieveDocument(docID: string, params: DocumentRetrieveDocumentParams, options?: RequestOptions): APIPromise; /** * Update a document's title or content. Updating content reprocesses the document * for RAG. * * @example * ```ts * const response = * await client.senders.agent.knowledgeBases.documents.updateDocument( * 'docId', * { senderId: 'senderId', kbId: 'kbId' }, * ); * ``` */ updateDocument(docID: string, params: DocumentUpdateDocumentParams, options?: RequestOptions): APIPromise; } export interface DocumentCreateResponse { document: KnowledgeBasesAPI.AgentDocument; } export interface DocumentRetrieveDocumentResponse { document: KnowledgeBasesAPI.AgentDocument; } export interface DocumentUpdateDocumentResponse { document: KnowledgeBasesAPI.AgentDocument; } export interface DocumentCreateParams { /** * Path param */ senderId: string; /** * Body param */ content: string; /** * Body param */ title: string; } export interface DocumentListParams extends CursorParams { /** * Path param */ senderId: string; } export interface DocumentDeleteParams { senderId: string; kbId: string; } export interface DocumentRetrieveDocumentParams { senderId: string; kbId: string; } export interface DocumentUpdateDocumentParams { /** * Path param */ senderId: string; /** * Path param */ kbId: string; /** * Body param */ content?: string; /** * Body param */ title?: string; } export declare namespace Documents { export { type DocumentCreateResponse as DocumentCreateResponse, type DocumentRetrieveDocumentResponse as DocumentRetrieveDocumentResponse, type DocumentUpdateDocumentResponse as DocumentUpdateDocumentResponse, type DocumentCreateParams as DocumentCreateParams, type DocumentListParams as DocumentListParams, type DocumentDeleteParams as DocumentDeleteParams, type DocumentRetrieveDocumentParams as DocumentRetrieveDocumentParams, type DocumentUpdateDocumentParams as DocumentUpdateDocumentParams, }; } export { type AgentDocumentsCursor }; //# sourceMappingURL=documents.d.mts.map