feat: first time automated ollama install experience and openrouter (#3881)
Co-authored-by: Zane Staggs <zane@squareup.com>
This commit is contained in:
@@ -14,7 +14,7 @@ use tokio::sync::oneshot;
|
||||
use tokio::time::timeout;
|
||||
|
||||
/// Default models for openrouter config configuration
|
||||
const OPENROUTER_DEFAULT_MODEL: &str = "qwen/qwen3-coder";
|
||||
const OPENROUTER_DEFAULT_MODEL: &str = "anthropic/claude-sonnet-4";
|
||||
|
||||
const OPENROUTER_AUTH_URL: &str = "https://openrouter.ai/auth";
|
||||
const OPENROUTER_TOKEN_URL: &str = "https://openrouter.ai/api/v1/auth/keys";
|
||||
|
||||
@@ -202,6 +202,12 @@ fn create_request_based_on_model(
|
||||
payload = update_request_for_anthropic(&payload);
|
||||
}
|
||||
|
||||
// Always add transforms: ["middle-out"] for OpenRouter to handle prompts > context size
|
||||
payload
|
||||
.as_object_mut()
|
||||
.unwrap()
|
||||
.insert("transforms".to_string(), json!(["middle-out"]));
|
||||
|
||||
Ok(payload)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user