Timothy Jaeryang Baek 3 月之前
父节点
当前提交
2d0e55e8f6
共有 1 个文件被更改,包括 14 次插入10 次删除
  1. 14 10
      src/lib/components/notes/NoteEditor/Chat.svelte

+ 14 - 10
src/lib/components/notes/NoteEditor/Chat.svelte

@@ -98,16 +98,20 @@
 					...messages
 					...messages
 				].filter((message) => message),
 				].filter((message) => message),
 				files: [
 				files: [
-					{
-						id: `note:${note?.id ?? 'note'}`,
-						name: note?.name ?? 'Note',
-						file: {
-							data: {
-								content: note?.data?.content?.md ?? ''
-							}
-						},
-						context: 'full'
-					}, // Include the note content as a file
+					...(note?.data?.content?.md
+						? [
+								{
+									id: `note:${note?.id ?? 'note'}`,
+									name: note?.name ?? 'Note',
+									file: {
+										data: {
+											content: note?.data?.content?.md
+										}
+									},
+									context: 'full'
+								}
+							]
+						: []), // Include the note content as a file
 					...files
 					...files
 				]
 				]
 			},
 			},