UNPKG

@langchain/core

Version:
1 lines 2.89 kB
{"version":3,"file":"xml.d.cts","names":["BaseCumulativeTransformOutputParser","BaseCumulativeTransformOutputParserInput","Operation","ChatGeneration","Generation","XML_FORMAT_INSTRUCTIONS","XMLOutputParserFields","Content","Array","XMLResult","XMLOutputParser","Promise","parseXMLMarkdown"],"sources":["../../src/output_parsers/xml.d.ts"],"sourcesContent":["import { BaseCumulativeTransformOutputParser, BaseCumulativeTransformOutputParserInput } from \"./transform.js\";\nimport { Operation } from \"../utils/json_patch.js\";\nimport { ChatGeneration, Generation } from \"../outputs.js\";\nexport declare const XML_FORMAT_INSTRUCTIONS = \"The output should be formatted as a XML file.\\n1. Output should conform to the tags below. \\n2. If tags are not given, make them on your own.\\n3. Remember to always open and close all the tags.\\n\\nAs an example, for the tags [\\\"foo\\\", \\\"bar\\\", \\\"baz\\\"]:\\n1. String \\\"<foo>\\n <bar>\\n <baz></baz>\\n </bar>\\n</foo>\\\" is a well-formatted instance of the schema. \\n2. String \\\"<foo>\\n <bar>\\n </foo>\\\" is a badly-formatted instance.\\n3. String \\\"<foo>\\n <tag>\\n </tag>\\n</foo>\\\" is a badly-formatted instance.\\n\\nHere are the output tags:\\n```\\n{tags}\\n```\";\nexport interface XMLOutputParserFields extends BaseCumulativeTransformOutputParserInput {\n /**\n * Optional list of tags that the output should conform to.\n * Only used in formatting of the prompt.\n */\n tags?: string[];\n}\nexport type Content = string | undefined | Array<{\n [key: string]: Content;\n}>;\nexport type XMLResult = {\n [key: string]: Content;\n};\nexport declare class XMLOutputParser extends BaseCumulativeTransformOutputParser<XMLResult> {\n tags?: string[];\n constructor(fields?: XMLOutputParserFields);\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n protected _diff(prev: unknown | undefined, next: unknown): Operation[] | undefined;\n parsePartialResult(generations: ChatGeneration[] | Generation[]): Promise<XMLResult | undefined>;\n parse(text: string): Promise<XMLResult>;\n getFormatInstructions(): string;\n}\nexport declare function parseXMLMarkdown(s: string): XMLResult;\n//# sourceMappingURL=xml.d.ts.map"],"mappings":";;;;;cAGqBK,uBAAAA;UACJC,qBAAAA,SAA8BL;EAD1BI;AACrB;AAOA;AAGA;EAGqBK,IAAAA,CAAAA,EAAAA,MAAAA,EAAAA;;AAEIJ,KARbC,OAAAA,GAQaD,MAAAA,GAAAA,SAAAA,GARkBE,KAQlBF,CAAAA;EAIsCJ,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAX5CK,OAW4CL;CAC3BC,CAAAA;AAAmBC,KAV3CK,SAAAA,GAU2CL;EAAuBK,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAT3DF,OAS2DE;CAARE;AACrCF,cARZC,eAAAA,SAAwBV,mCAQZS,CARgDA,SAQhDA,CAAAA,CAAAA;EAARE,IAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EARoBX,WAAAA,CAAAA,MAAAA,CAAAA,EAEpBM,qBAFoBN;EAAmC,OAAA,OAAA,CAAA,CAAA,EAAA,MAAA;EAWxDY,YAAAA,EAAAA,MAAgB,EAAA;;6DALuBV;kCAC3BC,mBAAmBC,eAAeO,QAAQF;uBACrDE,QAAQF;;;iBAGTG,gBAAAA,aAA6BH"}