> For the complete documentation index, see [llms.txt](https://docs.hablla.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hablla.com/hablla-docs-en/automation-flows/all-components/hablla-gpt/prompt.md).

# Prompt

The Hablla GPT Component (identified in the internal bus as `habllaGpt`) is a cognitive processing node based on Large Language Models (LLMs). Its main function is to submit contextual instructions, aggregated contact data, or open questions to a partner Artificial Intelligence engine. The component analyzes the input received in real time and autonomously generates a text response, making it ideal for creating intelligent triage flows, summarizing histories, analyzing message sentiment, or answering complex questions without relying on rigid decision paths.

### 2. Configuration Parameters

Node parameterization manages the choice of the processing brain and the AI inference limits through the following criteria:

* Model (\* Required Field): Drop-down menu used to select the language model that will process the request. The selector offers stable subversions based on the OpenAI architecture, including high-performance and efficient commercial models such as `gpt-4o`, `gpt-4o-mini`, `gpt-4.1` and their respective time-based variants.
* Action: Structured field to dictate the mode or macro behavior instruction of the node (such as the mode `Prompt`).
* Knowledge Base: Optional menu used to couple the component to corporate vector institutional data repositories (RAG mechanism - *Retrieval-Augmented Generation*), ensuring that the AI consults internal documents before formulating a technical response.
* Question: Long text box intended to receive the commands, the bot's operational role (*System Prompt*) or the question that will be evaluated by the AI.
* Options (Advanced Repeater Menu): List of additional parameters added on demand to refine the model's response time and style:
  * `Temperature`: Controls the AI's randomness and creativity (values close to 0 make the response more exact and standardized; values close to 1 give greater writing freedom).
  * `Max. tokens`: Limits the size and maximum length of the generated response text payload.
  * `Max. attempts`: Defines the ceiling for automatic resends in case of instability or timeout in the AI API.
  * `Language`: Sets the node's native language for writing and interpretation prioritization.

### 3. Visual Builder

The builder interface adopts a cascading structure designed for the modular inclusion of advanced controls:

* Expanded On-Demand Filters: The drop-down menu *Options* works as a dynamic injector. Instead of cluttering the screen with dozens of inputs, the administrator selects which criterion they want to refine (such as *Temperature*) and the panel immediately renders the corresponding field with the option to quickly remove it via a trash icon.
* Node Syntactic Validation: The requirement marked with an asterisk (`*`) in the *Model* selector serves as a safety barrier on the canvas, blocking the automation from being saved if no AI infrastructure is linked.

### 4. Special Operators

The logical properties of this component deal with asynchronous contextual compilations and metadata payload injection:

* Variable Interpolation in Full Prompts: The text box for parameter *Question* accepts the insertion of double braces `{{...}}` freely. This makes it possible to equip the AI robot with all the context gathered from the contact up to the current moment (e.g.: `"Given the customer with name {{nome}}, phone {{phone}} and message history {{$data?.historico}}, perform the following analysis..."`).
* Inference Result Object: Upon successfully completing neural processing, the system engine injects the pure AI output into a native response variable within the contact scope (`$data`). The generated payload can be invoked immediately in sequential message components of any channel (WhatsApp, Telegram, Webchat) to display the generated response to the end user transparently.

### 5. Practical Examples

The table below demonstrates classic scenarios of how to configure Hablla GPT properties to extract automated intelligence in the flow:

| **Selected Model** | **Configuration of the "Question" (Prompt)**                                                                                                                                 | **Parameter Added in "Options"**                | **Practical Use Case**                                                                                                                       |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| gpt-4o-mini        | "The user typed: `{{response}}`. Based on that, answer briefly which category this message fits into: \[Finance], \[Support] or \[Sales]."                                   | `Temperature` = 0.0 *(Total focus on accuracy)* | Act as an automatic classifier or router of written message intents without closed button menus.                                             |
| gpt-4o             | "Classify the level of dissatisfaction in the following customer message: `{{$data?.first_message}}`. Respond only with a number from 1 (very satisfied) to 5 (very angry)." | `Max. tokens` = 5                               | Analyze the sentiment of the customer's first interaction on Instagram to prioritize urgent complaint cases in the human queue.              |
| gpt-4o             | "You are a virtual e-commerce agent. Use the FAQ knowledge base to answer the user's question: `{{response}}`"                                                               | `Language` = Portuguese                         | Create an autonomous virtual assistant plugged into the site FAQ capable of answering complex institutional questions in DMs in a human way. |


---

# 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 dynamically by asking a question.

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

```
GET https://docs.hablla.com/hablla-docs-en/automation-flows/all-components/hablla-gpt/prompt.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
