mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-18 08:25:30 +01:00
fix bingai bugs and add chatgptbrowser client
This commit is contained in:
parent
168d5e8075
commit
16932b37c0
7 changed files with 42 additions and 46 deletions
|
|
@ -38,7 +38,7 @@ export default function TextChat({ messages }) {
|
|||
};
|
||||
const convoHandler = (data) => {
|
||||
console.log('in convo handler');
|
||||
if (model !== 'bingai' && convo.parentMessageId === null) {
|
||||
if (model !== 'bingai' && convo.conversationId && convo.parentMessageId === null) {
|
||||
const { title, conversationId, id } = data;
|
||||
console.log('parentMessageId is null');
|
||||
console.log('title, convoId, id', title, conversationId, id);
|
||||
|
|
@ -52,7 +52,7 @@ export default function TextChat({ messages }) {
|
|||
invocationId: null
|
||||
})
|
||||
);
|
||||
} else if (convo.invocationId === null) {
|
||||
} else if (model === 'bingai' && convo.invocationId === null) {
|
||||
const { title, conversationSignature, clientId, conversationId, invocationId } = data;
|
||||
console.log('convoSig is null');
|
||||
console.log(
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@ export default function handleSubmit({
|
|||
events.onmessage = function (e) {
|
||||
const data = JSON.parse(e.data);
|
||||
const text = data.text || data.response;
|
||||
if (!!data.message) {
|
||||
messageHandler(text.replace(/^\n/, ''));
|
||||
} else if (!!data.final) {
|
||||
if (data.message) {
|
||||
messageHandler(text);
|
||||
} else if (data.final) {
|
||||
console.log(data);
|
||||
convoHandler(data);
|
||||
} else {
|
||||
|
|
@ -58,4 +58,4 @@ export default function handleSubmit({
|
|||
};
|
||||
|
||||
events.stream();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue