Fix edit confirmation re-submission.
- This broke in [this commit](7d13f24288 (diff-e257a7e5e02896371ce002da8963abdb91f5c77990d38e3d2f7ea07e5b19e32eR428)
)
This commit is contained in:
parent
201eb38479
commit
782686bcf3
|
@ -424,8 +424,30 @@ export const useGeminiStream = (
|
||||||
updateFunctionResponseUI(responseInfo, ToolCallStatus.Error);
|
updateFunctionResponseUI(responseInfo, ToolCallStatus.Error);
|
||||||
setStreamingState(StreamingState.Idle);
|
setStreamingState(StreamingState.Idle);
|
||||||
} else {
|
} else {
|
||||||
// If accepted, set state back to Responding to wait for server execution/response
|
const tool = toolRegistry.getTool(request.name);
|
||||||
setStreamingState(StreamingState.Responding);
|
if (!tool) {
|
||||||
|
throw new Error(
|
||||||
|
`Tool "${request.name}" not found or is not registered.`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
const result = await tool.execute(request.args);
|
||||||
|
const functionResponse: Part = {
|
||||||
|
functionResponse: {
|
||||||
|
name: request.name,
|
||||||
|
id: request.callId,
|
||||||
|
response: { output: result.llmContent },
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const responseInfo: ToolCallResponseInfo = {
|
||||||
|
callId: request.callId,
|
||||||
|
responsePart: functionResponse,
|
||||||
|
resultDisplay: result.returnDisplay,
|
||||||
|
error: undefined,
|
||||||
|
};
|
||||||
|
updateFunctionResponseUI(responseInfo, ToolCallStatus.Success);
|
||||||
|
setStreamingState(StreamingState.Idle);
|
||||||
|
await submitQuery(functionResponse);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue