UNPKG

@langchain/core

Version:
40 lines (38 loc) 2.24 kB
import { InputValues } from "../utils/types/index.js"; import { RunnableConfig } from "../runnables/types.js"; import { Runnable, RunnableLike } from "../runnables/base.js"; import { ChatPromptValueInterface } from "../prompt_values.js"; import { BaseMessagePromptTemplateLike, ChatPromptTemplate, ChatPromptTemplateInput } from "./chat.js"; //#region src/prompts/structured.d.ts /** * Interface for the input of a ChatPromptTemplate. */ interface StructuredPromptInput< // eslint-disable-next-line @typescript-eslint/no-explicit-any RunInput extends InputValues = any, // eslint-disable-next-line @typescript-eslint/no-explicit-any PartialVariableName extends string = any> extends ChatPromptTemplateInput<RunInput, PartialVariableName> { // eslint-disable-next-line @typescript-eslint/no-explicit-any schema: Record<string, any>; method?: "jsonMode" | "jsonSchema" | "functionMode"; } declare class StructuredPrompt< // eslint-disable-next-line @typescript-eslint/no-explicit-any RunInput extends InputValues = any, // eslint-disable-next-line @typescript-eslint/no-explicit-any PartialVariableName extends string = any> extends ChatPromptTemplate<RunInput, PartialVariableName> implements StructuredPromptInput<RunInput, PartialVariableName> { // eslint-disable-next-line @typescript-eslint/no-explicit-any schema: Record<string, any>; method?: "jsonMode" | "jsonSchema" | "functionMode"; lc_namespace: string[]; get lc_aliases(): Record<string, string>; constructor(input: StructuredPromptInput<RunInput, PartialVariableName>); pipe<NewRunOutput>(coerceable: RunnableLike<ChatPromptValueInterface, NewRunOutput>): Runnable<RunInput, Exclude<NewRunOutput, Error>, RunnableConfig>; // eslint-disable-next-line @typescript-eslint/no-explicit-any static fromMessagesAndSchema<RunInput extends InputValues = any>(promptMessages: (ChatPromptTemplate<InputValues, string> | BaseMessagePromptTemplateLike)[], schema: StructuredPromptInput["schema"], method?: "jsonMode" | "jsonSchema" | "functionMode" // eslint-disable-next-line @typescript-eslint/no-explicit-any ): ChatPromptTemplate<RunInput, any>; } //#endregion export { StructuredPrompt, StructuredPromptInput }; //# sourceMappingURL=structured.d.ts.map