Refactor image generation tool

This commit is contained in:
Alex Gleason committed 2025-12-07 23:40:29 -06:00
1 parent e1028e9f5e
commit 0b076d2114
4 files changed
+25 -22

No files matched your search

+5 -2
View File
@@ -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
);