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

@ -40,13 +40,24 @@ export const Ref = Schema.Struct({
})
export type Ref = typeof Ref.Type
export const Api = Schema.Union([
Schema.Struct({
id: ID,
...ProviderV2.AISDK.fields,
}),
Schema.Struct({
id: ID,
...ProviderV2.Native.fields,
}),
]).pipe(Schema.toTaggedUnion("type"))
export type Api = typeof Api.Type
export class Info extends Schema.Class<Info>("ModelV2.Info")({
id: ID,
apiID: ID,
providerID: ProviderV2.ID,
family: Family.pipe(Schema.optional),
name: Schema.String,
api: ProviderV2.Api,
api: Api,
capabilities: Capabilities,
request: Schema.Struct({
...ProviderV2.Request.fields,
@ -71,10 +82,10 @@ export class Info extends Schema.Class<Info>("ModelV2.Info")({
static empty(providerID: ProviderV2.ID, modelID: ID): Info {
return new Info({
id: modelID,
apiID: modelID,
providerID,
name: modelID,
api: {
id: modelID,
type: "native",
settings: {},
},