ignore: fix typecheck in dev (#20702)

This commit is contained in:
Aiden Cline
2026-04-02 15:38:30 +00:00
committed by GitHub
parent 159ede2d5c
commit 510a1e8140
6 changed files with 72 additions and 71 deletions
+11 -60
View File
@@ -730,58 +730,14 @@ export namespace Config {
}) })
export type Layout = z.infer<typeof Layout> export type Layout = z.infer<typeof Layout>
export const Model = z export const Provider = ModelsDev.Provider.partial()
.object({ .extend({
id: z.string(), whitelist: z.array(z.string()).optional(),
name: z.string(), blacklist: z.array(z.string()).optional(),
family: z.string().optional(), models: z
release_date: z.string(), .record(
attachment: z.boolean(), z.string(),
reasoning: z.boolean(), ModelsDev.Model.partial().extend({
temperature: z.boolean(),
tool_call: z.boolean(),
interleaved: z
.union([
z.literal(true),
z
.object({
field: z.enum(["reasoning_content", "reasoning_details"]),
})
.strict(),
])
.optional(),
cost: z
.object({
input: z.number(),
output: z.number(),
cache_read: z.number().optional(),
cache_write: z.number().optional(),
context_over_200k: z
.object({
input: z.number(),
output: z.number(),
cache_read: z.number().optional(),
cache_write: z.number().optional(),
})
.optional(),
})
.optional(),
limit: z.object({
context: z.number(),
input: z.number().optional(),
output: z.number(),
}),
modalities: z
.object({
input: z.array(z.enum(["text", "audio", "image", "video", "pdf"])),
output: z.array(z.enum(["text", "audio", "image", "video", "pdf"])),
})
.optional(),
experimental: z.boolean().optional(),
status: z.enum(["alpha", "beta", "deprecated"]).optional(),
options: z.record(z.string(), z.any()),
headers: z.record(z.string(), z.string()).optional(),
provider: z.object({ npm: z.string().optional(), api: z.string().optional() }).optional(),
variants: z variants: z
.record( .record(
z.string(), z.string(),
@@ -793,14 +749,9 @@ export namespace Config {
) )
.optional() .optional()
.describe("Variant-specific configuration"), .describe("Variant-specific configuration"),
}) }),
.partial() )
.optional(),
export const Provider = ModelsDev.Provider.partial()
.extend({
whitelist: z.array(z.string()).optional(),
blacklist: z.array(z.string()).optional(),
models: z.record(z.string(), Model).optional(),
options: z options: z
.object({ .object({
apiKey: z.string().optional(), apiKey: z.string().optional(),
+4
View File
@@ -61,8 +61,12 @@ export namespace ModelsDev {
output: z.array(z.enum(["text", "audio", "image", "video", "pdf"])), output: z.array(z.enum(["text", "audio", "image", "video", "pdf"])),
}) })
.optional(), .optional(),
experimental: z.boolean().optional(),
status: z.enum(["alpha", "beta", "deprecated"]).optional(), status: z.enum(["alpha", "beta", "deprecated"]).optional(),
options: z.record(z.string(), z.any()),
headers: z.record(z.string(), z.string()).optional(),
provider: z.object({ npm: z.string().optional(), api: z.string().optional() }).optional(), provider: z.object({ npm: z.string().optional(), api: z.string().optional() }).optional(),
variants: z.record(z.string(), z.record(z.string(), z.any())).optional(),
}) })
export type Model = z.infer<typeof Model> export type Model = z.infer<typeof Model>
+2 -2
View File
@@ -903,8 +903,8 @@ export namespace Provider {
npm: model.provider?.npm ?? provider.npm ?? "@ai-sdk/openai-compatible", npm: model.provider?.npm ?? provider.npm ?? "@ai-sdk/openai-compatible",
}, },
status: model.status ?? "active", status: model.status ?? "active",
headers: {}, headers: model.headers ?? {},
options: {}, options: model.options ?? {},
cost: { cost: {
input: model.cost?.input ?? 0, input: model.cost?.input ?? 0,
output: model.cost?.output ?? 0, output: model.cost?.output ?? 0,
+2 -1
View File
@@ -1,6 +1,7 @@
import { Provider } from "@/provider/provider" import { Provider } from "@/provider/provider"
import { Log } from "@/util/log" import { Log } from "@/util/log"
import { Effect, Layer, Record, ServiceMap } from "effect" import { Cause, Effect, Layer, Record, ServiceMap } from "effect"
import * as Queue from "effect/Queue"
import * as Stream from "effect/Stream" import * as Stream from "effect/Stream"
import { streamText, wrapLanguageModel, type ModelMessage, type Tool, tool, jsonSchema } from "ai" import { streamText, wrapLanguageModel, type ModelMessage, type Tool, tool, jsonSchema } from "ai"
import { mergeDeep, pipe } from "remeda" import { mergeDeep, pipe } from "remeda"
+12
View File
@@ -4168,11 +4168,23 @@ export type ProviderListResponses = {
input: Array<"text" | "audio" | "image" | "video" | "pdf"> input: Array<"text" | "audio" | "image" | "video" | "pdf">
output: Array<"text" | "audio" | "image" | "video" | "pdf"> output: Array<"text" | "audio" | "image" | "video" | "pdf">
} }
experimental?: boolean
status?: "alpha" | "beta" | "deprecated" status?: "alpha" | "beta" | "deprecated"
options: {
[key: string]: unknown
}
headers?: {
[key: string]: string
}
provider?: { provider?: {
npm?: string npm?: string
api?: string api?: string
} }
variants?: {
[key: string]: {
[key: string]: unknown
}
}
} }
} }
}> }>
+34 -1
View File
@@ -4744,10 +4744,29 @@
}, },
"required": ["input", "output"] "required": ["input", "output"]
}, },
"experimental": {
"type": "boolean"
},
"status": { "status": {
"type": "string", "type": "string",
"enum": ["alpha", "beta", "deprecated"] "enum": ["alpha", "beta", "deprecated"]
}, },
"options": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
},
"headers": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "string"
}
},
"provider": { "provider": {
"type": "object", "type": "object",
"properties": { "properties": {
@@ -4758,6 +4777,19 @@
"type": "string" "type": "string"
} }
} }
},
"variants": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
} }
}, },
"required": [ "required": [
@@ -4768,7 +4800,8 @@
"reasoning", "reasoning",
"temperature", "temperature",
"tool_call", "tool_call",
"limit" "limit",
"options"
] ]
} }
} }