import { BaseCache, BasePromptValue, LLMResult } from "../schema/index.js"; import { BaseLanguageModel, BaseLanguageModelCallOptions, BaseLanguageModelParams } from "../base_language/index.js"; import { CallbackManagerForLLMRun, Callbacks } from "../callbacks/manager.js"; export type SerializedLLM = { _model: string; _type: string; } & Record; export interface BaseLLMParams extends BaseLanguageModelParams { /** * @deprecated Use `maxConcurrency` instead */ concurrency?: number; cache?: BaseCache | boolean; } export interface BaseLLMCallOptions extends BaseLanguageModelCallOptions { } /** * LLM Wrapper. Provides an {@link call} (an {@link generate}) function that takes in a prompt (or prompts) and returns a string. */ export declare abstract class BaseLLM extends BaseLanguageModel { CallOptions: BaseLanguageModelCallOptions; cache?: BaseCache; constructor({ cache, concurrency, ...rest }: BaseLLMParams); generatePrompt(promptValues: BasePromptValue[], stop?: string[] | this["CallOptions"], callbacks?: Callbacks): Promise; /** * Run the LLM on the given prompts and input. */ abstract _generate(prompts: string[], stop?: string[] | this["CallOptions"], runManager?: CallbackManagerForLLMRun): Promise; /** @ignore */ _generateUncached(prompts: string[], stop?: string[] | this["CallOptions"], callbacks?: Callbacks): Promise; /** * Run the LLM on the given propmts an input, handling caching. */ generate(prompts: string[], stop?: string[] | this["CallOptions"], callbacks?: Callbacks): Promise; /** * Convenience wrapper for {@link generate} that takes in a single string prompt and returns a single string output. */ call(prompt: string, stop?: string[] | this["CallOptions"], callbacks?: Callbacks): Promise; /** * Get the identifying parameters of the LLM. */ _identifyingParams(): Record; /** * Return the string type key uniquely identifying this class of LLM. */ abstract _llmType(): string; /** * Return a json-like object representing this LLM. */ serialize(): SerializedLLM; _modelType(): string; /** * Load an LLM from a json-like object describing it. */ static deserialize(data: SerializedLLM): Promise; } /** * LLM class that provides a simpler interface to subclass than {@link BaseLLM}. * * Requires only implementing a simpler {@link _call} method instead of {@link _generate}. * * @augments BaseLLM */ export declare abstract class LLM extends BaseLLM { /** * Run the LLM on the given prompt and input. */ abstract _call(prompt: string, stop?: string[] | this["CallOptions"], runManager?: CallbackManagerForLLMRun): Promise; _generate(prompts: string[], stop?: string[] | this["CallOptions"], runManager?: CallbackManagerForLLMRun): Promise; }