ludmi
Version:
LU (Layer Understanding) is a lightweight framework for controlled chatbot interactions with LLMs, action orchestration, and retrieval-augmented generation (RAG).
46 lines (45 loc) • 987 B
TypeScript
export type Role = "assistant" | "system" | "developer" | "user";
export type Message = {
role: Role;
content: string;
};
export type Messages = Message[];
export type DataOrq = {
topic: string;
input: string;
revised_prompt: string;
history: Messages;
userData: any;
eval?: any;
};
export type ResultOrq = {
price: {
unit: "USD";
value: number;
};
data: DataOrq;
};
export type ActionProps = {
input: string;
revised_prompt: string;
userData: any;
history?: Messages;
};
export interface ActionReturn {
price: number;
eval: any;
}
export type Action = ({ input, revised_prompt, userData, history }: ActionProps) => Promise<ActionReturn>;
export type Actions = {
[key: string]: Action;
};
export type ClassifiedTopic = {
topic: string;
revised_prompt: string;
};
export type Chunk = {
embedding: Array<number>;
score: number;
[key: string]: any;
};
export type Chunks = Chunk[];