mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 03:56:23 +08:00
fix(core): ai image upload failed (#13405)
Close [AI-407](https://linear.app/affine-design/issue/AI-407) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Ensured that images included in the chat context are now properly sent as attachments during AI chat interactions. * **Tests** * Enhanced chat tests to verify that the AI correctly identifies images of kittens or cats in its responses. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -700,7 +700,7 @@ export class AIChatInput extends SignalWatcher(
|
||||
: undefined,
|
||||
},
|
||||
docId: this.docId,
|
||||
attachments: [],
|
||||
attachments: images,
|
||||
workspaceId: this.workspaceId,
|
||||
stream: true,
|
||||
signal: abortController.signal,
|
||||
|
||||
@@ -36,6 +36,12 @@ test.describe('AIChatWith/Image', () => {
|
||||
status: 'success',
|
||||
},
|
||||
]);
|
||||
|
||||
const { content } = await utils.chatPanel.getLatestAssistantMessage(page);
|
||||
await expect(
|
||||
content.toLowerCase().includes('kitten') ||
|
||||
content.toLowerCase().includes('cat')
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
test('support chat with mutiple images', async ({
|
||||
|
||||
Reference in New Issue
Block a user