UNPKG

@langchain/core

Version:
1 lines 3.44 kB
{"version":3,"file":"outputs.d.ts","names":["BaseMessage","BaseMessageChunk","RUN_KEY","Generation","Record","GenerationChunkFields","GenerationChunk","LLMResult","ChatGeneration","ChatGenerationChunkFields","ChatGenerationChunk","ChatResult"],"sources":["../src/outputs.d.ts"],"sourcesContent":["import { type BaseMessage, type BaseMessageChunk } from \"./messages/base.js\";\nexport declare const RUN_KEY = \"__run\";\n/**\n * Output of a single generation.\n */\nexport interface Generation {\n /**\n * Generated text output\n */\n text: string;\n /**\n * Raw generation info response from the provider.\n * May include things like reason for finishing (e.g. in {@link OpenAI})\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n generationInfo?: Record<string, any>;\n}\nexport type GenerationChunkFields = {\n text: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n generationInfo?: Record<string, any>;\n};\n/**\n * Chunk of a single generation. Used for streaming.\n */\nexport declare class GenerationChunk implements Generation {\n text: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n generationInfo?: Record<string, any>;\n constructor(fields: GenerationChunkFields);\n concat(chunk: GenerationChunk): GenerationChunk;\n}\n/**\n * Contains all relevant information returned by an LLM.\n */\nexport type LLMResult = {\n /**\n * List of the things generated. Each input could have multiple {@link Generation | generations}, hence this is a list of lists.\n */\n generations: Generation[][];\n /**\n * Dictionary of arbitrary LLM-provider specific output.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n llmOutput?: Record<string, any>;\n /**\n * Dictionary of run metadata\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [RUN_KEY]?: Record<string, any>;\n};\nexport interface ChatGeneration extends Generation {\n message: BaseMessage;\n}\nexport type ChatGenerationChunkFields = GenerationChunkFields & {\n message: BaseMessageChunk;\n};\nexport declare class ChatGenerationChunk extends GenerationChunk implements ChatGeneration {\n message: BaseMessageChunk;\n constructor(fields: ChatGenerationChunkFields);\n concat(chunk: ChatGenerationChunk): ChatGenerationChunk;\n}\nexport interface ChatResult {\n generations: ChatGeneration[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n llmOutput?: Record<string, any>;\n}\n"],"mappings":";;;cACqBE,OAAAA;;AAArB;AAIA;AAYYG,UAZKF,UAAAA,CAYgB;EAQZG;;;EAGM,IACHD,EAAAA,MAAAA;EAAqB;;;AAJa;EAU9CE;EAAS,cAAA,CAAA,EApBAH,MAoBA,CAAA,MAAA,EAAA,GAAA,CAAA;;AASLA,KA3BJC,qBAAAA,GA2BID;EAAM,IAKNA,EAAAA,MAAAA;EAAM;EAAV,cAAA,CAAA,EA7BSA,MA6BT,CAAA,MAAA,EAAA,GAAA,CAAA;AAEZ,CAAA;;;;AAAkD,cA1B7BE,eAAAA,YAA2BH,UA0BE,CAAA;EAGtCM,IAAAA,EAAAA,MAAAA;EAAyB;EAAA,cAAGJ,CAAAA,EA1BnBD,MA0BmBC,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;EAAqB,WAChDJ,CAAAA,MAAAA,EA1BWI,qBA0BXJ;EAAgB,MAAA,CAAA,KAAA,EAzBXK,eAyBW,CAAA,EAzBOA,eAyBP;AAE7B;;;;AAGkBI,KAzBNH,SAAAA,GAyBMG;EAAmB;;;EAHqD,WAAA,EAlBzEP,UAkByE,EAAA,EAAA;EAKzEQ;;;EACc;EAET,SAAA,CAAA,EArBNP,MAqBM,CAAA,MAAA,EAAA,GAAA,CAAA;;;;;GAhBjBF,OAAAA,IAAWE;;UAECI,cAAAA,SAAuBL;WAC3BH;;KAEDS,yBAAAA,GAA4BJ;WAC3BJ;;cAEQS,mBAAAA,SAA4BJ,eAAAA,YAA2BE;WAC/DP;sBACWQ;gBACNC,sBAAsBA;;UAEvBC,UAAAA;eACAH;;cAEDJ"}