conversation-engine
Version:
A powerful wrapper around the OpenAI API, providing additional features and making it easier to interact with AI models. Seamlessly chat with your AI assistant, include context strings, and manage conversation history.
12 lines (11 loc) • 864 B
TypeScript
import { Message, ModelName } from '../types.js';
/**
* Updates the message history with new messages and returns the combined chat history.
* The chat history consists of a summary of older messages and the recent messages within the cutoff.
*
* @param {Message[]|undefined} newMessages - The new messages to add to the history.
* @param {number} cutoff - Optional. The number of recent messages to include without summarization. Default is 6.
* @param {ModelName} historySummarizationModel - Optional. The AI model to use for history summarization. Default is ModelName.GPT_3_5_TURBO.
* @returns {Promise<Message[]>} - A Promise that resolves to the combined history (summary and recent messages).
*/
export declare function updateAndGetMessageHistory(newMessages?: Message[], cutoff?: number, historySummarizationModel?: ModelName): Promise<Message[]>;