This commit is contained in:
parent
198955285e
commit
4856cfbfc4
@ -75,18 +75,31 @@ export class TauriProvidersService extends DefaultProvidersService {
|
|||||||
}) as ProviderSetting[],
|
}) as ProviderSetting[],
|
||||||
models: await Promise.all(
|
models: await Promise.all(
|
||||||
models.map(
|
models.map(
|
||||||
async (model) =>
|
async (model) => {
|
||||||
({
|
let capabilities: string[] = []
|
||||||
|
|
||||||
|
// Check for capabilities
|
||||||
|
if ('capabilities' in model) {
|
||||||
|
capabilities = model.capabilities as string[]
|
||||||
|
} else {
|
||||||
|
// Try to check tool support, but don't let failures block the model
|
||||||
|
try {
|
||||||
|
const toolSupported = await value.isToolSupported(model.id)
|
||||||
|
if (toolSupported) {
|
||||||
|
capabilities = [ModelCapabilities.TOOLS]
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.warn(`Failed to check tool support for model ${model.id}:`, error)
|
||||||
|
// Continue without tool capabilities if check fails
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
id: model.id,
|
id: model.id,
|
||||||
model: model.id,
|
model: model.id,
|
||||||
name: model.name,
|
name: model.name,
|
||||||
description: model.description,
|
description: model.description,
|
||||||
capabilities:
|
capabilities,
|
||||||
'capabilities' in model
|
|
||||||
? (model.capabilities as string[])
|
|
||||||
: (await value.isToolSupported(model.id))
|
|
||||||
? [ModelCapabilities.TOOLS]
|
|
||||||
: [],
|
|
||||||
provider: providerName,
|
provider: providerName,
|
||||||
settings: Object.values(modelSettings).reduce(
|
settings: Object.values(modelSettings).reduce(
|
||||||
(acc, setting) => {
|
(acc, setting) => {
|
||||||
@ -105,7 +118,8 @@ export class TauriProvidersService extends DefaultProvidersService {
|
|||||||
},
|
},
|
||||||
{} as Record<string, ProviderSetting>
|
{} as Record<string, ProviderSetting>
|
||||||
),
|
),
|
||||||
}) as Model
|
} as Model
|
||||||
|
}
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user