import { BaseMessage } from "../messages/base.js"; import { SerializableSchema } from "../utils/standard_schema.js"; import { InteropZodType } from "../utils/types/zod.js"; import { Runnable } from "../runnables/base.js"; import { BaseLanguageModelInput } from "./base.js"; import { BaseLLMOutputParser, BaseOutputParser } from "../output_parsers/base.js"; //#region src/language_models/structured_output.d.ts /** * Creates the appropriate content-based output parser for a schema. Use this for * jsonMode/jsonSchema methods where the LLM returns JSON text. * * - Zod schema -> StructuredOutputParser (Zod validation) * - Standard schema -> StandardSchemaOutputParser (standard schema validation) * - Plain JSON schema -> JsonOutputParser (no validation) */ declare function createContentParser = Record>(schema: InteropZodType | SerializableSchema | Record): BaseOutputParser; type FunctionCallingParserConstructor = Record> = new (params: { keyName: string; returnSingle?: boolean; zodSchema?: InteropZodType; serializableSchema?: SerializableSchema; }) => BaseLLMOutputParser; /** * Creates the appropriate tool-calling output parser for a schema. Use this for * function calling / tool use methods where the LLM returns structured tool calls. * * - Zod schema -> parser with Zod validation * - Standard schema -> parser with standard schema validation * - Plain JSON schema -> parser with no validation */ declare function createFunctionCallingParser = Record>(schema: InteropZodType | SerializableSchema | Record, keyName: string, ParserClass?: FunctionCallingParserConstructor): BaseLLMOutputParser; /** * Pipes an LLM through an output parser, optionally wrapping the result * to include the raw LLM response alongside the parsed output. * * When `includeRaw` is true, returns `{ raw: BaseMessage, parsed: RunOutput }`. * If parsing fails, `parsed` falls back to null. */ declare function assembleStructuredOutputPipeline = Record>(llm: Runnable, outputParser: Runnable, includeRaw?: boolean, runName?: string): Runnable | Runnable; //#endregion export { assembleStructuredOutputPipeline, createContentParser, createFunctionCallingParser }; //# sourceMappingURL=structured_output.d.ts.map