> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aikeedo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Prompt Templates

> Create dynamic AI prompts using Aikeedo template syntax with input tags, modifiers, conditionals, and loops for customizable user experiences.

Prompt templating enables dynamic prompts with customizable user inputs. This guide covers template syntax, tags, modifiers, conditionals, and best practices for creating interactive AI experiences.

## 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.

```scss theme={null}
{ 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 (`|`).

```scss theme={null}
{ input_name | attribute1 | attribute2 }
```

## Creating Your First Prompt Template

Let's create a simple prompt template for an "Article Generator":

```scss theme={null}
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:

<ResponseField name="label" type="">
  Sets a custom label for the input

  Example:
  `{ input_name | label:Custom label }`
</ResponseField>

<ResponseField name="multiline" type="">
  Creates a multiline text input

  Example:`{ input_name | multiline }`
</ResponseField>

<ResponseField name="type" type="">
  Defines the input type (currently supports `enum`)

  Example:`{ input_name | type:enum }`
</ResponseField>

<ResponseField name="options" type="">
  Specifies options for `enum` type inputs

  Example:`{ input_name | type:enum | options:Option 1, Option 2, Option 3 }`
</ResponseField>

<ResponseField name="optional" type="">
  Makes an input optional

  Example:`{ input_name | optional }`
</ResponseField>

<ResponseField name="placeholder" type="">
  Sets a custom placeholder text

  Example:`{ input_name | placeholder:Custom placeholder }`
</ResponseField>

<ResponseField name="info" type="">
  Provides additional information about the input

  Example:`{ input_name | info:Custom info text }`
</ResponseField>

## 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:

```scss theme={null}
{ language }
{ tone }
```

## Advanced Template Example

Let's create a more sophisticated prompt template for a "Comprehensive Article Generator":

```scss theme={null}
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.
