diff options
| author | sigoden <sigoden@gmail.com> | 2025-06-28 19:26:42 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-28 19:26:42 +0800 |
| commit | b8fd84ae5a094737cdc3276bea1cc0c83dbecd81 (patch) | |
| tree | 58e5e076caab69a8c6c98a1a47c01fa32b1d8b92 /src/config/agent.rs | |
| parent | 419790fb74fbaf47d54519238b5a542a3875961e (diff) | |
| download | aichat-b8fd84ae5a094737cdc3276bea1cc0c83dbecd81.tar.gz | |
fix: change temperature/top_p reading rules (#1333)
Diffstat (limited to 'src/config/agent.rs')
| -rw-r--r-- | src/config/agent.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/config/agent.rs b/src/config/agent.rs index f535d32..fada1f7 100644 --- a/src/config/agent.rs +++ b/src/config/agent.rs @@ -62,7 +62,15 @@ impl Agent { let config = config.read(); match agent_config.model_id.as_ref() { Some(model_id) => Model::retrieve_model(&config, model_id, ModelType::Chat)?, - None => config.current_model().clone(), + None => { + if agent_config.temperature.is_none() { + agent_config.temperature = config.temperature; + } + if agent_config.top_p.is_none() { + agent_config.top_p = config.top_p; + } + config.current_model().clone() + } } }; |
