@nexo-labs/chat-agent 1.9.8 → 1.10.0

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.
package/dist/react.mjs CHANGED
@@ -116,7 +116,7 @@ function handleSSEEvent(event, callbacks) {
116
116
  callbacks.onToken?.(event.data);
117
117
  break;
118
118
  case "sources":
119
- if (Array.isArray(event.data)) callbacks.onSources?.(event.data);
119
+ callbacks.onSources?.(event.data);
120
120
  break;
121
121
  case "done":
122
122
  callbacks.onDone?.();
@@ -134,7 +134,7 @@ function handleSSEError(event) {
134
134
  if (errorData?.error === "EXPIRED_CONVERSATION") {
135
135
  const error = new Error(errorData?.message || "Esta conversación ha expirado");
136
136
  error.code = "EXPIRED_CONVERSATION";
137
- error.chatId = errorData?.chatId;
137
+ error.chatId = errorData?.chatId || "";
138
138
  throw error;
139
139
  }
140
140
  throw new Error(errorData?.error || "Streaming error");