agsamantha/node_modules/langchain/dist/agents/tool_calling/output_parser.d.ts

23 lines
969 B
TypeScript
Raw Permalink Normal View History

2024-10-02 15:15:21 -05:00
import { AgentAction, AgentFinish, AgentStep } from "@langchain/core/agents";
import { AIMessage, BaseMessage } from "@langchain/core/messages";
import { ChatGeneration } from "@langchain/core/outputs";
import { AgentMultiActionOutputParser } from "../types.js";
/**
* Type that represents an agent action with an optional message log.
*/
export type ToolsAgentAction = AgentAction & {
toolCallId: string;
messageLog?: BaseMessage[];
};
export type ToolsAgentStep = AgentStep & {
action: ToolsAgentAction;
};
export declare function parseAIMessageToToolAction(message: AIMessage): ToolsAgentAction[] | AgentFinish;
export declare class ToolCallingAgentOutputParser extends AgentMultiActionOutputParser {
lc_namespace: string[];
static lc_name(): string;
parse(text: string): Promise<AgentAction[] | AgentFinish>;
parseResult(generations: ChatGeneration[]): Promise<AgentFinish | ToolsAgentAction[]>;
getFormatInstructions(): string;
}