> For the complete documentation index, see [llms.txt](https://docs-conversational-ai.syntphony.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-conversational-ai.syntphony.com/build-dialogs/dialog-cells/prompt-cell.md).

# Prompt cell

A simple and user-friendly way to harness the capabilities of LLMs in your conversations

The Prompt cell (powered by OpenAI's ChatGPT) is a sophisticated tool to enhance and enrich your conversational flows in **Syntphony CAI**, allowing a more coherent, fluid, and custom interactions. This is a component that uses Generative AI technology to produce any content, suitable for multiple needs and scenarios.

This cell allows you to access the specified model during execution and generate content on the fly according to your configured settings.&#x20;

{% hint style="warning" %}
**Important:** Enabling this feature may result in additional costs on each new request, both at the time of creation and during the execution of flows, as a new request is made on content generation.
{% endhint %}

{% hint style="info" %}
To directly link your Generative AI account, simply [**open a support ticket**](https://shori-public.clonika.com/) with our team.
{% endhint %}

#### Creating a Prompt cell

To create a Prompt cell, proceed to the "Advanced Options" on the cells library in the Dialog Manager or thought the repository.

<figure><img src="https://content.gitbook.com/content/n6zS4HeuuVpRHZEvDiFU/blobs/ZZz9h8NZc3d4luGl7F66/image.png" alt=""><figcaption><p>Prompt cells repository</p></figcaption></figure>

The main fields in a Prompt cell are:

* [Prompt](#prompt)
* [Advanced parameters](#advanced-parameters)
* [Variable (hidden context)](#variable-hidden-context)
* [Preview](#preview)

We will get to know a little bit about each one further on.

### Prompt

Prompts are very useful in automating language-based tasks. You can use it to generate content to match a desired tone, emotion, context, and user preferences, or even contribute to the virtual agent personality. Prompts can also support code creation, content summarization, information classification, and masking sensitive information.

Prompts also support [Dynamic Content](/build-dialogs/dynamic-content-and-contexts.md). You may add variables such as the most recent user input, environment, and bot parameters straight in the prompt text.

{% hint style="success" %}
To make the most of a Prompt cell, first we have to understand what a prompt is and what the best practices in prompt engineering are. Check our guide on how to [craft a good and effective prompt ](/build-dialogs/dialog-cells/prompt-cell/prompt-crafting.md)to assist you with this topic. 😉
{% endhint %}

### Advanced settings <a href="#advanced-settings" id="advanced-settings"></a>

The model used by a **Prompt Cell** depends on the project's LLM integration. With **Azure OpenAI by Syntphony**, you can select the model directly in each Prompt Cell, and this choice applies only to that Cell. With a **private OpenAI or Azure OpenAI provider**, the model is selected during the provider and project configuration and applies to compatible generative resources, including **Prompt Cell**.

Each model provides specific settings to fine-tune response generation, such as **Temperature, Top P, Frequency Penalty, Presence Penalty, Reasoning Effort, and Verbosity**. Available settings and values vary by model.

Prompt Cells also provide **Maximum Tokens**, which limits the maximum number of tokens generated in the output, counting both prompt (input) and preview (output). Since tokens do not correspond directly to words or characters, the final response length may vary.

Learn more about [**Advanced Model Settings**](/language-models/advanced-model-settings.md).

### Variable (hidden context)

This field is crucial to retrieve the content generated. The variable written here will store the content for future use in the flows.&#x20;

Once you have your prompt, write down a variable in the required field Variable with the syntax $hiddenContext.(yourVariable). You can then use this freely at any **Syntphony CAI**-context compatible cell. In the example below, the chosen variable was "reservation".&#x20;

<figure><img src="https://4008706377-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn6zS4HeuuVpRHZEvDiFU%2Fuploads%2FO2Fqh6taEX8542S1MaR3%2Fimage.png?alt=media&amp;token=d06432cf-867f-4c22-b66d-04597e3582c0" alt=""><figcaption></figcaption></figure>

To retrieve the generated content (in the example, the list of best cities to travel to during the current season in the Southern Hemisphere), copy and paste the entire value written here into the text field in other cells.

<figure><img src="https://4008706377-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn6zS4HeuuVpRHZEvDiFU%2Fuploads%2FS0bAxvw3crMprs0f9aQ7%2Fimage.png?alt=media&amp;token=6e7766cb-0db8-4523-863b-a895eb5d3723" alt=""><figcaption><p>Example of a answer cell with the variable $hiddenContext.<strong>reservation</strong>. </p></figcaption></figure>

Now, every time a customer reaches this part of the conversation, a new request for this prompt will be generated.

{% hint style="info" %}
We highly recommend you reading the [Dynamic Content](#d-dynamic-answer) page to ensure a full and comprehensive understanding.
{% endhint %}

### Preview

You can preview the generation when editing a Prompt cell and fine tune it before you save it. If you click the "Generate Content" button, a new preview will be generated with the current prompt + advanced settings parameters.&#x20;

Note that if you have added Dynamic Content variables to your prompt, the test will fail. We recommend you to replace the variables with the expected value of those fields during the test.

{% hint style="warning" %}
Testing content also consumes tokens as if performing a conversation. The same is true to dialogues performed in **Syntphony CAI**'s dialog simulator.
{% endhint %}

### Use cases examples

While the Prompt cell has an infinity of use cases, we have detailed examples of interesting use cases in the [Practical examples](/build-dialogs/dialog-cells/prompt-cell/practical-examples.md) page.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs-conversational-ai.syntphony.com/build-dialogs/dialog-cells/prompt-cell.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
