mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Refactor image generation tool
This commit is contained in:
4 files changed
+25
-22
No files matched your search
@@ -194,15 +194,18 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
||||
try {
|
||||
const { provider, model } = parseProviderModel(settings.imageModel, settings.providers);
|
||||
|
||||
// Find the model data to get modalities
|
||||
// Find the model data to determine the generation mode
|
||||
const providerModel = models.find(m => m.fullId === settings.imageModel);
|
||||
|
||||
// Determine mode: 'chat' if model supports image output modality, otherwise 'image'
|
||||
const mode = providerModel?.modalities?.includes('image') ? 'chat' : 'image';
|
||||
|
||||
tools.generate_image = new GenerateImageTool(
|
||||
fs,
|
||||
tmpPath,
|
||||
provider,
|
||||
model,
|
||||
providerModel?.modalities,
|
||||
mode,
|
||||
user,
|
||||
config.corsProxy
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user