mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Use API model info to decide how to generate image instead of hardcoding provider ID
This commit is contained in:
3 files changed
+24
-7
No files matched your search
@@ -190,11 +190,16 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
||||
if (settings.imageModel) {
|
||||
try {
|
||||
const { provider, model } = parseProviderModel(settings.imageModel, settings.providers);
|
||||
|
||||
// Find the model data to get outputModalities
|
||||
const providerModel = models.find(m => m.fullId === settings.imageModel);
|
||||
|
||||
tools.generate_image = new GenerateImageTool(
|
||||
fs,
|
||||
tmpPath,
|
||||
provider,
|
||||
model,
|
||||
providerModel?.outputModalities,
|
||||
user,
|
||||
config.corsProxy
|
||||
);
|
||||
@@ -204,7 +209,7 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
||||
}
|
||||
|
||||
return tools;
|
||||
}, [fs, git, cwd, user, projectId, projectsPath, tmpPath, pluginsPath, config.corsProxy, settings.imageModel, settings.providers, handleFileChanged]);
|
||||
}, [fs, git, cwd, user, projectId, projectsPath, tmpPath, pluginsPath, config.corsProxy, settings.imageModel, settings.providers, models, handleFileChanged]);
|
||||
|
||||
// MCP tools wrapped for execution
|
||||
const mcpToolWrappers = useMemo(() => createMCPTools(mcpClients), [mcpClients]);
|
||||
|
||||
Reference in new issue
Block a user