diff options
| author | sigoden <sigoden@gmail.com> | 2024-03-25 11:13:54 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-25 11:13:54 +0800 |
| commit | 0ebc7955da67b488877cab7929019d40688fb3ed (patch) | |
| tree | e08d1c71a3f12a3470e9518af8828e3d2da40b82 /src/config | |
| parent | eec041c111c0ee170dab65942184e66c41479fcd (diff) | |
| download | aichat-0ebc7955da67b488877cab7929019d40688fb3ed.tar.gz | |
refactor: improve creating config for openai-compatible client (#374)
Diffstat (limited to 'src/config')
| -rw-r--r-- | src/config/mod.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs index b6bc730..bcebdd0 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -1046,8 +1046,9 @@ fn create_config_file(config_path: &Path) -> Result<()> { let client = Select::new("Platform:", list_client_types()).prompt()?; let mut config = serde_json::json!({}); - config["model"] = client.into(); - config[CLIENTS_FIELD] = create_client_config(client)?; + let (model, clients_config) = create_client_config(client)?; + config["model"] = model.into(); + config[CLIENTS_FIELD] = clients_config; let config_data = serde_yaml::to_string(&config).with_context(|| "Failed to create config")?; |
