From 88c603b00bbdfd8a54f3d62067c9eeeac0451aaa Mon Sep 17 00:00:00 2001 From: William FH <13333726+hinthornw@users.noreply.github.com> Date: Mon, 9 Jun 2025 08:22:35 -0700 Subject: [PATCH] fix: (sdk-js) Expand ToolMessage Type (#5015) --- libs/sdk-js/package.json | 2 +- libs/sdk-js/src/types.messages.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libs/sdk-js/package.json b/libs/sdk-js/package.json index 29f67ab5d..e820f7634 100644 --- a/libs/sdk-js/package.json +++ b/libs/sdk-js/package.json @@ -1,6 +1,6 @@ { "name": "@langchain/langgraph-sdk", - "version": "0.0.83", + "version": "0.0.84", "description": "Client library for interacting with the LangGraph API", "type": "module", "packageManager": "yarn@1.22.19", diff --git a/libs/sdk-js/src/types.messages.ts b/libs/sdk-js/src/types.messages.ts index 62f2e6d5d..49123cf1a 100644 --- a/libs/sdk-js/src/types.messages.ts +++ b/libs/sdk-js/src/types.messages.ts @@ -70,6 +70,15 @@ export type ToolMessage = { tool_call_id: string; additional_kwargs?: MessageAdditionalKwargs | undefined; response_metadata?: Record | undefined; + /** + * Artifact of the Tool execution which is not meant to be sent to the model. + * + * Should only be specified if it is different from the message content, e.g. if only + * a subset of the full tool output is being passed as message content but the full + * output is needed in other parts of the code. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + artifact?: any; }; export type SystemMessage = {