UNPKG

ludmi

Version:

LU (Layer Understanding) is a lightweight framework for controlled chatbot interactions with LLMs, action orchestration, and retrieval-augmented generation (RAG).

49 lines (48 loc) 1.46 kB
import { Messages } from "../../types/luTypes"; interface ToolFunction { type: "function"; function: { name: string; description?: string; parameters: { type: "object"; properties: { [key: string]: { type: string; description?: string; }; }; required?: string[]; }; }; } interface AIResponseProps { messages: Messages; model: string; temperature: number; tools?: ToolFunction[]; } export interface AIResponseReturn { content: string; price: number; calls?: any; } /** * Get the response from the AI. * * @param {AIResponseProps} props - The properties containing messages, model and temperature. * @param {Messages} props.messages - The messages to be sent to the AI. * @param {Model} props.model - The model to be used by the AI. * @param {number} props.temperature - The temperature to be used by the AI. * @param {string[]} props.tools - The tools to be used by the AI (optional). * @returns {} { price, content } */ export declare const getAIResponse: ({ messages, model, temperature, tools }: AIResponseProps) => Promise<AIResponseReturn>; /** * Get the embeddings of a text. * * @param text - The text to be embedded. * @returns The embeddings of the text. */ export declare const getEmbeddings: (text: string) => Promise<number[]>; export {};