@langchain/core
Version:
Core LangChain.js abstractions and schemas
1 lines • 4.06 kB
Source Map (JSON)
{"version":3,"file":"list.d.cts","names":["BaseMessage","BaseTransformOutputParser","ListOutputParser","RegExp","AsyncGenerator","CommaSeparatedListOutputParser","Promise","CustomListOutputParser","length","separator","NumberedListOutputParser","MarkdownListOutputParser"],"sources":["../../src/output_parsers/list.d.ts"],"sourcesContent":["import { BaseMessage } from \"../messages/index.js\";\nimport { BaseTransformOutputParser } from \"./transform.js\";\n/**\n * Class to parse the output of an LLM call to a list.\n * @augments BaseOutputParser\n */\nexport declare abstract class ListOutputParser extends BaseTransformOutputParser<string[]> {\n re?: RegExp;\n _transform(inputGenerator: AsyncGenerator<string | BaseMessage>): AsyncGenerator<string[]>;\n}\n/**\n * Class to parse the output of an LLM call as a comma-separated list.\n * @augments ListOutputParser\n */\nexport declare class CommaSeparatedListOutputParser extends ListOutputParser {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n /**\n * Parses the given text into an array of strings, using a comma as the\n * separator. If the parsing fails, throws an OutputParserException.\n * @param text The text to parse.\n * @returns An array of strings obtained by splitting the input text at each comma.\n */\n parse(text: string): Promise<string[]>;\n /**\n * Provides instructions on the expected format of the response for the\n * CommaSeparatedListOutputParser.\n * @returns A string containing instructions on the expected format of the response.\n */\n getFormatInstructions(): string;\n}\n/**\n * Class to parse the output of an LLM call to a list with a specific length and separator.\n * @augments ListOutputParser\n */\nexport declare class CustomListOutputParser extends ListOutputParser {\n lc_namespace: string[];\n private length;\n private separator;\n constructor({ length, separator }: {\n length?: number;\n separator?: string;\n });\n /**\n * Parses the given text into an array of strings, using the specified\n * separator. If the parsing fails or the number of items in the list\n * doesn't match the expected length, throws an OutputParserException.\n * @param text The text to parse.\n * @returns An array of strings obtained by splitting the input text at each occurrence of the specified separator.\n */\n parse(text: string): Promise<string[]>;\n /**\n * Provides instructions on the expected format of the response for the\n * CustomListOutputParser, including the number of items and the\n * separator.\n * @returns A string containing instructions on the expected format of the response.\n */\n getFormatInstructions(): string;\n}\nexport declare class NumberedListOutputParser extends ListOutputParser {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n getFormatInstructions(): string;\n re: RegExp;\n parse(text: string): Promise<string[]>;\n}\nexport declare class MarkdownListOutputParser extends ListOutputParser {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n getFormatInstructions(): string;\n re: RegExp;\n parse(text: string): Promise<string[]>;\n}\n//# sourceMappingURL=list.d.ts.map"],"mappings":";;;;;;;AAMA;;AAEuDA,uBAFzBE,gBAAAA,SAAyBD,yBAEAD,CAAAA,MAAAA,EAAAA,CAAAA,CAAAA;EAAxBI,EAAAA,CAAAA,EADtBD,MACsBC;EAAuCA,UAAAA,CAAAA,cAAAA,EAAvCA,cAAuCA,CAAAA,MAAAA,GAAfJ,WAAeI,CAAAA,CAAAA,EAAAA,cAAAA,CAAAA,MAAAA,EAAAA,CAAAA;;AAFU;AAQhF;AAsBA;;AAI0BK,cA1BLJ,8BAAAA,SAAuCH,gBAAgB,CA0BlDO;EAWDH,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAf2BJ,YAAAA,EAAAA,MAAAA,EAAAA;EAAgB,eAAA,EAAA,OAAA;EAwB/CQ;;;;AAAiD;AAQtE;EAKQP,KAAAA,CAAAA,IAAAA,EAAAA,MAAAA,CAAAA,EAjDiBG,OAiDjBH,CAAAA,MAAAA,EAAAA,CAAAA;EACiBG;;AAN6C;;;;;;;;;cAhCjDC,sBAAAA,SAA+BL,gBAAAA;;;;;;;;;;;;;;;;;;uBAe3BI;;;;;;;;;cASJI,wBAAAA,SAAiCR,gBAAAA;;;;;MAK9CC;uBACiBG;;cAEJK,wBAAAA,SAAiCT,gBAAAA;;;;;MAK9CC;uBACiBG"}