From ad6c34e171ebe649246b260c451ae2f7d44a15aa Mon Sep 17 00:00:00 2001 From: musistudio Date: Sat, 4 Oct 2025 18:12:24 +0800 Subject: [PATCH] fix image agent error --- src/agents/image.agent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agents/image.agent.ts b/src/agents/image.agent.ts index b905bdb..5990436 100644 --- a/src/agents/image.agent.ts +++ b/src/agents/image.agent.ts @@ -208,7 +208,7 @@ Your response should consistently follow this rule whenever image-related analys const imageContents = req.body.messages.filter((item: any) => { return item.role === 'user' && Array.isArray(item.content) && - item.content.some((msg: any) => msg.type === "image" || msg?.content?.some((sub: any) => sub.type === 'image')); + item.content.some((msg: any) => msg.type === "image" || (Array.isArray(msg.content) && msg.content.some((sub: any) => sub.type === 'image')); }); let imgId = 1;