import { Document } from "../document.js"; export declare const RUN_KEY = "__run"; export type Example = Record; export type InputValues = Record; export type PartialValues = Record Promise) | (() => string)>; /** * Output of a single generation. */ export interface Generation { /** * Generated text output */ text: string; /** * Raw generation info response from the provider. * May include things like reason for finishing (e.g. in {@link OpenAI}) */ generationInfo?: Record; } /** * Contains all relevant information returned by an LLM. */ export type LLMResult = { /** * List of the things generated. Each input could have multiple {@link Generation | generations}, hence this is a list of lists. */ generations: Generation[][]; /** * Dictionary of arbitrary LLM-provider specific output. */ llmOutput?: Record; /** * Dictionary of run metadata */ [RUN_KEY]?: Record; }; export type MessageType = "human" | "ai" | "generic" | "system"; export declare abstract class BaseChatMessage { /** The text of the message. */ text: string; /** The name of the message sender in a multi-user chat. */ name?: string; /** The type of the message. */ abstract _getType(): MessageType; constructor(text: string); } export declare class HumanChatMessage extends BaseChatMessage { _getType(): MessageType; } export declare class AIChatMessage extends BaseChatMessage { _getType(): MessageType; } export declare class SystemChatMessage extends BaseChatMessage { _getType(): MessageType; } export declare class ChatMessage extends BaseChatMessage { role: string; constructor(text: string, role: string); _getType(): MessageType; } export interface ChatGeneration extends Generation { message: BaseChatMessage; } export interface ChatResult { generations: ChatGeneration[]; llmOutput?: Record; } /** * Base PromptValue class. All prompt values should extend this class. */ export declare abstract class BasePromptValue { abstract toString(): string; abstract toChatMessages(): BaseChatMessage[]; } export type AgentAction = { tool: string; toolInput: string; log: string; }; export type AgentFinish = { returnValues: Record; log: string; }; export type AgentStep = { action: AgentAction; observation: string; }; export type ChainValues = Record; /** * Base Index class. All indexes should extend this class. */ export declare abstract class BaseRetriever { abstract getRelevantDocuments(query: string): Promise; } export declare abstract class BaseChatMessageHistory { abstract getMessages(): Promise; abstract addUserMessage(message: string): Promise; abstract addAIChatMessage(message: string): Promise; abstract clear(): Promise; } export declare abstract class BaseCache { abstract lookup(prompt: string, llmKey: string): Promise; abstract update(prompt: string, llmKey: string, value: T): Promise; } export declare abstract class BaseFileStore { abstract readFile(path: string): Promise; abstract writeFile(path: string, contents: string): Promise; }