summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-09-13 22:12:36 +0800
committerGitHub <noreply@github.com>2024-09-13 22:12:36 +0800
commit5a26c59a12e25cc96c6eb44c64395e673207135c (patch)
treecb585d8808797ddfe2e36429103773f48e3b5ef7 /src/main.rs
parent0fb403a2e9bcf5b2e0bc66c96778eba5a0cc3b2f (diff)
downloadaichat-5a26c59a12e25cc96c6eb44c64395e673207135c.tar.gz
refactor: role/session/agent should not inherit the global `use_tools` (#868)
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 485b05d..b4b76b6 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -233,6 +233,9 @@ async fn shell_execute(config: &GlobalConfig, shell: &Shell, mut input: Input) -
config
.write()
.after_chat_completion(&input, &eval_str, &[])?;
+ if eval_str.is_empty() {
+ bail!("No command generated");
+ }
if config.read().dry_run {
config.read().print_markdown(&eval_str)?;
return Ok(());