@langchain/core
Version:
Core LangChain.js abstractions and schemas
1 lines • 2.98 kB
Source Map (JSON)
{"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 generationInfo?: Record<string, any>;\n}\nexport type GenerationChunkFields = {\n text: string;\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 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 llmOutput?: Record<string, any>;\n /**\n * Dictionary of run metadata\n */\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 llmOutput?: Record<string, any>;\n}\n//# sourceMappingURL=outputs.d.ts.map"],"mappings":";;;cACqBE,OAAAA;;AAArB;AAIA;AAWYG,UAXKF,UAAAA,CAWgB;EAOZG;;;EAIHA,IAAAA,EAAAA,MAAAA;EAAkBA;;AAJsB;AAS1D;EAIiBH,cAAAA,CAAAA,EAtBIC,MAsBJD,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;;AAQDC,KA5BJC,qBAAAA,GA4BID;EAAXF,IAAAA,EAAAA,MAAAA;EAAO,cAAA,CAAA,EA1BSE,MA0BT,CAAA,MAAA,EAAA,GAAA,CAAA;AAEZ,CAAA;AAGA;AAGA;;AAEwBK,cA/BHH,eAAAA,YAA2BH,UA+BxBM,CAAAA;EACNC,IAAAA,EAAAA,MAAAA;EAAsBA,cAAAA,CAAAA,EA9BnBN,MA8BmBM,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;EAHSJ,WAAAA,CAAAA,MAAAA,EA1BzBD,qBA0ByBC;EAA2BE,MAAAA,CAAAA,KAAAA,EAzB1DF,eAyB0DE,CAAAA,EAzBxCF,eAyBwCE;AAAc;AAK1F;;;KAzBYD,SAAAA;;;;eAIKJ;;;;cAIDC;;;;GAIXF,OAAAA,IAAWE;;UAECI,cAAAA,SAAuBL;WAC3BH;;KAEDS,yBAAAA,GAA4BJ;WAC3BJ;;cAEQS,mBAAAA,SAA4BJ,eAAAA,YAA2BE;WAC/DP;sBACWQ;gBACNC,sBAAsBA;;UAEvBC,UAAAA;eACAH;cACDJ"}