Skip to content

Commit cea3770

Browse files
authored
feat: 为已配置的模型增加能力图标 (#8405)
1 parent adae1f3 commit cea3770

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

dashboard/src/composables/useProviderSources.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,26 @@ export function useProviderSources(options: UseProviderSourcesOptions) {
134134
})
135135
})
136136

137+
function buildMetadataFromProvider(provider: any) {
138+
if (!provider) return null
139+
const mods = provider.modalities || []
140+
if (!mods.length && !provider.max_context_tokens) return null
141+
const input: string[] = []
142+
if (mods.includes('image')) input.push('image')
143+
if (mods.includes('audio')) input.push('audio')
144+
return {
145+
modalities: { input },
146+
tool_call: mods.includes('tool_use'),
147+
reasoning: Boolean(provider.reasoning),
148+
limit: { context: provider.max_context_tokens || 0 }
149+
}
150+
}
151+
137152
const mergedModelEntries = computed(() => {
138153
const configuredEntries = (sourceProviders.value || []).map((provider: any) => ({
139154
type: 'configured',
140155
provider,
141-
metadata: getModelMetadata(provider.model)
156+
metadata: getModelMetadata(provider.model) || buildMetadataFromProvider(provider)
142157
}))
143158

144159
const availableEntries = (sortedAvailableModels.value || [])
@@ -575,7 +590,8 @@ export function useProviderSources(options: UseProviderSourcesOptions) {
575590
model: modelName,
576591
modalities,
577592
custom_extra_body: {},
578-
max_context_tokens: max_context_tokens
593+
max_context_tokens: max_context_tokens,
594+
reasoning: supportsReasoning(metadata)
579595
}
580596
}
581597

0 commit comments

Comments
 (0)