insight-chat: per-turn system_prompt override on chat continuation
Append mode: applied ephemerally — original system message restored before persistence so re-opens see the baked persona. Amend mode: override stays in place and becomes the new insight row's system message. Pattern mirrors annotate_system_with_budget. Adds system_prompt field on both ChatTurnHttpRequest and ChatTurnRequest; plumbs through chat_turn and chat_turn_stream identically. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -640,6 +640,10 @@ pub struct ChatTurnHttpRequest {
|
||||
pub min_p: Option<f32>,
|
||||
#[serde(default)]
|
||||
pub max_iterations: Option<usize>,
|
||||
/// Per-turn system-prompt override. Ephemeral in append mode,
|
||||
/// persisted in amend mode. See ChatTurnRequest for semantics.
|
||||
#[serde(default)]
|
||||
pub system_prompt: Option<String>,
|
||||
#[serde(default)]
|
||||
pub amend: bool,
|
||||
}
|
||||
@@ -695,6 +699,7 @@ pub async fn chat_turn_handler(
|
||||
top_k: request.top_k,
|
||||
min_p: request.min_p,
|
||||
max_iterations: request.max_iterations,
|
||||
system_prompt: request.system_prompt.clone(),
|
||||
amend: request.amend,
|
||||
};
|
||||
|
||||
@@ -909,6 +914,7 @@ pub async fn chat_stream_handler(
|
||||
top_k: request.top_k,
|
||||
min_p: request.min_p,
|
||||
max_iterations: request.max_iterations,
|
||||
system_prompt: request.system_prompt.clone(),
|
||||
amend: request.amend,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user