Merge pull request #2478 from Yanyutin753/chat-message

feat make stronger
This commit is contained in:
Timothy Jaeryang Baek 2024-05-21 18:26:56 -10:00 committed by GitHub
commit f753db603b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -425,8 +425,7 @@
: undefined, : undefined,
...messages ...messages
] ]
.filter((message) => message) .filter((message) => message?.content?.trim())
.filter((message) => message.content != '')
.map((message, idx, arr) => { .map((message, idx, arr) => {
// Prepare the base message object // Prepare the base message object
const baseMessage = { const baseMessage = {
@ -686,8 +685,7 @@
: undefined, : undefined,
...messages ...messages
] ]
.filter((message) => message) .filter((message) => message?.content?.trim())
.filter((message) => message.content != '')
.map((message, idx, arr) => ({ .map((message, idx, arr) => ({
role: message.role, role: message.role,
...((message.files?.filter((file) => file.type === 'image').length > 0 ?? false) && ...((message.files?.filter((file) => file.type === 'image').length > 0 ?? false) &&