mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-06 00:12:11 +00:00
wip: zen lite
This commit is contained in:
parent
d0ce2950e4
commit
e77b2cfd61
9 changed files with 24 additions and 6 deletions
|
|
@ -73,6 +73,7 @@ export namespace ZenData {
|
|||
|
||||
const ModelsSchema = z.object({
|
||||
models: z.record(z.string(), z.union([ModelSchema, z.array(ModelSchema.extend({ formatFilter: FormatSchema }))])),
|
||||
liteModels: z.record(z.string(), ModelSchema),
|
||||
providers: z.record(z.string(), ProviderSchema),
|
||||
providerFamilies: z.record(z.string(), ProviderFamilySchema),
|
||||
})
|
||||
|
|
@ -81,7 +82,7 @@ export namespace ZenData {
|
|||
return input
|
||||
})
|
||||
|
||||
export const list = fn(z.void(), () => {
|
||||
export const list = fn(z.enum(["lite", "full"]), (modelList) => {
|
||||
const json = JSON.parse(
|
||||
Resource.ZEN_MODELS1.value +
|
||||
Resource.ZEN_MODELS2.value +
|
||||
|
|
@ -114,9 +115,9 @@ export namespace ZenData {
|
|||
Resource.ZEN_MODELS29.value +
|
||||
Resource.ZEN_MODELS30.value,
|
||||
)
|
||||
const { models, providers, providerFamilies } = ModelsSchema.parse(json)
|
||||
const { models, liteModels, providers, providerFamilies } = ModelsSchema.parse(json)
|
||||
return {
|
||||
models,
|
||||
models: modelList === "lite" ? liteModels : models,
|
||||
providers: Object.fromEntries(
|
||||
Object.entries(providers).map(([id, provider]) => [
|
||||
id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue