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
28
28
# provider_api_key: sk-xxxxxxxxxxxxxxxxxxxxx
29
29
# provider_base_url: http://127.0.0.1:1234/v1
30
30
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
+
31
39
# ---------------------------------------
32
40
# Permission mode
33
41
# ---------------------------------------
Original file line number Diff line number Diff line change @@ -327,6 +327,9 @@ impl Agent {
327
327
M : CompletionModel ,
328
328
{
329
329
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
+ }
330
333
let mut system_prompt = context. system_prompt . clone ( ) ;
331
334
let mcp_config = context. config . mcp . as_ref ( ) ;
332
335
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 {
87
87
pub provider : ProviderKind ,
88
88
pub provider_api_key : Option < String > ,
89
89
pub provider_base_url : Option < String > ,
90
+ pub provider_config : Option < serde_json:: Value > ,
90
91
pub model : String ,
91
92
pub permission_mode : PermissionMode ,
92
93
pub workspace : PathBuf ,
You can’t perform that action at this time.
0 commit comments