SimpleChat:theResp-origMsg: Undo a prev change to fix non trim
When the response handling was moved into SimpleChat, I had changed a flow bit unnecessarily and carelessly, which resulted in the non trim flow, missing out on retaining the ai assistant response. This has been fixed now.
This commit is contained in:
parent
b75b3db7bf
commit
cdb4f6d243
1 changed files with 4 additions and 4 deletions
|
@ -422,19 +422,19 @@ class SimpleChat {
|
|||
assistant: "",
|
||||
trimmed: "",
|
||||
}
|
||||
let origMsg;
|
||||
if (gMe.bStream) {
|
||||
try {
|
||||
origMsg = await this.handle_response_multipart(resp, apiEP, elDiv);
|
||||
theResp.assistant = await this.handle_response_multipart(resp, apiEP, elDiv);
|
||||
this.latestResponse = "";
|
||||
} catch (error) {
|
||||
origMsg = this.latestResponse;
|
||||
theResp.assistant = this.latestResponse;
|
||||
throw error;
|
||||
}
|
||||
} else {
|
||||
origMsg = await this.handle_response_oneshot(resp, apiEP);
|
||||
theResp.assistant = await this.handle_response_oneshot(resp, apiEP);
|
||||
}
|
||||
if (gMe.bTrimGarbage) {
|
||||
let origMsg = theResp.assistant;
|
||||
theResp.assistant = du.trim_garbage_at_end(origMsg);
|
||||
theResp.trimmed = origMsg.substring(theResp.assistant.length);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue