constCHECK_PROMPT=`Analyze *only* the content and structure of your immediately preceding response (your last turn in the conversation history). Based *strictly* on that response, determine who should logically speak next: the 'user' or the 'model' (you).
**DecisionRules(applyinorder):**
1.**ModelContinues:**Ifyourlastresponseexplicitlystatesanimmediatenextaction*you*intendtotake(e.g.,"Next, I will...","Now I'll process...","Moving on to analyze...",indicatesanintendedtoolcallthatdidn't execute), OR if the response seems clearly incomplete (cut off mid-thought without a natural conclusion), then the **'model'**shouldspeaknext.
"description":"Brief explanation justifying the 'next_speaker' choice based *strictly* on the applicable rule and the content/structure of the preceding turn."
},
"next_speaker":{
"type":"string",
"enum":["user","model"],
"description":"Who should speak next based *only* on the preceding turn and the decision rules."
}
},
"required":["next_speaker","reasoning"]
}
\`\`\`
`;
constRESPONSE_SCHEMA: SchemaUnion={
type:Type.OBJECT,
properties:{
reasoning:{
type:Type.STRING,
description:
"Brief explanation justifying the 'next_speaker' choice based *strictly* on the applicable rule and the content/structure of the preceding turn.",
},
next_speaker:{
type:Type.STRING,
enum:['user','model'],
description:
'Who should speak next based *only* on the preceding turn and the decision rules',