@langgraph-js/pro
Version:
The Pro SDK for LangGraph - seamlessly integrate your AI agents with frontend interfaces and build complex AI workflows
21 lines (20 loc) • 1.03 kB
TypeScript
import { BaseMessage, HumanMessage } from "@langchain/core/messages";
import { AIMessage, ContentBlock, ToolMessage } from "@langchain/core/messages";
export * from "./query.js";
/**
* 获取最后一条人类发送的消息
* @example
* const lastHumanMessage = getLastHumanMessage(state.messages);
* console.log(lastHumanMessage);
*/
export declare function getLastHumanMessage(messages: BaseMessage[]): HumanMessage | undefined;
export declare const getThreadId: (context: any) => string;
export declare const getToolCallId: (context: any) => string;
/**
* 创建一对 toolCall 数据
* @example
* ```typescript
* const [aiMessage, toolMessage] = createToolCall("toolName", { input: "input" }, "this is tool outputs");
* ```
*/
export declare const createToolCall: (toolName: string, input: Record<string, any>, output?: string | (ContentBlock | ContentBlock.Text)[]) => readonly [AIMessage<import("@langchain/core/messages").MessageStructure>, ToolMessage<import("@langchain/core/messages").MessageStructure>];