Prompt templating is a powerful feature that allows you to create dynamic prompts with customizable inputs. This flexibility enables you to design interactive and personalized AI experiences for your users. In this guide, we’ll explore how to use prompt templates effectively in your Aikeedo projects.

Understanding Prompt Templates

Prompt templates are pre-designed structures that include placeholders for user inputs. These templates allow you to create consistent and customizable prompts for various AI-powered tasks, such as content generation, language translation, or data analysis.

Key Components

Tags

Tags are the building blocks of prompt templates. They represent input elements that users can customize and are enclosed in curly braces.

{ input_name }

Attributes

Attributes modify the behavior of tags, allowing you to fine-tune how inputs are presented and processed. They are appended to tags using the pipe character (|).

{ input_name | attribute1 | attribute2 }

Creating Your First Prompt Template

Let’s create a simple prompt template for an “Article Generator”:

Write an article about { topic | placeholder: Your chosen subject }.

Use the following draft content:
---
{ content | multiline | placeholder: Draft content }
---

Additional instructions:
- Include relevant statistics and consider diverse perspectives.
- Write it in { language } using a { tone } voice tone.

This template generates a form with inputs for the topic, draft content, language, and tone, allowing users to customize their article generation request.

Available Attributes

Enhance your prompt templates with these powerful attributes:

label

Sets a custom label for the input

Example: { input_name | label:Custom label }

multiline

Creates a multiline text input

Example:{ input_name | multiline }

type

Defines the input type (currently supports enum)

Example:{ input_name | type:enum }

options

Specifies options for enum type inputs

Example:{ input_name | type:enum | options:Option 1, Option 2, Option 3 }

optional

Makes an input optional

Example:{ input_name | optional }

placeholder

Sets a custom placeholder text

Example:{ input_name | placeholder:Custom placeholder }

info

Provides additional information about the input

Example:{ input_name | info:Custom info text }

Built-in Inputs

Aikeedo provides two convenient built-in inputs to streamline your prompt templates:

  1. language: A dropdown list of supported languages.
  2. tone: A dropdown list of supported voice tones.

Use these built-in inputs in your templates like this:

{ language }
{ tone }

Advanced Template Example

Let’s create a more sophisticated prompt template for a “Comprehensive Article Generator”:

Create a detailed article on { topic | placeholder: Your chosen subject | info: Specify the main focus of your article }.

Target audience: { audience | type:enum | options:General, Beginners, Experts | info: Select your intended readership }

Article structure:
1. Introduction
2. { section_1 | label:Main Section 1 | placeholder:E.g., Historical background }
3. { section_2 | label:Main Section 2 | placeholder:E.g., Current trends }
4. { section_3 | label:Main Section 3 | placeholder:E.g., Future implications }
5. Conclusion

Key points to cover:
{ key_points | multiline | placeholder: List important points to address }

Writing style:
- Language: { language }
- Tone: { tone }
- Length: { word_count | placeholder:Approximate word count | info: Suggested range: 500-2000 words }

Additional requirements:
- Include at least { source_count | type:enum | options:2, 3, 5 | label:Number of sources } credible sources
- Incorporate relevant statistics and data visualizations if applicable
- Address potential counterarguments or alternative viewpoints

Extra notes:
{ extra_notes | multiline | optional | placeholder: Any additional instructions or context }

This advanced template demonstrates how to combine various attributes and input types to create a comprehensive and flexible prompt for generating high-quality articles.

Best Practices

  1. Be specific: Clearly define what you want the AI to do in your template.
  2. Use appropriate input types: Choose the right input type (text, multiline, enum) for each piece of information you need.
  3. Provide context: Use the info attribute to give users helpful information about each input.
  4. Balance flexibility and structure: Offer enough customization options while maintaining a clear overall structure.
  5. Test your templates: Experiment with different combinations of inputs to ensure your template produces the desired results.

Conclusion

Prompt templates are a powerful tool for creating dynamic, customizable AI experiences. By mastering the use of tags, attributes, and built-in inputs, you can design sophisticated prompts that cater to a wide range of use cases and user needs.