fix: copilot blob process (#6612)

This commit is contained in:
darkskygit
2024-04-18 15:36:30 +00:00
parent 6a23fe37a7
commit 28f2ff24b9
2 changed files with 7 additions and 4 deletions

View File

@@ -113,8 +113,9 @@ export class OpenAIProvider
!m ||
// check content
typeof m.content !== 'string' ||
!m.content ||
!m.content.trim()
// content and attachments must exist at least one
((!m.content || !m.content.trim()) &&
(!Array.isArray(m.attachments) || !m.attachments.length))
)
) {
throw new Error('Empty message content');