mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 18:30:15 +01:00
ci(backend-review.yml): add linter step to the backend review workflow (#625)
* ci(backend-review.yml): add linter step to the backend review workflow * chore(backend-review.yml): remove prettier from lint-action configuration * chore: apply new linting workflow * chore(lint-staged.config.js): reorder lint-staged tasks for JavaScript and TypeScript files * chore(eslint): update ignorePatterns in .eslintrc.js chore(lint-action): remove prettier option in backend-review.yml chore(package.json): add lint and lint:fix scripts * chore(lint-staged.config.js): remove prettier --write command for js, jsx, ts, tsx files * chore(titleConvo.js): remove unnecessary console.log statement chore(titleConvo.js): add missing comma in options object * chore: apply linting to all files * chore(lint-staged.config.js): update lint-staged configuration to include prettier formatting
This commit is contained in:
parent
637bb6bc11
commit
e5336039fc
231 changed files with 1688 additions and 1526 deletions
|
|
@ -26,9 +26,9 @@ export default function MessageHandler() {
|
|||
parentMessageId: message?.overrideParentMessageId,
|
||||
messageId: message?.overrideParentMessageId + '_',
|
||||
plugin: plugin ? plugin : null,
|
||||
submitting: true
|
||||
submitting: true,
|
||||
// unfinished: true
|
||||
}
|
||||
},
|
||||
]);
|
||||
} else {
|
||||
setMessages([
|
||||
|
|
@ -40,9 +40,9 @@ export default function MessageHandler() {
|
|||
parentMessageId: message?.messageId,
|
||||
messageId: message?.messageId + '_',
|
||||
plugin: plugin ? plugin : null,
|
||||
submitting: true
|
||||
submitting: true,
|
||||
// unfinished: true
|
||||
}
|
||||
},
|
||||
]);
|
||||
}
|
||||
};
|
||||
|
|
@ -74,7 +74,7 @@ export default function MessageHandler() {
|
|||
|
||||
setConversation((prevState) => ({
|
||||
...prevState,
|
||||
...conversation
|
||||
...conversation,
|
||||
}));
|
||||
};
|
||||
|
||||
|
|
@ -88,8 +88,8 @@ export default function MessageHandler() {
|
|||
...initialResponse,
|
||||
parentMessageId: message?.overrideParentMessageId,
|
||||
messageId: message?.overrideParentMessageId + '_',
|
||||
submitting: true
|
||||
}
|
||||
submitting: true,
|
||||
},
|
||||
]);
|
||||
else
|
||||
setMessages([
|
||||
|
|
@ -99,14 +99,14 @@ export default function MessageHandler() {
|
|||
...initialResponse,
|
||||
parentMessageId: message?.messageId,
|
||||
messageId: message?.messageId + '_',
|
||||
submitting: true
|
||||
}
|
||||
submitting: true,
|
||||
},
|
||||
]);
|
||||
|
||||
const { conversationId } = message;
|
||||
setConversation((prevState) => ({
|
||||
...prevState,
|
||||
conversationId
|
||||
conversationId,
|
||||
}));
|
||||
resetLatestMessage();
|
||||
};
|
||||
|
|
@ -138,7 +138,7 @@ export default function MessageHandler() {
|
|||
|
||||
setConversation((prevState) => ({
|
||||
...prevState,
|
||||
...conversation
|
||||
...conversation,
|
||||
}));
|
||||
};
|
||||
|
||||
|
|
@ -149,7 +149,7 @@ export default function MessageHandler() {
|
|||
const errorResponse = {
|
||||
...data,
|
||||
error: true,
|
||||
parentMessageId: message?.messageId
|
||||
parentMessageId: message?.messageId,
|
||||
};
|
||||
setIsSubmitting(false);
|
||||
setMessages([...messages, message, errorResponse]);
|
||||
|
|
@ -164,11 +164,11 @@ export default function MessageHandler() {
|
|||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${token}`
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
abortKey: conversationId
|
||||
})
|
||||
abortKey: conversationId,
|
||||
}),
|
||||
})
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
|
|
@ -193,7 +193,7 @@ export default function MessageHandler() {
|
|||
|
||||
const events = new SSE(server, {
|
||||
payload: JSON.stringify(payload),
|
||||
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` }
|
||||
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` },
|
||||
});
|
||||
|
||||
events.onmessage = (e) => {
|
||||
|
|
@ -206,7 +206,7 @@ export default function MessageHandler() {
|
|||
if (data.created) {
|
||||
message = {
|
||||
...data.message,
|
||||
overrideParentMessageId: message?.overrideParentMessageId
|
||||
overrideParentMessageId: message?.overrideParentMessageId,
|
||||
};
|
||||
createdHandler(data, { ...submission, message });
|
||||
console.log('created', message);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue