RolePlayingTemplate
Models & Types ยท AiDotNet.PromptEngineering.Templates
Template that creates persona-based prompts for role-playing scenarios.
Inheritance: PromptTemplateBase โ RolePlayingTemplate
For Beginners
Makes the AI adopt a specific character or expert role.
Example:
Benefits:
- Consistent expertise level in responses
- Domain-specific language and knowledge
- Appropriate communication style
- Better task-relevant responses
How It Works
This template helps models adopt specific personas, expertise levels, and communication styles for more targeted and consistent responses.
Constructors
| Constructor | Summary |
|---|---|
RolePlayingTemplate(string role, IEnumerable<string> expertise, string personality, string constraints) |
Initializes a new instance of the RolePlayingTemplate class. |
RolePlayingTemplate(string template) |
Initializes a new instance with a custom template string. |
Methods
| Method | Summary |
|---|---|
RolePlayingBuilder Builder() |
Creates a builder for constructing role-playing templates. |
RolePlayingTemplate BusinessAnalyst(string industry) |
Creates a business analyst persona. |
RolePlayingTemplate CodeReviewer(string[] languages) |
Creates a code reviewer persona. |
RolePlayingTemplate CreativeWriter(string style) |
Creates a creative writer persona. |
RolePlayingTemplate Teacher(string subject, string studentLevel) |
Creates a teacher/educator persona. |
RolePlayingTemplate TechnicalExpert(string domain, string seniorityLevel) |
Creates a technical expert persona. |
RolePlayingTemplate WithTask(string task) |
Sets the task for the persona to perform. |