refactor(core): nest model api id (#30603)

This commit is contained in:
Dax 2026-06-03 14:11:38 -04:00 committed by GitHub
commit 11dbd15812
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 129 additions and 79 deletions

View file

@ -205,12 +205,19 @@ function migrateModel(info: typeof ConfigProviderV1.Model.Type, packageName?: st
: undefined
const lowerer = ConfigProviderOptionsV1.get(info.provider?.npm ?? packageName)
return {
api_id: info.id,
family: info.family,
name: info.name,
api: info.provider?.npm
? { type: "aisdk" as const, package: info.provider.npm, url: info.provider.api, settings: {} }
: undefined,
? {
...(info.id === undefined ? {} : { id: info.id }),
type: "aisdk" as const,
package: info.provider.npm,
url: info.provider.api,
settings: {},
}
: info.id === undefined
? undefined
: { id: info.id },
capabilities,
request: (info.headers || info.options) && {
headers: info.headers,