refactor(core): remove ai sdk option fields (#30581)
This commit is contained in:
parent
7f8412ec3e
commit
1520b0de20
57 changed files with 825 additions and 686 deletions
|
|
@ -13,11 +13,11 @@ export const OpencodePlugin = PluginV2.define({
|
|||
hasKey = Boolean(
|
||||
process.env.OPENCODE_API_KEY ||
|
||||
item.provider.env.some((env) => process.env[env]) ||
|
||||
item.provider.options.aisdk.provider.apiKey ||
|
||||
item.provider.request.body.apiKey ||
|
||||
(item.provider.enabled && item.provider.enabled.via === "account"),
|
||||
)
|
||||
evt.provider.update(item.provider.id, (provider) => {
|
||||
if (!hasKey) provider.options.aisdk.provider.apiKey = "public"
|
||||
if (!hasKey) provider.request.body.apiKey = "public"
|
||||
})
|
||||
if (hasKey) return
|
||||
for (const model of item.models.values()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue