@langgraph-js/sdk 1.1.4 → 1.1.5

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.
@@ -42,9 +42,9 @@ export class LangGraphClient extends Client {
42
42
  const assistants = await this.listAssistants();
43
43
  this.availableAssistants = assistants;
44
44
  if (assistants.length > 0) {
45
- this.currentAssistant = assistants.find((assistant) => assistant.name === agentName) || null;
45
+ this.currentAssistant = assistants.find((assistant) => assistant.graph_id === agentName) || null;
46
46
  if (!this.currentAssistant) {
47
- throw new Error("Agent not found");
47
+ throw new Error("Agent not found: " + agentName);
48
48
  }
49
49
  }
50
50
  else {
@@ -201,7 +201,7 @@ export class LangGraphClient extends Client {
201
201
  const assistantToolMessage = assistantToolMessages.get(message.tool_call_id);
202
202
  const parentMessage = toolParentMessage.get(message.tool_call_id);
203
203
  if (assistantToolMessage) {
204
- message.tool_input = typeof assistantToolMessage.args !== "object" ? JSON.stringify(assistantToolMessage.args) : assistantToolMessage.args;
204
+ message.tool_input = typeof assistantToolMessage.args !== "string" ? JSON.stringify(assistantToolMessage.args) : assistantToolMessage.args;
205
205
  if (message.additional_kwargs) {
206
206
  message.additional_kwargs.done = true;
207
207
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langgraph-js/sdk",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
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",
@@ -86,9 +86,9 @@ export class LangGraphClient extends Client {
86
86
  const assistants = await this.listAssistants();
87
87
  this.availableAssistants = assistants;
88
88
  if (assistants.length > 0) {
89
- this.currentAssistant = assistants.find((assistant) => assistant.name === agentName) || null;
89
+ this.currentAssistant = assistants.find((assistant) => assistant.graph_id === agentName) || null;
90
90
  if (!this.currentAssistant) {
91
- throw new Error("Agent not found");
91
+ throw new Error("Agent not found: " + agentName);
92
92
  }
93
93
  } else {
94
94
  throw new Error("No assistants found");
@@ -258,7 +258,7 @@ export class LangGraphClient extends Client {
258
258
  const assistantToolMessage = assistantToolMessages.get(message.tool_call_id!);
259
259
  const parentMessage = toolParentMessage.get(message.tool_call_id!);
260
260
  if (assistantToolMessage) {
261
- message.tool_input = typeof assistantToolMessage.args !== "object" ? JSON.stringify(assistantToolMessage.args) : assistantToolMessage.args;
261
+ message.tool_input = typeof assistantToolMessage.args !== "string" ? JSON.stringify(assistantToolMessage.args) : assistantToolMessage.args;
262
262
  if (message.additional_kwargs) {
263
263
  message.additional_kwargs.done = true;
264
264
  } else {