UNPKG

@langchain/openai

Version:
1 lines 991 B
{"version":3,"file":"errors.cjs","names":["error: any","lc_error_code: LangChainErrorCodes"],"sources":["../../src/utils/errors.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\n// Duplicate of core\n// TODO: Remove once we stop supporting 0.2.x core versions\nexport type LangChainErrorCodes =\n | \"INVALID_PROMPT_INPUT\"\n | \"INVALID_TOOL_RESULTS\"\n | \"MESSAGE_COERCION_FAILURE\"\n | \"MODEL_AUTHENTICATION\"\n | \"MODEL_NOT_FOUND\"\n | \"MODEL_RATE_LIMIT\"\n | \"OUTPUT_PARSING_FAILURE\";\n\nexport function addLangChainErrorFields(\n error: any,\n lc_error_code: LangChainErrorCodes\n) {\n (error as any).lc_error_code = lc_error_code;\n error.message = `${error.message}\\n\\nTroubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/${lc_error_code}/\\n`;\n return error;\n}\n"],"mappings":";;AAaA,SAAgB,wBACdA,OACAC,eACA;CACC,MAAc,gBAAgB;CAC/B,MAAM,UAAU,GAAG,MAAM,QAAQ,oFAAoF,EAAE,cAAc,GAAG,CAAC;AACzI,QAAO;AACR"}