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

# Prompt Templates

> Guide to effective prompt engineering and templates

<Frame>
  <img src="https://mintcdn.com/taamai-c8c27d6c/7tpU7wOp-rlopJuB/images/playground/model-select.png?fit=max&auto=format&n=7tpU7wOp-rlopJuB&q=85&s=217a39c658d7ce9bcb35b10e142c8be7" alt="Prompt Templates Interface" width="2880" height="1620" data-path="images/playground/model-select.png" />
</Frame>

## Prompt Engineering Basics

<AccordionGroup>
  <Accordion title="Core Principles" icon="lightbulb">
    <CardGroup cols={2}>
      <Card title="Structure" icon="layer-group">
        * Clear organization
        * Logical flow
        * Specific formatting
      </Card>

      <Card title="Clarity" icon="magnifying-glass">
        * Unambiguous instructions
        * Specific requirements
        * Defined constraints
      </Card>
    </CardGroup>
  </Accordion>

  <Accordion title="Elements of Good Prompts" icon="list-check">
    * Clear objective
    * Context information
    * Output format
    * Quality criteria
    * Examples (if needed)
  </Accordion>
</AccordionGroup>

## Prompt Structures

<Steps>
  <Step title="Basic Structure" icon="square-1">
    ```plaintext theme={null}
    Write a [type of content] about [topic] that includes:
    - Point 1
    - Point 2
    - Point 3
    Format as [desired format]
    ```
  </Step>

  <Step title="Advanced Structure" icon="square-2">
    ```plaintext theme={null}
    Role: [specific role/expertise]
    Task: [detailed description]
    Context: [background information]
    Requirements:
    - Requirement 1
    - Requirement 2
    Format: [specific format]
    Additional Notes: [any constraints or preferences]
    ```
  </Step>

  <Step title="Iterative Approach" icon="square-3">
    ```plaintext theme={null}
    Initial draft: [topic/concept]
    Current text: [existing content]
    Next step: [what to add/modify]
    Style guide: [formatting requirements]
    ```
  </Step>
</Steps>

## Example Templates

<CodeGroup>
  ```json Academic theme={null}
  {
    "name": "Academic Analysis",
    "template": "Write a detailed academic analysis of {topic} considering:\n1. Historical context\n2. Current research\n3. Future implications\n\nFormat using {style_guide} with {word_count} words.",
    "variables": {
      "topic": "string",
      "style_guide": ["APA", "MLA", "Chicago"],
      "word_count": "number"
    }
  }
  ```

  ```json Business theme={null}
  {
    "name": "Market Research",
    "template": "Analyze {industry} in {region} covering:\n- Market size\n- Key players\n- Growth trends\n- Entry barriers\n\nProvide data-driven insights and recommendations.",
    "variables": {
      "industry": "string",
      "region": ["Global", "APAC", "EMEA", "Americas"]
    }
  }
  ```

  ```json Technical theme={null}
  {
    "name": "Code Documentation",
    "template": "Document the following {language} {component_type}:\n\nPurpose:\n{purpose}\n\nParameters:\n{parameters}\n\nReturns:\n{returns}\n\nExample Usage:\n{example}",
    "variables": {
      "language": ["Python", "JavaScript", "Java", "Go"],
      "component_type": ["function", "class", "module"],
      "purpose": "string",
      "parameters": "array",
      "returns": "string",
      "example": "code"
    }
  }
  ```
</CodeGroup>

## Best Practices

<CardGroup cols={3}>
  <Card title="Be Specific" icon="bullseye">
    Avoid ambiguity in instructions
  </Card>

  <Card title="Provide Context" icon="circle-info">
    Include relevant background
  </Card>

  <Card title="Iterate" icon="rotate">
    Refine prompts for better results
  </Card>
</CardGroup>

## Quality Improvement Tips

<AccordionGroup>
  <Accordion title="Clarity Enhancement" icon="wand-sparkles">
    * Use precise language
    * Specify output format
    * Include examples when needed
    * Define success criteria
  </Accordion>

  <Accordion title="Iteration Strategies" icon="arrows-rotate">
    1. Start with basic prompt
    2. Review output
    3. Identify gaps
    4. Refine constraints
    5. Add specific requirements
  </Accordion>

  <Accordion title="Common Pitfalls" icon="triangle-exclamation">
    * Vague instructions
    * Missing context
    * Unclear format requirements
    * Insufficient constraints
  </Accordion>
</AccordionGroup>

<Note>
  For more advanced prompt engineering techniques, visit [Learn Prompting](https://learnprompting.org/en-US/docs/intro)
</Note>
