feat: opencode console support
This commit is contained in:
@@ -39,6 +39,7 @@ pub enum Shortcut {
|
||||
enum Provider {
|
||||
CloudflareWorkersAi,
|
||||
LiquidAi,
|
||||
OpenCode,
|
||||
OpenRouter,
|
||||
VercelAiGateway,
|
||||
}
|
||||
@@ -63,6 +64,7 @@ impl Shortcut {
|
||||
|
||||
S::M => {
|
||||
vec![
|
||||
(P::OpenCode, "jev-1.13-free".into()),
|
||||
(P::CloudflareWorkersAi, "clef".into()),
|
||||
(P::OpenRouter, "inception/mercury-decide:free".into()),
|
||||
]
|
||||
@@ -116,13 +118,13 @@ pub async fn create_system_one(
|
||||
api_key,
|
||||
}| {
|
||||
Upstream::builder()
|
||||
.url(
|
||||
format!("https://api.cloudflare.com/client/v4/accounts/{account_id}/ai/run/@cf/cloudflare/{model}")
|
||||
.parse()
|
||||
.expect("TODO"),
|
||||
)
|
||||
.api_key(api_key)
|
||||
.build()
|
||||
.url(
|
||||
format!("https://api.cloudflare.com/client/v4/accounts/{account_id}/ai/run/@cf/cloudflare/{model}")
|
||||
.parse()
|
||||
.expect("TODO"),
|
||||
)
|
||||
.api_key(api_key)
|
||||
.build()
|
||||
},
|
||||
)
|
||||
.collect(),
|
||||
@@ -138,6 +140,18 @@ pub async fn create_system_one(
|
||||
.build()
|
||||
})
|
||||
.collect(),
|
||||
Provider::OpenCode => state
|
||||
.app_args
|
||||
.opencode_console_api_key
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|api_key| {
|
||||
Upstream::builder()
|
||||
.url("https://opencode.ai/inference/systemone/v1/systemone".parse().expect("TODO"))
|
||||
.api_key(api_key)
|
||||
.build()
|
||||
})
|
||||
.collect(),
|
||||
Provider::OpenRouter => state
|
||||
.app_args
|
||||
.openrouter_api_key
|
||||
|
||||
Reference in New Issue
Block a user