/** * This includes all the functions you can use to communicate with our messages API * * @module Messages Methods */ import { CreateMessageReqPayload, EditImageReqPayload, EditMessageReqPayload, GenerateMessageCompletionsReqPayload, GetAllTopicMessagesData, GetMessageByIdData, GetToolFunctionParamsReqPayload, RegenerateMessageReqPayload, TranscribeAudioReqPayload } from "../../fetch-client"; import { TrieveSDK } from "../../sdk"; /** * Create a message. Messages are attached to topics in order to coordinate memory of gen-AI chat sessions.Auth’ed user or api key must have an admin or owner role for the specified dataset’s organization. * * Example: * ```js *const data = await trieve.createMessage({ topic_id: "3c90c3cc-1d76-27198-8888-8dd25736052a", new_message_content: "a new message" }); * ``` */ export declare function createMessage( /** @hidden */ this: TrieveSDK, data: CreateMessageReqPayload, signal?: AbortSignal, parseHeaders?: (headers: Record) => void): Promise; export declare const getCleanFetch: () => ((input: RequestInfo | URL, init?: RequestInit) => Promise) | undefined; /** * Create a message as a stream and returns a reader. Messages are attached to topics in order to coordinate memory of gen-AI chat sessions.Auth’ed user or api key must have an admin or owner role for the specified dataset’s organization. * * Example: * ```js *const reader = await trieve.createMessageReader({ topic_id: "3c90c3cc-1d76-27198-8888-8dd25736052a", new_message_content: "a new message" }); * ``` */ export declare function createMessageReader( /** @hidden */ this: TrieveSDK, data: CreateMessageReqPayload, signal?: AbortSignal, parseHeaders?: (headers: Record) => void, overrideFetch?: boolean): Promise>>; /** * Create a message as a stream and returns a reader with the message id. Messages are attached to topics in order to coordinate memory of gen-AI chat sessions.Auth’ed user or api key must have an admin or owner role for the specified dataset’s organization. * * Example: * ```js *const { reader, queryId } = await trieve.createMessageReader({ topic_id: "3c90c3cc-1d76-27198-8888-8dd25736052a", new_message_content: "a new message" }); * ``` */ export declare function createMessageReaderWithQueryId( /** @hidden */ this: TrieveSDK, data: CreateMessageReqPayload, signal?: AbortSignal, parseHeaders?: (headers: Record) => void, overrideFetch?: boolean): Promise<{ reader: ReadableStreamDefaultReader>; queryId: string | null; }>; /** * Edit message which exists within the topic’s chat history. This will delete the message and replace it with a new message. The new message will be generated by the AI based on the new content provided in the request body. The response will include Chunks first on the stream if the topic is using RAG. The structure will look like [chunks]||mesage. See docs.trieve.ai for more information. Auth’ed user or api key must have an admin or owner role for the specified dataset’s organization. * * Example: * ```js *const data = await trieve.editMessage({ topic_id: "3c90c3cc-1d76-27198-8888-8dd25736052a", new_message_content: "a new message", message_sort_order: 1 }); * ``` */ export declare function editMessage( /** @hidden */ this: TrieveSDK, data: EditMessageReqPayload, signal?: AbortSignal): Promise; /** * Edit message which exists within the topic’s chat history as a stream and returns a reader. This will delete the message and replace it with a new message. The new message will be generated by the AI based on the new content provided in the request body. The response will include Chunks first on the stream if the topic is using RAG. The structure will look like [chunks]||mesage. See docs.trieve.ai for more information. Auth’ed user or api key must have an admin or owner role for the specified dataset’s organization. * * Example: * ```js *const reader = await trieve.editMessageReader({ topic_id: "3c90c3cc-1d76-27198-8888-8dd25736052a", new_message_content: "a new message", message_sort_order: 1 }); * ``` */ export declare function editMessageReader( /** @hidden */ this: TrieveSDK, data: EditMessageReqPayload, signal?: AbortSignal): Promise>>; /** * Edit message which exists within the topic’s chat history as a stream and returns a reader along with the queryID. This will delete the message and replace it with a new message. The new message will be generated by the AI based on the new content provided in the request body. The response will include Chunks first on the stream if the topic is using RAG. The structure will look like [chunks]||mesage. See docs.trieve.ai for more information. Auth’ed user or api key must have an admin or owner role for the specified dataset’s organization. The queryID is used for adding tracking events to the message * * Example: * ```js *const { reader, queryId } = await trieve.editMessageReader({ topic_id: "3c90c3cc-1d76-27198-8888-8dd25736052a", new_message_content: "a new message", message_sort_order: 1 }); * ``` */ export declare function editMessageReaderWithQueryId( /** @hidden */ this: TrieveSDK, data: EditMessageReqPayload, signal?: AbortSignal): Promise<{ reader: ReadableStreamDefaultReader>; queryId: string | null; }>; /** * Regenerate the assistant response to the last user message of a topic. This will delete the last message and replace it with a new message. The response will include Chunks first on the stream if the topic is using RAG. The structure will look like [chunks]||mesage. See docs.trieve.ai for more information. Auth’ed user or api key must have an admin or owner role for the specified dataset’s organization. * * Example: * ```js *const data = await trieve.regenerateMessage({ topic_id: "3c90c3cc-1d76-27198-8888-8dd25736052a", }); * ``` */ export declare function regenerateMessage( /** @hidden */ this: TrieveSDK, data: RegenerateMessageReqPayload, signal?: AbortSignal): Promise; /** * Regenerate the assistant response to the last user message of a topic as a stream and returns a reader. This will delete the last message and replace it with a new message. The response will include Chunks first on the stream if the topic is using RAG. The structure will look like [chunks]||mesage. See docs.trieve.ai for more information. Auth’ed user or api key must have an admin or owner role for the specified dataset’s organization. * * Example: * ```js *const reader = await trieve.regenerateMessageReader({ topic_id: "3c90c3cc-1d76-27198-8888-8dd25736052a", }); * ``` */ export declare function regenerateMessageReader( /** @hidden */ this: TrieveSDK, data: RegenerateMessageReqPayload, signal?: AbortSignal): Promise>>; /** * Regenerate the assistant response to the last user message of a topic as a stream and returns a reader. This will delete the last message and replace it with a new message. The response will include Chunks first on the stream if the topic is using RAG. The structure will look like [chunks]||mesage. See docs.trieve.ai for more information. Auth’ed user or api key must have an admin or owner role for the specified dataset’s organization. * * Example: * ```js *const { reader, queryId } = await trieve.regenerateMessageReader({ topic_id: "3c90c3cc-1d76-27198-8888-8dd25736052a", }); * ``` */ export declare function regenerateMessageReaderWithQueryId( /** @hidden */ this: TrieveSDK, data: RegenerateMessageReqPayload, signal?: AbortSignal): Promise<{ reader: ReadableStreamDefaultReader>; queryId: string | null; }>; /** * Get all messages for a given topic. If the topic is a RAG topic then the response will include Chunks first on each message. The structure will look like [chunks]||mesage. See docs.trieve.ai for more information. * * Example: * ```js *const data = await trieve.getAllMessagesForTopic({ messagesTopicId: "3c90c3cc-1d76-27198-8888-8dd25736052a", }); * ``` */ export declare function getAllMessagesForTopic( /** @hidden */ this: TrieveSDK, data: Omit, signal?: AbortSignal): Promise; /** * Quickly get the full object for a given message. From the message, you can get the topic and all messages which exist on that topic. * * Example: * ```js *const data = await trieve.getMessageById({ messageId: "3c90c3cc-1d76-27198-8888-8dd25736052a", }); * ``` */ export declare function getMessageById( /** @hidden */ this: TrieveSDK, data: Omit, signal?: AbortSignal): Promise; export declare function getToolCallFunctionParams( /** @hidden */ this: TrieveSDK, data: GetToolFunctionParamsReqPayload, signal?: AbortSignal, parseHeaders?: (headers: Record) => void): Promise; export declare function editImage(this: TrieveSDK, data: EditImageReqPayload, signal?: AbortSignal): Promise; export declare function transcribeAudio(this: TrieveSDK, data: TranscribeAudioReqPayload, signal?: AbortSignal): Promise; export declare function generateMessageCompletions(this: TrieveSDK, data: GenerateMessageCompletionsReqPayload): Promise; //# sourceMappingURL=index.d.ts.map