interrupt_decision_prompt_template = (
listener,
speaker,
last_speech,
chat_history
) => {
const final_prompt =
common_leading_prompt(
listener,
speaker,
chat_history,
`\n${speaker.name}: ${last_speech}`
) +
(interruption_state[speaker.id].type != 0
? additional_context_template(listener, speaker)
: "") +
`
# Task
` +
(interruption_state[speaker.id].type != 0
? `1. Privately assess (do not output) whether ${speaker.name}'s interruption is logically or contextually relevant to your current unspoken statement.
- If relevant or justified, your next response should reflect positivity or acceptance toward the interruption.
- If irrelevant or unjustified, your next response may indicate disagreement or attempt to clarify your original intention.
2. Decide if you want to interrupt this speech **immediately** based on this assessment.
- The interruption from ${speaker.name} may not have finished. If it remains unclear, it is better to keep listening until you understand the ${speaker.name}'s intent.
3. `
: `1. Decide if you want to interrupt this speech **immediately**.
- ${speaker.name}'s latest speech may not have finished. If it remains unclear, it is better to keep listening until you understand the ${speaker.name}'s intent.
2. `) +
`Return your decision in **valid JSON** with the following structure:
{
"type": 0|1,
"text": "..."
}
Where:
- "type" must be one of:
- 0 = Do NOT interrupt (continue listening)
- 1 = Interrupt because of strong empathy, strong disagreement, or a sudden impulse
- "text" must be the actual interruption statement matching your private assessment, written:
- From a first-person perspective
- In your own natural language
- Consistent with your background and disposition
# Important
**Your entire response MUST consist of the single JSON object only. Do not add any extra text, punctuation, or commentary outside of it.**
`;
return final_prompt;
}