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,
|
: undefined,
|
||||||
},
|
},
|
||||||
docId: this.docId,
|
docId: this.docId,
|
||||||
attachments: [],
|
attachments: images,
|
||||||
workspaceId: this.workspaceId,
|
workspaceId: this.workspaceId,
|
||||||
stream: true,
|
stream: true,
|
||||||
signal: abortController.signal,
|
signal: abortController.signal,
|
||||||
|
|||||||
@@ -36,6 +36,12 @@ test.describe('AIChatWith/Image', () => {
|
|||||||
status: 'success',
|
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 ({
|
test('support chat with mutiple images', async ({
|
||||||
|
|||||||
Reference in New Issue
Block a user