ludmi
Version:
LU (Layer Understanding) is a lightweight framework for controlled chatbot interactions with LLMs, action orchestration, and retrieval-augmented generation (RAG).
29 lines (28 loc) • 1.07 kB
TypeScript
import { Message, Messages } from "../../types/luTypes";
interface MessageToHistoryProps {
history: Messages;
message: Message;
}
interface ContextHistory {
history: Messages;
size: number;
}
/**
* Adds a message to the history array.
*
* @param {MessageToHistoryProps} props - The properties containing history and message.
* @param {History} props.history - The array where the message will be added.
* @param {Message} props.message - The message to be added to history.
* @returns {void}
*/
export declare const addMessageToHistory: ({ history, message }: MessageToHistoryProps) => void;
/**
* Returns the last n messages from the history.
*
* @param {ContextHistory} props - The properties containing history and size.
* @param {Messages} props.history - The array where the messages are stored.
* @param {number} props.size - The number of messages to be returned.
* @returns {Messages} - The last n messages from the history.
*/
export declare const getContextHistory: ({ history, size }: ContextHistory) => Messages;
export {};