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.
13 lines (12 loc) • 851 B
TypeScript
import { Message } from '../types.js';
/**
* Processes a user message with the given context strings and optional system message content.
* It retrieves the chat configuration, message history, adds context messages and system messages to the chat log,
* sends the user message to the AI, and updates the message history with the user message and AI response.
*
* @param {Message} userMessage - The user message to be processed.
* @param {string[]} contexts - Optional array of context strings to be included in the chat.
* @param {string} systemMessageContent - Optional system message content to be included in the chat.
* @returns {Promise<Message>} - A Promise that resolves to the AI-generated response message.
*/
export declare function chat(userMessage: Message, contexts?: string[], systemMessageContent?: string): Promise<Message>;