Skip to content

Commit 79cfa82

Browse files
authored
Merge pull request #4 from XTerminalApp/fix-axec-path
Remove config CLI option and clean up unused code
2 parents 8f02501 + 8d645e9 commit 79cfa82

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/cli.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ pub const fn default_stream() -> bool {
2828
#[command(author, version, about, long_about = None)]
2929
pub 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}"));

src/llm/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)