fix(core): should choose different models based on content or attachments (#6567)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { assertExists } from '@blocksuite/global/utils';
|
import { assertExists } from '@blocksuite/global/utils';
|
||||||
import { AIProvider } from '@blocksuite/presets';
|
import { AIProvider } from '@blocksuite/presets';
|
||||||
|
|
||||||
|
import type { PromptKey } from './prompt';
|
||||||
import {
|
import {
|
||||||
createChatSession,
|
createChatSession,
|
||||||
listHistories,
|
listHistories,
|
||||||
@@ -250,8 +251,12 @@ export function setupAIProvider() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
AIProvider.provide('createImage', options => {
|
AIProvider.provide('createImage', options => {
|
||||||
// const promptName = 'debug:action:fal-sd15';
|
// test to image
|
||||||
const promptName = 'debug:action:dalle3';
|
let promptName: PromptKey = 'debug:action:dalle3';
|
||||||
|
// image to image
|
||||||
|
if (options.attachments?.length) {
|
||||||
|
promptName = 'debug:action:fal-sd15';
|
||||||
|
}
|
||||||
return toImage({
|
return toImage({
|
||||||
...options,
|
...options,
|
||||||
promptName,
|
promptName,
|
||||||
|
|||||||
Reference in New Issue
Block a user