File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,14 @@ model: anthropic/claude-3.5-sonnet
2828# provider_api_key: sk-xxxxxxxxxxxxxxxxxxxxx
2929# provider_base_url: http://127.0.0.1:1234/v1
3030
31+ # Advanced provider configuration (optional)
32+ # For example, you can configure openrouter provider routing configuration(https://openrouter.ai/docs/features/provider-routing) as follows:
33+ # provider_config:
34+ # provider:
35+ # order: [ "openai", "together"]
36+ # allow_fallbacks: false
37+
38+
3139# ---------------------------------------
3240# Permission mode
3341# ---------------------------------------
Original file line number Diff line number Diff line change @@ -327,6 +327,9 @@ impl Agent {
327327 M : CompletionModel ,
328328 {
329329 agent_builder = agent_builder. temperature ( 0.0 ) ;
330+ if let Some ( config) = & context. config . provider_config {
331+ agent_builder = agent_builder. additional_params ( config. clone ( ) ) ;
332+ }
330333 let mut system_prompt = context. system_prompt . clone ( ) ;
331334 let mcp_config = context. config . mcp . as_ref ( ) ;
332335 agent_builder = Self :: add_static_tools ( agent_builder, context) ;
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ pub struct Config {
8787 pub provider : ProviderKind ,
8888 pub provider_api_key : Option < String > ,
8989 pub provider_base_url : Option < String > ,
90+ pub provider_config : Option < serde_json:: Value > ,
9091 pub model : String ,
9192 pub permission_mode : PermissionMode ,
9293 pub workspace : PathBuf ,
You can’t perform that action at this time.
0 commit comments