Interface CoTPromptScope


public interface CoTPromptScope
A common set of context variables and helper functions are available when using templates for CoTTask.prompt, CoTProcess.optionalPrompts entries, and CoTTask.taskPrompt.

Context variables

The following objects/values are always available to template expressions:
  • task — the current CoTTask instance (ID, title, description, etc)
  • process — the owning CoTProcess instance (ID, policies, etc)
  • goal — equivalent to process.goal
  • state — the shared CoTProcess.state object for the workflow
  • inputs — inputs to this task if specified as task.inputs; the same data returned by Task.getInputRecord() (may be absent if inputs were not defined)

Helper functions

  • json(x) — render a compact JSON representation of x suitable for inclusion in a prompt (intended for small/medium objects).
  • promptPart(nameOrNames, omitNewlines?) / prt(...) — insert one or more prompt parts as returned by CoTProcess.getPromptPart().

State Variables in Partial Prompts

When generating partial prompts, state variables can be omitted via PartialPromptConfig.omitStateVars. Specify variable names without the "state." prefix, e.g., ["eventStream"] replaces ${state.eventStream} references with [state.eventStream omitted].