Show model decline/cancellation states.
- Upon decline / cancellation we weren't showing the model the cancellation status or states. Therefore it didn't know why things would or wouldn't happen Fixes https://b.corp.google.com/issues/416797704
This commit is contained in:
parent
6b518dc9e4
commit
c0eab31c02
|
@ -509,6 +509,15 @@ export const useGeminiStream = (
|
||||||
error: new Error(declineMessage),
|
error: new Error(declineMessage),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Update conversation history without re-issuing another request to indicate the decline.
|
||||||
|
const history = chatSessionRef.current?.getHistory();
|
||||||
|
if (history) {
|
||||||
|
history.push({
|
||||||
|
role: 'model',
|
||||||
|
parts: [functionResponse],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Update UI to show cancellation/error
|
// Update UI to show cancellation/error
|
||||||
updateFunctionResponseUI(responseInfo, status);
|
updateFunctionResponseUI(responseInfo, status);
|
||||||
setStreamingState(StreamingState.Idle);
|
setStreamingState(StreamingState.Idle);
|
||||||
|
|
Loading…
Reference in New Issue