From 45dc099a5a5a9e2f37569b038faabae2d3a9765f Mon Sep 17 00:00:00 2001 From: Guilhermy <55157846+devguilhermy@users.noreply.github.com> Date: Mon, 20 Nov 2023 14:59:33 -0300 Subject: [PATCH 1/2] chore: adds whatsapp variables --- pages/cloud/studio/variables.mdx | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/pages/cloud/studio/variables.mdx b/pages/cloud/studio/variables.mdx index 7d63b952..46f6a67f 100644 --- a/pages/cloud/studio/variables.mdx +++ b/pages/cloud/studio/variables.mdx @@ -243,15 +243,17 @@ console.log(data) Botpress makes available several different variables that can be used in your bot's code. These variables are useful for debugging and for accessing information about the user and conversation. -| Path | Type | Description | -| ------------------------------------------------------------------------------- | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `event.preview` | Event | The last message sent by the user. It will be replaced every time there is a new message. | -| `conversation.SummaryAgent.summary` | Agent | Summary of the conversation created by the [Summary Agent](./agents/#summary-agent). It's an explanation of what happened. | -| `conversation.SummaryAgent.transcript` | Agent | Transcript of the conversation going back a certain amount of turns. | -| `turn.KnowledgeAgent.answer` | Agent | The answer provided by the [Knowledge Agent](./agents/#knowledge-agent) | -| `turn.KnowledgeAgent.responded` | Agent | Wether the Knowledge Agent has responded automatically to a user question. Its value will be `true` or `false` | -| `turn.KnowledgeAgent?.answer?.length` | Agent | The amount of characters in the Knowledge answer. Use this in an [Expression](../toolbox/transition-to/#expression) to check if there is an answer in the KB. Optionally add `!` to start of the code in order to check if there was NOT an answer. | -| `turn.KnowledgeAgent.citations` | Agent | A list of citations for the Knowledge answer. | -| `user.TranslatorAgent.language` | Agent | The current user language code in ISO 639-1 format. [More about the Translator Agent](./agents/#translator-agent) | -| `user.TranslatorAgent.language = 'en'` | Agent | This code snippet set's the user language to English. Replace with any language code in the ISO 639-1 format | -| `event.kb.results.map((a) => a.dsFriendlyName + '\n' + a.content).join('\n\n')` | Event | This code snippet returns the raw content that generated the final Knowledge answer. | +| Path | Type | Description | +| ------------------------------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `event.preview` | Event | The last message sent by the user. It will be replaced every time there is a new message. | +| `conversation.SummaryAgent.summary` | Agent | Summary of the conversation created by the [Summary Agent](./agents/#summary-agent). It's an explanation of what happened. | +| `conversation.SummaryAgent.transcript` | Agent | Transcript of the conversation going back a certain amount of turns. | +| `turn.KnowledgeAgent.answer` | Agent | The answer provided by the [Knowledge Agent](./agents/#knowledge-agent) | +| `turn.KnowledgeAgent.responded` | Agent | Wether the Knowledge Agent has responded automatically to a user question. Its value will be `true` or `false` | +| `turn.KnowledgeAgent?.answer?.length` | Agent | The amount of characters in the Knowledge answer. Use this in an [Expression](../toolbox/transition-to/#expression) to check if there is an answer in the KB. Optionally add `!` to start of the code in order to check if there was NOT an answer. | +| `turn.KnowledgeAgent.citations` | Agent | A list of citations for the Knowledge answer. | +| `user.TranslatorAgent.language` | Agent | The current user language code in ISO 639-1 format. [More about the Translator Agent](./agents/#translator-agent) | +| `user.TranslatorAgent.language = 'en'` | Agent | This code snippet set's the user language to English. Replace with any language code in the ISO 639-1 format | +| `event.kb.results.map((a) => a.dsFriendlyName + '\n' + a.content).join('\n\n')` | Event | This code snippet returns the raw content that generated the final Knowledge answer. | +| `event.tags.conversation['whatsapp:userPhone']` | Integration | The user's phone number on WhatsApp. Includes the international code. | +| `event.tags.conversation['whatsapp:phoneNumberId']` | Integration | The phone number Id of the bot on WhatsApp. Includes the international code. | From 0be197ec782f02e6ea5f534e2ca27f4f4b393f3d Mon Sep 17 00:00:00 2001 From: Guilhermy <55157846+devguilhermy@users.noreply.github.com> Date: Wed, 22 Nov 2023 11:15:48 -0300 Subject: [PATCH 2/2] fix: remove duplicate info --- pages/cloud/studio/variables.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/cloud/studio/variables.mdx b/pages/cloud/studio/variables.mdx index 46f6a67f..db2c6c60 100644 --- a/pages/cloud/studio/variables.mdx +++ b/pages/cloud/studio/variables.mdx @@ -256,4 +256,4 @@ Botpress makes available several different variables that can be used in your bo | `user.TranslatorAgent.language = 'en'` | Agent | This code snippet set's the user language to English. Replace with any language code in the ISO 639-1 format | | `event.kb.results.map((a) => a.dsFriendlyName + '\n' + a.content).join('\n\n')` | Event | This code snippet returns the raw content that generated the final Knowledge answer. | | `event.tags.conversation['whatsapp:userPhone']` | Integration | The user's phone number on WhatsApp. Includes the international code. | -| `event.tags.conversation['whatsapp:phoneNumberId']` | Integration | The phone number Id of the bot on WhatsApp. Includes the international code. | +| `event.tags.conversation['whatsapp:phoneNumberId']` | Integration | The phone number Id of the bot on WhatsApp. |