ChainOfThoughtTemplate

Models & Types ยท AiDotNet.PromptEngineering.Templates

Template that structures prompts for chain-of-thought reasoning.

Inheritance: PromptTemplateBase โ†’ ChainOfThoughtTemplate

For Beginners

Helps AI think through problems step by step.

Example:

How it works:

  • Structures the prompt to encourage step-by-step thinking
  • Includes explicit instructions for showing reasoning
  • Helps with math, logic, and complex analysis tasks

How It Works

This template encourages the model to show its reasoning process step by step, which often leads to better accuracy on complex tasks.

Constructors

Constructor Summary
ChainOfThoughtTemplate(string question, IEnumerable<ChainOfThoughtExample> examples, string context) Initializes a new instance with examples for few-shot chain-of-thought.
ChainOfThoughtTemplate(string question, string context) Initializes a new instance of the ChainOfThoughtTemplate class.
ChainOfThoughtTemplate(string template) Initializes a new instance with a custom template.

Methods

Method Summary
ChainOfThoughtBuilder Builder() Creates a builder for constructing chain-of-thought prompts.