pass through model.options properly without having to nest it under provider name. you may have to update your configs see https://opencode.ai/docs/models/#openrouter for an example

This commit is contained in:
Dax Raad
2025-07-19 12:40:28 -04:00
parent 2b44dbdbf1
commit 86d5b25d18
4 changed files with 66 additions and 3 deletions

View File

@@ -367,7 +367,10 @@ export namespace Provider {
const pkg = provider.npm ?? provider.id
const mod = await import(await BunProc.install(pkg, "beta"))
const fn = mod[Object.keys(mod).find((key) => key.startsWith("create"))!]
const loaded = fn(s.providers[provider.id]?.options)
const loaded = fn({
name: provider.id,
...s.providers[provider.id]?.options,
})
s.sdk.set(provider.id, loaded)
return loaded as SDK
})().catch((e) => {