> For the complete documentation index, see [llms.txt](https://docs.chatlayer.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chatlayer.ai/chatlayer-documentation-pt-br/buildabot/tips-and-best-practices/go-to-previous-bot-dialog.md).

# Ir para o bloco anterior

Normalmente, quando um usuário faz uma pergunta e isso não é entendido, ele vê uma mensagem como 'Não entendi'. Para refrescar a memória do usuário, você pode repetir novamente o último bloco para o usuário, como mostrado abaixo:

![](https://181262846-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLTwFwbOqJj4dDhg8Ju%2F-MX1uvBXpHgAPXxjW-Li%2F-MX2PScKajnYaSgwAVAE%2Fimage.png?alt=media\&token=7b593cb6-038d-496e-8f85-844ef9ce018f)

O que vemos aqui é que a introdução foi criada e, em seguida, o bot não entende a entrada do usuário 'test'. Depois, após a mensagem de 'não entendido', a mesma mensagem de antes é exibida novamente. Isso cria uma experiência completa para o usuário e um fluxo de conversa. Como configurar isso é explicado abaixo:

## 1. Adicione uma variável a 'não entendido'

Na mensagem do bot 'não entendido', crie uma nova variável como mostrado abaixo:

![](https://181262846-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLTwFwbOqJj4dDhg8Ju%2F-MX1uvBXpHgAPXxjW-Li%2F-MX2PwV-U1Bfu4lym7xE%2Fimage.png?alt=media\&token=03338377-a9f1-4d3e-83f9-4312ec50d043)

Além disso, certifique-se de que a seção 'Ir para' deste bloco vá para um novo bloco de Ação, chamado 'Ir para o bloco anterior' neste caso.

## 2. Crie um bloco de Ação

Na ação 'Ir para o bloco anterior', crie o seguinte:

![](https://181262846-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLTwFwbOqJj4dDhg8Ju%2F-MX1uvBXpHgAPXxjW-Li%2F-MX2QEhKU8uI3RoDGtw2%2Fimage.png?alt=media\&token=f1e650c8-4f5f-4a26-890d-b52202e57853)

Isso garante que o bot vá para o bloco anterior, usando a variável definida na mensagem do bot 'não entendido'. O código pode ser copiado abaixo:

```javascript
const { prevDialog } = args;

ChatlayerResponseBuilder()
.setNextDialogState(args.prevDialog)
.send() 
```

Certifique-se de testar sua nova configuração no emulador.

E é isso! Com apenas duas etapas simples, você criou uma melhor 'experiência de não entendido'. Certifique-se também de conferir os outros [artigos ](https://docs.chatlayer.ai/tips-and-best-practices/not-understood-bot-dialog)escritos sobre o bloco 'não entendido'.


---

# 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.chatlayer.ai/chatlayer-documentation-pt-br/buildabot/tips-and-best-practices/go-to-previous-bot-dialog.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.
