Prompt AI Docs
  • Introduction
  • Installation
  • Template Tags
  • License Agreement
Powered by GitBook
On this page
  • Prompt Tag
  • Prompt Content Tag

Template Tags

PreviousInstallationNextLicense Agreement

Last updated 1 month ago

Prompt Tag

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

We recommend using 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.

tag caching