# Template Tags

### Prompt Tag

The prompt template tag enables you to create simple prompts directly from your templates.

We recommend using [tag caching](https://docs.expressionengine.com/latest/optimization/caching.html#tag-caching) to reduce latency (time taken for OpenAI to process your prompt and produce results) and reduce costings (each API call will make a small cost). By using tag caching the output of individual tags will be cached.

An example usage of the prompt tag would be:

```
{exp:prompt_ai:prompt prompt="What Pie to 10 decimal places" cache="yes" refresh="360"}

{if no_results} <p>No results found.</p>{/if}

<p>{content}</p>

{/exp:prompt_ai:prompt}
```

The 'prompt' template parameter is required. The example shows how to use tag caching for performance and cost saving.

***

### Prompt Content Tag

The prompt content tag is useful for processing larger data, for example summarising blog content. Include the prompt from directly within the tag content.

Below is an example to create a brief summary of a blog article:

```
{exp:channel:entries channel="blog" limit="1"}

    {exp:prompt_ai:prompt_content cache="yes" refresh="360"}

        Create a short summary of: {body}

    {/exp:prompt_ai:prompt_content}

{/exp:channel:entries}
```

This is a really versatile tag, and can be used for many things, for example you could ask the tag to translate the content into another language. Like ChatGPT it can be a multipurpose tool.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pad-media.gitbook.io/prompt-ai/template-tags.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
