@deepagents/context 0.29.1 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3922,6 +3922,21 @@ function reasoningFramework() {
3922
3922
  )
3923
3923
  ];
3924
3924
  }
3925
+ var DEFAULT_SELF_CRITIQUE_CHECKS = [
3926
+ "Did I answer the user's intent, not just their literal words?",
3927
+ "Is every claim grounded in the provided context, schema, or data?",
3928
+ "Did I follow the requested output format and constraints?"
3929
+ ];
3930
+ function selfCritique(checks = DEFAULT_SELF_CRITIQUE_CHECKS) {
3931
+ return workflow({
3932
+ task: "Self-critique before returning final response",
3933
+ steps: [
3934
+ "Before returning your final response, review your generated output against the user's original constraints:",
3935
+ ...checks.map((check, i) => `${i + 1}. ${check}`),
3936
+ "If any check fails, revise your response before returning it."
3937
+ ]
3938
+ });
3939
+ }
3925
3940
 
3926
3941
  // packages/context/src/lib/guardrails/error-recovery.guardrail.ts
3927
3942
  import chalk2 from "chalk";
@@ -7422,6 +7437,7 @@ export {
7422
7437
  resolveReminderText,
7423
7438
  role,
7424
7439
  runGuardrailChain,
7440
+ selfCritique,
7425
7441
  skills,
7426
7442
  skillsReminder,
7427
7443
  soul,