diff --git a/components/chat.tsx b/components/chat.tsx index 07493b327..def781dce 100644 --- a/components/chat.tsx +++ b/components/chat.tsx @@ -492,12 +492,14 @@ export function Chat({ // 构造图片Markdown(使用与Gemini生成相同的格式) const imageMarkdown = `![thumb|||${result.original_url}|||2K](${result.thumbnail_url || result.original_url})`; - // 创建最终消息 + // 创建最终消息(前端显示用) const finalMessage: ChatMessage = { id: messageId, role: "assistant", parts: [{ type: "text", text: imageMarkdown }], - createdAt: new Date().toISOString(), + metadata: { + createdAt: new Date().toISOString(), + }, } as ChatMessage; // 更新消息 @@ -514,7 +516,13 @@ export function Chat({ }, body: JSON.stringify({ chatId: id, - message: finalMessage, + message: { + id: messageId, + role: "assistant", + parts: [{ type: "text", text: imageMarkdown }], + attachments: [], + createdAt: new Date().toISOString(), + }, }), }); } catch (saveError) {