diff options
| author | opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> | 2026-04-16 01:45:44 +0000 |
|---|---|---|
| committer | opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> | 2026-04-16 01:45:44 +0000 |
| commit | 7baf998752f0cd1df0ff818d1cd5587e27f8d721 (patch) | |
| tree | f94ec8354ceddf932bd776b91df28de2b057df1f | |
| parent | 1d81335ab5c7e4f3a4c0652c9c7d59240028fe9f (diff) | |
| download | opencode-7baf998752f0cd1df0ff818d1cd5587e27f8d721.tar.gz opencode-7baf998752f0cd1df0ff818d1cd5587e27f8d721.zip | |
chore: generate
| -rw-r--r-- | packages/opencode/src/provider/provider.ts | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/packages/opencode/src/provider/provider.ts b/packages/opencode/src/provider/provider.ts index 36a5a68e9..fed4d9358 100644 --- a/packages/opencode/src/provider/provider.ts +++ b/packages/opencode/src/provider/provider.ts @@ -454,8 +454,7 @@ function custom(dep: CustomDep): Record<string, CustomLoader> { return { autoload: true, vars(_options: Record<string, any>) { - const endpoint = - location === "global" ? "aiplatform.googleapis.com" : `${location}-aiplatform.googleapis.com` + const endpoint = location === "global" ? "aiplatform.googleapis.com" : `${location}-aiplatform.googleapis.com` return { ...(project && { GOOGLE_VERTEX_PROJECT: project }), GOOGLE_VERTEX_LOCATION: location, @@ -1136,12 +1135,9 @@ const layer: Layer.Layer< toolcall: model.tool_call ?? existingModel?.capabilities.toolcall ?? true, input: { text: model.modalities?.input?.includes("text") ?? existingModel?.capabilities.input.text ?? true, - audio: - model.modalities?.input?.includes("audio") ?? existingModel?.capabilities.input.audio ?? false, - image: - model.modalities?.input?.includes("image") ?? existingModel?.capabilities.input.image ?? false, - video: - model.modalities?.input?.includes("video") ?? existingModel?.capabilities.input.video ?? false, + audio: model.modalities?.input?.includes("audio") ?? existingModel?.capabilities.input.audio ?? false, + image: model.modalities?.input?.includes("image") ?? existingModel?.capabilities.input.image ?? false, + video: model.modalities?.input?.includes("video") ?? existingModel?.capabilities.input.video ?? false, pdf: model.modalities?.input?.includes("pdf") ?? existingModel?.capabilities.input.pdf ?? false, }, output: { @@ -1246,9 +1242,7 @@ const layer: Layer.Layer< if (result.vars) varsLoaders[providerID] = result.vars if (result.discoverModels) discoveryLoaders[providerID] = result.discoverModels const opts = result.options ?? {} - const patch: Partial<Info> = providers[providerID] - ? { options: opts } - : { source: "custom", options: opts } + const patch: Partial<Info> = providers[providerID] ? { options: opts } : { source: "custom", options: opts } mergeProvider(providerID, patch) } } @@ -1424,8 +1418,7 @@ const layer: Layer.Layer< options["fetch"] = async (input: any, init?: BunFetchRequestInit) => { const fetchFn = customFetch ?? fetch const opts = init ?? {} - const chunkAbortCtl = - typeof chunkTimeout === "number" && chunkTimeout > 0 ? new AbortController() : undefined + const chunkAbortCtl = typeof chunkTimeout === "number" && chunkTimeout > 0 ? new AbortController() : undefined const signals: AbortSignal[] = [] if (opts.signal) signals.push(opts.signal) @@ -1646,9 +1639,7 @@ const layer: Layer.Layer< return { providerID: entry.providerID, modelID: entry.modelID } } - const provider = Object.values(s.providers).find( - (p) => !cfg.provider || Object.keys(cfg.provider).includes(p.id), - ) + const provider = Object.values(s.providers).find((p) => !cfg.provider || Object.keys(cfg.provider).includes(p.id)) if (!provider) throw new Error("no providers found") const [model] = sort(Object.values(provider.models)) if (!model) throw new Error("no models found") |
