File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -77,14 +77,18 @@ impl AiConfig {
7777 match model {
7878 m if m. starts_with ( "gpt" ) => {
7979 if let Some ( openai) = self . openai . as_ref ( ) {
80- Ok ( openai. clone ( ) )
80+ let mut config = openai. clone ( ) ;
81+ config. model = Some ( m) ;
82+ Ok ( config)
8183 } else {
8284 Ok ( ModelConfig :: default ( ) )
8385 }
8486 }
8587 m if m. starts_with ( "claude" ) => {
86- if let Some ( anthropic) = self . openai . as_ref ( ) {
87- Ok ( anthropic. clone ( ) )
88+ if let Some ( anthropic) = self . anthropic . as_ref ( ) {
89+ let mut config = anthropic. clone ( ) ;
90+ config. model = Some ( m) ;
91+ Ok ( config)
8892 } else {
8993 Ok ( ModelConfig {
9094 api_key : env:: var ( "CLAUDE_API_KEY" )
@@ -96,7 +100,9 @@ impl AiConfig {
96100 }
97101 m if m. starts_with ( "deepseek" ) => {
98102 if let Some ( deepseek) = self . deepseek . as_ref ( ) {
99- Ok ( deepseek. clone ( ) )
103+ let mut config = deepseek. clone ( ) ;
104+ config. model = Some ( m) ;
105+ Ok ( config)
100106 } else {
101107 Ok ( ModelConfig {
102108 api_key : env:: var ( "DEEPSEEK_API_KEY" )
Original file line number Diff line number Diff line change 11let a = prompt {
22 input: "What is rust?",
3- model: "claude-3-5 -sonnet-latest"
3+ model: "claude-3-7 -sonnet-latest"
44};
55print(a);
You can’t perform that action at this time.
0 commit comments