File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ pub const fn default_stream() -> bool {
2828#[ command( author, version, about, long_about = None ) ]
2929pub struct Cli {
3030 /// 可选的配置文件路径
31- #[ arg( short, long, default_value = "axec.toml" ) ]
32- config : String ,
31+ // #[arg(short, long, default_value = "axec.toml")]
32+ // config: String,
3333
3434 // 存储解析后的配置文件
3535 #[ clap( skip) ]
@@ -47,11 +47,11 @@ impl Cli {
4747 }
4848
4949 if !config_path. exists ( ) {
50- fs:: write ( config_path, DEFAULT_CONFIG ) . unwrap ( )
50+ fs:: write ( & config_path, DEFAULT_CONFIG ) . unwrap ( )
5151 }
5252
5353 let config_content =
54- fs:: read_to_string ( & self . config ) . unwrap_or_else ( |e| panic ! ( "fail to read file: {e}" ) ) ;
54+ fs:: read_to_string ( & config_path ) . unwrap_or_else ( |e| panic ! ( "fail to read file: {e}" ) ) ;
5555
5656 self . config_data =
5757 toml:: from_str ( & config_content) . unwrap_or_else ( |e| panic ! ( "config error: {e}" ) ) ;
Original file line number Diff line number Diff line change @@ -127,8 +127,6 @@ pub fn parse_response(
127127 response : anyhow:: Result < blocking:: Response > ,
128128) -> anyhow:: Result < String > {
129129 let json: serde_json:: Value = response?. json ( ) ?;
130- // let text = response.unwrap().text().unwrap();
131- // println!("{text}");
132130 let llm_reply = match model_type {
133131 LLMModel :: DeepSeekChat | LLMModel :: DeepSeekReasoner => {
134132 json[ "choices" ] [ 0 ] [ "message" ] [ "content" ] . as_str ( ) . unwrap ( )
@@ -141,5 +139,4 @@ pub fn parse_response(
141139 }
142140 } ;
143141 Ok ( llm_reply. to_string ( ) )
144- // Ok("()".to_string())
145142}
You can’t perform that action at this time.
0 commit comments