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
@@ -8,6 +8,7 @@ import { createAIClient } from '@/lib/ai-client';
|
||||
|
||||
interface ProviderModel {
|
||||
id: string;
|
||||
type?: "chat" | "image";
|
||||
name?: string;
|
||||
provider: string;
|
||||
fullId: string; // provider/model format
|
||||
@@ -21,6 +22,7 @@ interface ProviderModel {
|
||||
/** Output/completion pricing per token */
|
||||
completion: Decimal;
|
||||
};
|
||||
/** For "chat" type models - which output modalities are supported */
|
||||
modalities?: string[];
|
||||
}
|
||||
|
||||
@@ -65,6 +67,10 @@ export function useProviderModels(): ModelFetchResult {
|
||||
fullId: `${provider.id}/${model.id}`,
|
||||
};
|
||||
|
||||
if ('type' in model && (model.type === 'chat' || model.type === 'image')) {
|
||||
providerModel.type = model.type;
|
||||
}
|
||||
|
||||
if ('name' in model && typeof model.name === 'string') {
|
||||
providerModel.name = model.name;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user