mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
fix(editor): add title to edgeless page block ai context (#12763)
Close [BS-3590](https://linear.app/affine-design/issue/BS-3590/page-block-的标题没有被作为上下文输入)
This commit is contained in:
@@ -130,6 +130,12 @@ export async function getContentFromSelected(
|
||||
}
|
||||
);
|
||||
|
||||
const hasPageBlock = notes.find(note => note.isPageBlock());
|
||||
const title =
|
||||
hasPageBlock && host.std.store.meta?.title
|
||||
? `# ${host.std.store.meta?.title}\n`
|
||||
: '';
|
||||
|
||||
const noteContent = await getContentFromHubBlockModel(host, notes);
|
||||
const edgelessTextContent = await getContentFromHubBlockModel(
|
||||
host,
|
||||
@@ -140,7 +146,7 @@ export async function getContentFromSelected(
|
||||
embedSyncedDocs
|
||||
);
|
||||
|
||||
return `${noteContent.join('\n')}
|
||||
return `${title}${noteContent.join('\n')}
|
||||
${edgelessTextContent.join('\n')}
|
||||
${syncedDocsContent}
|
||||
${texts.map(text => text.text.toString()).join('\n')}
|
||||
|
||||
Reference in New Issue
Block a user