fix(core): should choose different models based on content or attachments (#6567)

This commit is contained in:
fundon 2024-04-15 13:12:57 +00:00
parent 4b24722f3d
commit b2ca8249c1
No known key found for this signature in database
GPG Key ID: 398BFA91AC539CF7

View File

@ -1,6 +1,7 @@
import { assertExists } from '@blocksuite/global/utils';
import { AIProvider } from '@blocksuite/presets';
import type { PromptKey } from './prompt';
import {
createChatSession,
listHistories,
@ -250,8 +251,12 @@ export function setupAIProvider() {
});
AIProvider.provide('createImage', options => {
// const promptName = 'debug:action:fal-sd15';
const promptName = 'debug:action:dalle3';
// test to image
let promptName: PromptKey = 'debug:action:dalle3';
// image to image
if (options.attachments?.length) {
promptName = 'debug:action:fal-sd15';
}
return toImage({
...options,
promptName,