diff options
| author | sigoden <sigoden@gmail.com> | 2024-12-01 11:35:12 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-01 11:35:12 +0800 |
| commit | 6b6413b02df588faf6557053751b7e9c591539f7 (patch) | |
| tree | 4f76e1a0eae6a4f762b24bae559167f8883bdf77 /src/main.rs | |
| parent | 7e8e2a6ce6d96ffa31c202ead6f31f18dc73c618 (diff) | |
| download | aichat-6b6413b02df588faf6557053751b7e9c591539f7.tar.gz | |
feat: add cli option `--agent-variable <name> <value>` (#1027)
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 2cefaf3..77b72c2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -65,7 +65,7 @@ async fn run(config: GlobalConfig, cli: Cli, text: Option<String>) -> Result<()> return serve::run(config, addr).await; } if cli.info { - config.write().print_info_only = true; + config.write().cli_info_flag = true; } if cli.list_models { @@ -98,6 +98,15 @@ async fn run(config: GlobalConfig, cli: Cli, text: Option<String>) -> Result<()> Some(v) => v.as_str(), None => TEMP_SESSION_NAME, }); + if !cli.agent_variable.is_empty() { + config.write().cli_agent_variables = Some( + cli.agent_variable + .chunks(2) + .map(|v| (v[0].to_string(), v[1].to_string())) + .collect(), + ); + } + Config::use_agent(&config, agent, session, abort_signal.clone()).await? } else { if let Some(prompt) = &cli.prompt { |
