mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Support the model "type" property
This commit is contained in:
4 files changed
+25
-4
No files matched your search
@@ -69,9 +69,10 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps)
|
||||
// Also filter to only show text models (modalities absent or includes "text")
|
||||
const providerModels = selectedProvider
|
||||
? models.filter(model =>
|
||||
model.provider === selectedProvider.id &&
|
||||
model.provider === selectedProvider.id &&
|
||||
model.type !== 'image' &&
|
||||
(!model.modalities || model.modalities.includes('text'))
|
||||
)
|
||||
)
|
||||
: [];
|
||||
|
||||
// Filter models by search query
|
||||
|
||||
@@ -198,7 +198,20 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
||||
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';
|
||||
let mode: 'chat' | 'image' = 'image';
|
||||
|
||||
if (providerModel?.type) {
|
||||
switch (providerModel.type) {
|
||||
case 'chat':
|
||||
mode = 'chat';
|
||||
break;
|
||||
case 'image':
|
||||
mode = 'image';
|
||||
break;
|
||||
}
|
||||
} else if (providerModel?.modalities?.includes('image')) {
|
||||
mode = 'chat';
|
||||
}
|
||||
|
||||
tools.generate_image = new GenerateImageTool(
|
||||
fs,
|
||||
|
||||
Reference in new issue
Block a user