import { UIMessageChunk } from 'ai'; import { SendUserMessageResponse, SingleMessageJsonResponse, SingleMessageResponseFormat } from './main'; export declare const baseUrl: any; export declare const baseApi: { get(endpoint: string, options?: IAIRequestOptions): Promise; post(endpoint: string, body?: any, options?: IAIRequestOptions): Promise; put(endpoint: string, body?: any, options?: IAIRequestOptions): Promise; delete(endpoint: string, options?: IAIRequestOptions): Promise; patch(endpoint: string, body?: any, options?: IAIRequestOptions): Promise; request(endpoint: string, options?: IAIRequestOptions): Promise; }; /** * Create a new thread * * @param {string} assistantId The id of the assistant to create the thread for * @param {any} params The parameters to pass to the assistant * @param {string|null} clientId The id of the client to create the thread for * @param {string|null} welcomeMessage Welcome message already presented to the user, if any * @param {RequestInit} options The options for the request * * @returns {any} The thread object */ export declare function createThread(assistantId: string, params?: any, clientId?: string, welcomeMessage?: string, options?: RequestInit): Promise; /** * End a thread * * @param {string} threadId The id of the thread to end * @param {string} reason The reason for ending the thread * @param {RequestInit} options The options for the request * * @returns {void} */ export declare function endThread(threadId: string, reason?: string, options?: RequestInit): Promise; /** * Send a message to a thread * * @param {string} threadId The id of the thread to send the message to * @param {string} content The content of the message to send * @param {RequestInit} options The options for the request * * @returns {SendUserMessageResponse} The messages and/or functions returned from the call */ export declare function sendUserMessage(threadId: string, content: string, options?: RequestInit): Promise; /** * Send a message to a thread with a streaming response * * @param {string} threadId The id of the thread to send the message to * @param {string} content The content of the message to send * @param {RequestInit} options The options for the request * * @returns {ReadableStream} The streaming response from the call */ export declare function sendUserMessageStreaming(threadId: string, content: string, options?: RequestInit): Promise>; /** * Make a call to the assistant with a single message * * @param {string} assistantId The id of the assistant to call * @param {Record} params The parameters to pass to the assistant * @param {string} content The content of the message to send * @param {string|null} clientId The id of the client to call the assistant for * @param {SingleMessageResponseFormat} format The format to return the response in. Either 'text' or 'json' * @param {RequestInit} options The options for the request * * @returns {string | SingleMessageJsonResponse} The response from the assistant in the specified format */ export declare function single(assistantId: string, params: Record, content: string, clientId?: string, format?: SingleMessageResponseFormat, options?: RequestInit): Promise; /** * Rate a message * * @param {string} threadId The id of the thread the message belongs to * @param {string} messageId The id of the message to rate * @param {number} rating The rating to give the message. -1 for downvote, 1 for upvote, 0 for no vote * @param {string} reason The reason for the rating * @param {RequestInit} options The options for the request */ export declare function rateMessage(threadId: string, messageId: string, rating: number, reason?: string, options?: RequestInit): Promise; /** * Respond to a function call * * @param {string} threadId The id of the thread to respond to * @param {string} functionCallId The id of the function call to respond to * @param {Record} params The parameters to pass to the function * @param {boolean} rerunLLM Whether or not to rerun the LLM * @param {RequestInit} options The options for the request * * @returns {SendUserMessageResponse} The messages and/or functions returned from the call */ export declare function respondToFunctionCall(threadId: string, functionCallId: string, params: Record, rerunLLM?: boolean, options?: RequestInit): Promise; /** * Respond to multiple function calls at once * * @param {string} threadId The id of the thread to respond to * @param {Array<{functionCallId: string, params: Record}>} functionCalls The function calls to respond to * @param {boolean} rerunLLM Whether or not to rerun the LLM * @param {RequestInit} options The options for the request * * @returns {SendUserMessageResponse} The messages and/or functions returned from the call */ export declare function respondToFunctionCalls(threadId: string, functionCalls: Array<{ functionCallId: string; params: Record; }>, rerunLLM?: boolean, options?: RequestInit): Promise; /** * Respond to a function call with a streaming response * * @param {string} threadId The id of the thread to respond to * @param {string} functionCallId The id of the function call to respond to * @param {Record} params The parameters to pass to the function * @param {boolean} rerunLLM Whether or not to rerun the LLM * @param {RequestInit} options The options for the request * * @returns {ReadableStream} The streaming response from the call */ export declare function respondToFunctionCallStreaming(threadId: string, functionCallId: string, params: Record, rerunLLM?: boolean, options?: RequestInit): Promise>; /** * Respond to multiple function calls at once with a streaming response * * @param {string} threadId The id of the thread to respond to * @param {Array<{functionCallId: string, params: Record}>} functionCalls The function calls to respond to * @param {boolean} rerunLLM Whether or not to rerun the LLM * @param {RequestInit} options The options for the request * * @returns {ReadableStream} The streaming response from the call */ export declare function respondToFunctionCallsStreaming(threadId: string, functionCalls: Array<{ functionCallId: string; params: Record; }>, rerunLLM?: boolean, options?: RequestInit): Promise>; /** * Ping a thread to keep it alive and prevent it from being ended due to inactivity * * @param {string} threadId The id of the thread to ping * @param {RequestInit} options The options for the request */ export declare function pingThread(threadId: string, options?: RequestInit): Promise; /** * Custom error class for API errors */ export declare class APIError extends Error { status: number; details?: any; /** * Create a new API error * * @param {string} message The error message * @param {number} status The status code of the error * @param {any} details Any additional details about the error */ constructor(message: string, status: number, details?: any); } type IAIRequestOptions = RequestInit & { returnFullResponse?: boolean; }; export {};