InstructionFollowingTemplate

Models & Types ยท AiDotNet.PromptEngineering.Templates

Template optimized for clear, structured instruction-following tasks.

Inheritance: PromptTemplateBase โ†’ InstructionFollowingTemplate

For Beginners

Structures instructions for clear AI execution.

Example:

Benefits:

  • Clear separation of objective, steps, and constraints
  • Numbered instructions for sequential execution
  • Explicit constraints prevent unwanted behavior
  • Input/output sections clearly marked

How It Works

This template provides a clear structure for instructions, context, and constraints, helping models understand and follow complex multi-step instructions accurately.

Constructors

Constructor Summary
InstructionFollowingTemplate() Initializes a new instance of the InstructionFollowingTemplate class.
InstructionFollowingTemplate(string template) Initializes a new instance with a custom template string.

Methods

Method Summary
InstructionFollowingBuilder Builder() Creates a builder for constructing instruction-following templates.
InstructionFollowingTemplate AddConstraint(string constraint) Adds a constraint.
InstructionFollowingTemplate AddConstraints(string[] constraints) Adds multiple constraints.
InstructionFollowingTemplate AddInstruction(string instruction) Adds an instruction step.
InstructionFollowingTemplate AddInstructions(string[] instructions) Adds multiple instruction steps.
InstructionFollowingTemplate Classification(string[] categories) Creates a classification template.
InstructionFollowingTemplate QuestionAnswering() Creates a question-answering template.
InstructionFollowingTemplate Summarization(int maxLength) Creates a summarization template.
InstructionFollowingTemplate Translation(string targetLanguage) Creates a translation template.
InstructionFollowingTemplate WithInputDescription(string description) Sets the input description.
InstructionFollowingTemplate WithObjective(string objective) Sets the objective for the task.
InstructionFollowingTemplate WithOutputDescription(string description) Sets the output description.