memory: add temperature support to agent defs, update reflect prompt

Thread temperature parameter from agent def header through the API
call chain. Agents can now specify {"temperature": 1.2} in their
JSON header to override the default 0.6.

Also includes Kent's reflect agent prompt iterations.
This commit is contained in:
ProofOfConcept 2026-03-24 20:29:17 -04:00
parent e88df06cd4
commit f086815eaa
7 changed files with 97 additions and 136 deletions

View file

@ -21,7 +21,7 @@ pub(crate) fn call_simple(caller: &str, prompt: &str) -> Result<String, String>
}
};
super::api::call_api_with_tools_sync(caller, prompt, &log)
super::api::call_api_with_tools_sync(caller, prompt, None, &log)
}
/// Call a model using an agent definition's configuration.
@ -30,7 +30,7 @@ pub(crate) fn call_for_def(
prompt: &str,
log: &(dyn Fn(&str) + Sync),
) -> Result<String, String> {
super::api::call_api_with_tools_sync(&def.agent, prompt, log)
super::api::call_api_with_tools_sync(&def.agent, prompt, def.temperature, log)
}
/// Parse a JSON response, handling markdown fences.