reactbridge-sdk 0.2.18 → 0.2.20
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
|
@@ -534,7 +534,10 @@ function useReactBridge({ onIntentDetected, currentContext, onError, onSpeechSta
|
|
|
534
534
|
if (lastRequestRef.current && currentResponse.sessionId) {
|
|
535
535
|
const resultResponse = yield api.sendToolResult(currentResponse.sessionId, toolResult, lastRequestRef.current);
|
|
536
536
|
// Check if result is identical to previous one (prevent infinite loops on duplicate responses)
|
|
537
|
-
const currentResultString = JSON.stringify(
|
|
537
|
+
const currentResultString = JSON.stringify({
|
|
538
|
+
message: resultResponse.message,
|
|
539
|
+
toolCall: resultResponse.toolCall,
|
|
540
|
+
});
|
|
538
541
|
if (previousResultResponse === currentResultString) {
|
|
539
542
|
console.warn("Identical tool response detected. Exiting loop to prevent infinite loop.");
|
|
540
543
|
currentToolCall = null;
|
|
@@ -547,7 +550,8 @@ function useReactBridge({ onIntentDetected, currentContext, onError, onSpeechSta
|
|
|
547
550
|
role: "assistant",
|
|
548
551
|
content: resultResponse.message,
|
|
549
552
|
timestamp: new Date(),
|
|
550
|
-
toolCall: resultResponse.toolCall
|
|
553
|
+
toolCall: resultResponse.toolCall
|
|
554
|
+
? Object.assign(Object.assign({}, resultResponse.toolCall), { isSequential: toolCallCount > 1 }) : undefined,
|
|
551
555
|
};
|
|
552
556
|
setMessages((prev) => [...prev, finalMessage]);
|
|
553
557
|
// Trigger TTS for final response only if input came from voice (first iteration only)
|