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