added a log of the full raw AI response after streaming
This commit is contained in:
parent
c275625111
commit
50d8e8e41f
5 changed files with 11 additions and 0 deletions
|
|
@ -80,6 +80,7 @@ self.onmessage = async function(event) {
|
|||
if (stopStreaming) {
|
||||
stopStreaming = false;
|
||||
reader.cancel();
|
||||
taLog.log("AI full response [STOPPED]: " + assistantResponseAccumulator);
|
||||
conversationHistory.push({ role: 'assistant', content: assistantResponseAccumulator });
|
||||
assistantResponseAccumulator = '';
|
||||
postMessage({ type: 'tokensDone' });
|
||||
|
|
@ -87,6 +88,7 @@ self.onmessage = async function(event) {
|
|||
}
|
||||
const { done, value } = await reader.read();
|
||||
if (done) {
|
||||
taLog.log("AI full response: " + assistantResponseAccumulator);
|
||||
conversationHistory.push({ role: 'assistant', content: assistantResponseAccumulator });
|
||||
assistantResponseAccumulator = '';
|
||||
postMessage({ type: 'tokensDone' });
|
||||
|
|
@ -138,6 +140,7 @@ self.onmessage = async function(event) {
|
|||
break;
|
||||
|
||||
case 'message_stop':
|
||||
taLog.log("AI full response: " + assistantResponseAccumulator);
|
||||
conversationHistory.push({ role: 'assistant', content: assistantResponseAccumulator });
|
||||
assistantResponseAccumulator = '';
|
||||
postMessage({ type: 'tokensDone' });
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ self.onmessage = async function(event) {
|
|||
if (stopStreaming) {
|
||||
stopStreaming = false;
|
||||
reader.cancel();
|
||||
taLog.log("AI full response [STOPPED]: " + assistantResponseAccumulator);
|
||||
conversationHistory.push({ role: 'model', parts: [{"text": assistantResponseAccumulator}] });
|
||||
assistantResponseAccumulator = '';
|
||||
postMessage({ type: 'tokensDone' });
|
||||
|
|
@ -86,6 +87,7 @@ self.onmessage = async function(event) {
|
|||
}
|
||||
const { done, value } = await reader.read();
|
||||
if (done) {
|
||||
taLog.log("AI full response: " + assistantResponseAccumulator);
|
||||
conversationHistory.push({ role: 'model', parts: [{"text": assistantResponseAccumulator}] });
|
||||
assistantResponseAccumulator = '';
|
||||
postMessage({ type: 'tokensDone' });
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ self.onmessage = async function(event) {
|
|||
if (stopStreaming) {
|
||||
stopStreaming = false;
|
||||
reader.cancel();
|
||||
taLog.log("AI full response [STOPPED]: " + assistantResponseAccumulator);
|
||||
conversationHistory.push({ role: 'assistant', content: assistantResponseAccumulator });
|
||||
assistantResponseAccumulator = '';
|
||||
postMessage({ type: 'tokensDone' });
|
||||
|
|
@ -89,6 +90,7 @@ self.onmessage = async function(event) {
|
|||
}
|
||||
const { done, value } = await reader.read();
|
||||
if (done) {
|
||||
taLog.log("AI full response: " + assistantResponseAccumulator);
|
||||
conversationHistory.push({ role: 'assistant', content: assistantResponseAccumulator });
|
||||
assistantResponseAccumulator = '';
|
||||
postMessage({ type: 'tokensDone' });
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ self.onmessage = async function(event) {
|
|||
if (stopStreaming) {
|
||||
stopStreaming = false;
|
||||
reader.cancel();
|
||||
taLog.log("AI full response [STOPPED]: " + assistantResponseAccumulator);
|
||||
conversationHistory.push({ role: 'assistant', content: assistantResponseAccumulator });
|
||||
assistantResponseAccumulator = '';
|
||||
postMessage({ type: 'tokensDone' });
|
||||
|
|
@ -86,6 +87,7 @@ self.onmessage = async function(event) {
|
|||
}
|
||||
const { done, value } = await reader.read();
|
||||
if (done) {
|
||||
taLog.log("AI full response: " + assistantResponseAccumulator);
|
||||
conversationHistory.push({ role: 'assistant', content: assistantResponseAccumulator });
|
||||
assistantResponseAccumulator = '';
|
||||
postMessage({ type: 'tokensDone' });
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ self.onmessage = async function(event) {
|
|||
if (stopStreaming) {
|
||||
stopStreaming = false;
|
||||
reader.cancel();
|
||||
taLog.log("AI full response [STOPPED]: " + assistantResponseAccumulator);
|
||||
conversationHistory.push({ role: 'assistant', content: assistantResponseAccumulator });
|
||||
assistantResponseAccumulator = '';
|
||||
postMessage({ type: 'tokensDone' });
|
||||
|
|
@ -97,6 +98,7 @@ self.onmessage = async function(event) {
|
|||
}
|
||||
const { done, value } = await reader.read();
|
||||
if (done) {
|
||||
taLog.log("AI full response: " + assistantResponseAccumulator);
|
||||
conversationHistory.push({ role: 'assistant', content: assistantResponseAccumulator });
|
||||
assistantResponseAccumulator = '';
|
||||
postMessage({ type: 'tokensDone' });
|
||||
|
|
|
|||
Loading…
Reference in a new issue