Support the model "type" property

This commit is contained in:
Alex Gleason committed 2025-12-07 23:56:56 -06:00
1 parent 0b076d2114
commit 465364ffc0
4 files changed
+25 -4

No files matched your search

+6
View File
@@ -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;
}