Use Role::System for agent step prompts
Step prompts in oneshot agents are instructions, not user messages — use system_msg instead of user_msg. Co-Authored-By: ProofOfConcept <poc@bcachefs.org>
This commit is contained in:
parent
58cec97e57
commit
1aa60552bc
1 changed files with 4 additions and 4 deletions
|
|
@ -193,7 +193,7 @@ impl AutoAgent {
|
|||
|
||||
if next_step < self.steps.len() {
|
||||
backend.push_node(
|
||||
AstNode::user_msg(&self.steps[next_step].prompt)).await;
|
||||
AstNode::system_msg(&self.steps[next_step].prompt)).await;
|
||||
next_step += 1;
|
||||
}
|
||||
|
||||
|
|
@ -218,8 +218,8 @@ impl AutoAgent {
|
|||
let text = result.text;
|
||||
if text.is_empty() {
|
||||
dbglog!("[auto] {} empty response, retrying", self.name);
|
||||
backend.push_node(AstNode::user_msg(
|
||||
"[system] Your previous response was empty. \
|
||||
backend.push_node(AstNode::system_msg(
|
||||
"Your previous response was empty. \
|
||||
Please respond with text or use a tool."
|
||||
)).await;
|
||||
continue;
|
||||
|
|
@ -234,7 +234,7 @@ impl AutoAgent {
|
|||
}
|
||||
self.current_phase = self.steps[next_step].phase.clone();
|
||||
backend.push_node(
|
||||
AstNode::user_msg(&self.steps[next_step].prompt)).await;
|
||||
AstNode::system_msg(&self.steps[next_step].prompt)).await;
|
||||
next_step += 1;
|
||||
dbglog!("[auto] {} step {}/{}",
|
||||
self.name, next_step, self.steps.len());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue