@ensembleapp/client-sdk 0.0.50 → 0.0.51

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/index.js CHANGED
@@ -4232,6 +4232,7 @@ function useChat({
4232
4232
  onUsage
4233
4233
  }) {
4234
4234
  const { baseUrl, token, headers: customHeaders = {} } = api;
4235
+ const customHeadersKey = JSON.stringify(customHeaders);
4235
4236
  const dataContextRef = useRef(dataContext);
4236
4237
  dataContextRef.current = dataContext;
4237
4238
  const tokenRef = useRef(token);
@@ -4336,7 +4337,7 @@ function useChat({
4336
4337
  }
4337
4338
  };
4338
4339
  fetchInitialMessages();
4339
- }, [agentExecutionId, agentId, authFetch, baseUrl, customHeaders, onError, setMessages, threadId]);
4340
+ }, [agentExecutionId, agentId, authFetch, baseUrl, customHeadersKey, threadId]);
4340
4341
  useEffect(() => {
4341
4342
  if (!onMessage || messages.length === 0) return;
4342
4343
  const lastMessage = messages[messages.length - 1];