mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-08-07 07:25:58 +00:00
cli : persist reasoning_content in chat history (#26362)
* cli : persist reasoning_content in chat history llama-cli collected reasoning from the stream for display but only stored assistant content in messages, so --reasoning-preserve could not re-inject prior thoughts on later turns.
This commit is contained in:
parent
de699957b9
commit
c629da565c
1 changed files with 6 additions and 2 deletions
|
|
@ -624,10 +624,14 @@ int cli_context::run() {
|
|||
generated_content content;
|
||||
generate_completion(content, timings);
|
||||
|
||||
impl->messages.push_back({
|
||||
json assistant_msg = {
|
||||
{"role", "assistant"},
|
||||
{"content", content.content}
|
||||
});
|
||||
};
|
||||
if (!content.reasoning.empty()) {
|
||||
assistant_msg["reasoning_content"] = content.reasoning;
|
||||
}
|
||||
impl->messages.push_back(std::move(assistant_msg));
|
||||
|
||||
if (output_file) {
|
||||
std::string out_content = "Assistant:\n";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue