reactbridge-sdk 0.2.20 → 0.2.21
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/hooks/useReactBridge.d.ts.map +1 -1
- package/dist/index.esm.js +4 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -528,8 +528,9 @@ function useReactBridge({ onIntentDetected, currentContext, onError, onSpeechSta
|
|
|
528
528
|
let previousResultResponse = null;
|
|
529
529
|
while (currentToolCall && toolCallCount < maxToolCalls) {
|
|
530
530
|
toolCallCount++;
|
|
531
|
-
// Execute the current tool
|
|
532
|
-
const
|
|
531
|
+
// Execute the current tool with isSequential flag for chained calls
|
|
532
|
+
const toolResultToolCall = Object.assign(Object.assign({}, currentToolCall), { isSequential: toolCallCount > 1 });
|
|
533
|
+
const toolResult = yield onIntentDetected(toolResultToolCall);
|
|
533
534
|
// Step 3: Send tool result back to orchestrator
|
|
534
535
|
if (lastRequestRef.current && currentResponse.sessionId) {
|
|
535
536
|
const resultResponse = yield api.sendToolResult(currentResponse.sessionId, toolResult, lastRequestRef.current);
|
|
@@ -550,8 +551,7 @@ function useReactBridge({ onIntentDetected, currentContext, onError, onSpeechSta
|
|
|
550
551
|
role: "assistant",
|
|
551
552
|
content: resultResponse.message,
|
|
552
553
|
timestamp: new Date(),
|
|
553
|
-
toolCall: resultResponse.toolCall
|
|
554
|
-
? Object.assign(Object.assign({}, resultResponse.toolCall), { isSequential: toolCallCount > 1 }) : undefined,
|
|
554
|
+
toolCall: resultResponse.toolCall,
|
|
555
555
|
};
|
|
556
556
|
setMessages((prev) => [...prev, finalMessage]);
|
|
557
557
|
// Trigger TTS for final response only if input came from voice (first iteration only)
|