mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 01:49:51 +08: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 noteContent = await getContentFromHubBlockModel(host, notes);
|
||||||
const edgelessTextContent = await getContentFromHubBlockModel(
|
const edgelessTextContent = await getContentFromHubBlockModel(
|
||||||
host,
|
host,
|
||||||
@@ -140,7 +146,7 @@ export async function getContentFromSelected(
|
|||||||
embedSyncedDocs
|
embedSyncedDocs
|
||||||
);
|
);
|
||||||
|
|
||||||
return `${noteContent.join('\n')}
|
return `${title}${noteContent.join('\n')}
|
||||||
${edgelessTextContent.join('\n')}
|
${edgelessTextContent.join('\n')}
|
||||||
${syncedDocsContent}
|
${syncedDocsContent}
|
||||||
${texts.map(text => text.text.toString()).join('\n')}
|
${texts.map(text => text.text.toString()).join('\n')}
|
||||||
|
|||||||
Reference in New Issue
Block a user