UNPKG

@langchain/core

Version:
1 lines 4.28 kB
{"version":3,"file":"console.d.ts","names":["BaseTracer","Run","ConsoleCallbackHandler","Promise"],"sources":["../../src/tracers/console.d.ts"],"sourcesContent":["import { BaseTracer, type Run } from \"./base.js\";\n/**\n * A tracer that logs all events to the console. It extends from the\n * `BaseTracer` class and overrides its methods to provide custom logging\n * functionality.\n * @example\n * ```typescript\n *\n * const llm = new ChatAnthropic({\n * temperature: 0,\n * tags: [\"example\", \"callbacks\", \"constructor\"],\n * callbacks: [new ConsoleCallbackHandler()],\n * });\n *\n * ```\n */\nexport declare class ConsoleCallbackHandler extends BaseTracer {\n name: \"console_callback_handler\";\n /**\n * Method used to persist the run. In this case, it simply returns a\n * resolved promise as there's no persistence logic.\n * @param _run The run to persist.\n * @returns A resolved promise.\n */\n protected persistRun(_run: Run): Promise<void>;\n // utility methods\n /**\n * Method used to get all the parent runs of a given run.\n * @param run The run whose parents are to be retrieved.\n * @returns An array of parent runs.\n */\n getParents(run: Run): Run[];\n /**\n * Method used to get a string representation of the run's lineage, which\n * is used in logging.\n * @param run The run whose lineage is to be retrieved.\n * @returns A string representation of the run's lineage.\n */\n getBreadcrumbs(run: Run): string;\n // logging methods\n /**\n * Method used to log the start of a chain run.\n * @param run The chain run that has started.\n * @returns void\n */\n onChainStart(run: Run): void;\n /**\n * Method used to log the end of a chain run.\n * @param run The chain run that has ended.\n * @returns void\n */\n onChainEnd(run: Run): void;\n /**\n * Method used to log any errors of a chain run.\n * @param run The chain run that has errored.\n * @returns void\n */\n onChainError(run: Run): void;\n /**\n * Method used to log the start of an LLM run.\n * @param run The LLM run that has started.\n * @returns void\n */\n onLLMStart(run: Run): void;\n /**\n * Method used to log the end of an LLM run.\n * @param run The LLM run that has ended.\n * @returns void\n */\n onLLMEnd(run: Run): void;\n /**\n * Method used to log any errors of an LLM run.\n * @param run The LLM run that has errored.\n * @returns void\n */\n onLLMError(run: Run): void;\n /**\n * Method used to log the start of a tool run.\n * @param run The tool run that has started.\n * @returns void\n */\n onToolStart(run: Run): void;\n /**\n * Method used to log the end of a tool run.\n * @param run The tool run that has ended.\n * @returns void\n */\n onToolEnd(run: Run): void;\n /**\n * Method used to log any errors of a tool run.\n * @param run The tool run that has errored.\n * @returns void\n */\n onToolError(run: Run): void;\n /**\n * Method used to log the start of a retriever run.\n * @param run The retriever run that has started.\n * @returns void\n */\n onRetrieverStart(run: Run): void;\n /**\n * Method used to log the end of a retriever run.\n * @param run The retriever run that has ended.\n * @returns void\n */\n onRetrieverEnd(run: Run): void;\n /**\n * Method used to log any errors of a retriever run.\n * @param run The retriever run that has errored.\n * @returns void\n */\n onRetrieverError(run: Run): void;\n /**\n * Method used to log the action selected by the agent.\n * @param run The run in which the agent action occurred.\n * @returns void\n */\n onAgentAction(run: Run): void;\n}\n"],"mappings":";;;;;;AAgBA;;;;;;;;;;;;;AAiEqBC,cAjEAC,sBAAAA,SAA+BF,UAAAA,CAiE/BC;EAAG,IAMLA,EAAAA,0BAAAA;EAAG;;;;;;EAvEwC,UAAA,UAAA,CAAA,IAAA,EAQ/BA,GAR+B,CAAA,EAQzBE,OARyB,CAAA,IAAA,CAAA;;;;;;;kBAe1CF,MAAMA;;;;;;;sBAOFA;;;;;;;oBAOFA;;;;;;kBAMFA;;;;;;oBAMEA;;;;;;kBAMFA;;;;;;gBAMFA;;;;;;kBAMEA;;;;;;mBAMCA;;;;;;iBAMFA;;;;;;mBAMEA;;;;;;wBAMKA;;;;;;sBAMFA;;;;;;wBAMEA;;;;;;qBAMHA"}