@langgraph-js/sdk 4.3.6 → 4.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,6 +29,8 @@ export const getMessageContent = (content) => {
29
29
  return item.text;
30
30
  if (item.type === "image_url")
31
31
  return `[图片]`;
32
+ if (item.type === "tool_use")
33
+ return "";
32
34
  return JSON.stringify(item);
33
35
  })
34
36
  .join("");
@@ -120,6 +122,9 @@ export const createChatStore = (initClientName, config, context = {}) => {
120
122
  // 自动激活最近的历史会话
121
123
  await activateSession(syncedSessions[0].sessionId);
122
124
  }
125
+ else {
126
+ await createNewSession();
127
+ }
123
128
  }
124
129
  else {
125
130
  // 创建新会话
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langgraph-js/sdk",
3
- "version": "4.3.6",
3
+ "version": "4.3.8",
4
4
  "description": "The UI SDK for LangGraph - seamlessly integrate your AI agents with frontend interfaces",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -33,6 +33,7 @@ export const getMessageContent = (content: any) => {
33
33
  if (typeof item === "string") return item;
34
34
  if (item.type === "text") return item.text;
35
35
  if (item.type === "image_url") return `[图片]`;
36
+ if (item.type === "tool_use") return "";
36
37
  return JSON.stringify(item);
37
38
  })
38
39
  .join("");
@@ -153,6 +154,8 @@ export const createChatStore = (initClientName: string, config: Partial<LangGrap
153
154
  const syncedSessions = sessions.get();
154
155
  // 自动激活最近的历史会话
155
156
  await activateSession(syncedSessions[0].sessionId);
157
+ } else {
158
+ await createNewSession();
156
159
  }
157
160
  } else {
158
161
  // 创建新会话