SimpleChat:JS: Extract model response and show to user
This commit is contained in:
parent
33bc67baa6
commit
c6653479fc
1 changed files with 5 additions and 1 deletions
|
@ -101,7 +101,11 @@ async function handle_submit(inputUser, divChat, urlApi) {
|
|||
},
|
||||
body: gChat.request_messages_jsonstr(),
|
||||
});
|
||||
console.log("DBUG:HandleSubmit:Resp:", resp);
|
||||
let respBody = await resp.json();
|
||||
console.log("DBUG:HandleSubmit:Resp:", respBody);
|
||||
let assistantMsg = respBody["choices"][0]["message"]["content"];
|
||||
gChat.add(Roles.Assistant, assistantMsg);
|
||||
gChat.show(divChat);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue