feat: use managed model capabilities for reasoning and image input

This commit is contained in:
brother7 committed 2026-09-12 21:37:18 +08:00
1 parent e7701d1f2c
commit 26cbb29aa9
29 files changed
+652 -271

No files matched your search

+5
View File
@@ -1,6 +1,7 @@
import type { ProviderAccount, ProviderVendorInfo } from '@/lib/providers';
import type { ConversationThinkingLevel, ProductModelRef } from '@/types/coding-conversation';
import { getImportedModelProfile } from '../../shared/imported-model-profile';
import { unknownManagedModelCapability, type ManagedModelCapability } from '../../shared/managed-model-capabilities';
export interface CodingModelOption {
key: string;
@@ -8,6 +9,7 @@ export interface CodingModelOption {
modelId: string;
label: string;
availableThinkingLevels: ConversationThinkingLevel[] | null;
managedCapability?: ManagedModelCapability;
}
const STANDARD_THINKING_LEVELS: readonly ConversationThinkingLevel[] = [
@@ -23,6 +25,7 @@ function availableThinkingLevels(
account: ProviderAccount,
modelId: string,
): ConversationThinkingLevel[] | null {
if (account.id === 'niancode-user-models') return [];
const serverCapability = account.metadata?.worksSquareModelCapabilities?.[modelId];
if (serverCapability) {
return [
@@ -85,6 +88,8 @@ export function buildCodingModelOptions(
modelId,
label: `${account.label}${vendor && vendor !== account.label ? ` · ${vendor}` : ''} / ${modelId}`,
availableThinkingLevels: availableThinkingLevels(account, modelId),
...(account.id === 'niancode-user-models' ? { managedCapability:
account.metadata?.worksSquareModelCapabilitiesV2?.models[modelId] ?? unknownManagedModelCapability() } : {}),
});
}
}