LogoLogo
  • 👋START HERE
    • Welcome!
  • ℹ️General
    • Release Notes
      • Full Feature Base Template
      • Services
      • Rule-based Automation
        • May 2025
        • February 2025
        • January 2025
        • December 2024
        • November 2024
        • October 2024
        • September 2024
        • August 2024
        • July 2024
        • June 2024
        • May 2024
        • April 2024
        • March 2024
        • February 2024
        • January 2024
        • 2023
        • 2022
        • 2021
        • Dialog Design Update
    • Glossary of Terms
    • Authentication Methods
      • SSO (Single Sign-On)
      • Built-In User Management
    • Acceptable Use Policy
  • ⚙️Rule-based Automation
    • Overview
      • Account Settings
        • Profile
        • Team
        • Roles and Permissions
          • User Management
          • Project Permissions
      • Basic Concepts
        • Project Management
        • Version Management
        • Multi-Lingual Bots
          • Supported Languages
        • Managing User Interactions
          • Unexpected User Input
          • No User Input
    • Dialog Interface
      • Blocks
        • Conversation Logic
          • Start Conversation
          • Global
          • State
          • Intermediate Response
          • To Previous State
          • End Conversation
        • Subdialog
          • Reusable Subdialogs
        • Phone
          • Continue Listening
          • Call Control
        • Technical Logic
          • Service
          • Condition
          • Storage
        • Other
          • Note
      • Speech Assets
        • Intents
          • Utterances
          • Descriptions
        • Slots
          • Custom Slots
            • List Slots
            • Machine Learning Slots
            • Regex Slots
            • LLM Slots
          • Prebuilt Slots
            • DTMF Slot
        • Text Snippets
        • Dictionary
      • Variables
        • Intents
        • Slots
        • Storage
        • Text Snippets
        • Environments
        • Platform
        • Context
      • Services
        • Service Integration Guide
        • Service Development
        • Service Branches and Error Handling
        • Public Services
          • Date and Birthdate Recognition
          • Spelling Post-Processing for Phone
          • IBAN Validation
          • License Plate Validation
          • Address Search
          • Street Names per Postal Code
          • Email Service
          • SMS Service
          • API Adapter
          • Salesforce-Flow Connector
          • Opening Hours
          • Speech-to-Text Hints
          • Fuzzy Match Names
          • Delay Service
      • Debugger
        • Phone 2
        • WhatsApp
        • Textchat 2
    • Environments Interface
      • Service Keys
    • Deployments Interface
      • Creating a Release
      • Editing a Release
    • Text-to-Speech
      • Azure
      • ElevenLabs
      • OpenAI via Azure (Preview)
      • SSML
        • Audio
        • Break
        • Emphasis
        • Prosody
        • Say-as
        • Substitute
        • Paragraph and Sentence
        • Voice
    • Autocomplete
    • Parloa APIs
      • CallData Service and API
      • Conversation History API
      • Textchat V2 API
    • Phone Integrations
      • Genesys Cloud
        • Setting up the SIP Trunk
        • Sending/Receiving UUI Data
        • Creating a Script to Display UUI
      • SIP
      • Tenios
        • Setting Up an Inbound Connection
        • Setting Up an Outbound Connection
        • Transferring a Call
      • Twilio
      • Public IPs and Port Information
    • AI Integration Overview
      • Dual Intent Recognizer (DIR)
      • Dual Tone Multifrequency (DTMF) Intent
    • Analytics and Debugging
      • Understanding Conversations and Transactions
      • Managing Caller ID Data
      • Hangup Events and Triggered Analytics
      • Analytics Transactions: Data Structure and Insights
      • Dialog Analytics
      • Audit Logs
      • Parloa-hosted Analytics
    • Data Privacy
      • Anonymizing Personally Identifiable Information
    • NLU Training
      • NLU Training Best Practices
    • How To
      • Create a Scalable and Maintainable Bot Architecture
      • Implement OnError Loop Handling
      • Resolve the 'Service Unavailable' Error
    • Reference
      • Parloa Keyboard Shortcuts
      • Frequently Asked Questions (FAQ)
      • JavaScript Cheat Sheet
        • Using Regular Expressions (Regex)
  • 🧠Knowledge Skill
    • Introduction
    • Knowledge Collections
    • Knowledge Sources
    • Knowledge Skill Setup
      • Step 1 – Create a Knowledge Skill Agent
      • Step 2 – Configure a Knowledge Skill Agent
      • Step 3 – Configure a Knowledge Skill Agent
Powered by GitBook
On this page
  • Key Features of Context Variables
  • Interaction with Context Variables
  • Example of Context Variable Usage

Was this helpful?

Export as PDF
  1. Rule-based Automation
  2. Dialog Interface
  3. Variables

Context

Utilizing Context Variables for Dynamic Dialog Management

Context variables cover a broad range of conversational parameters beyond single interactions. Parloa currently supports the following context variables:

Key
Type
Description

context.accessToken

string

The user's access token is only provided for requests made by users who have linked their account with your project.

context.accountIsLinked

boolean

Indicates whether the current user has successfully performed account linking in the past, but does not ensure that the user's account is still linked. If a user revokes the permission in their linked account, the placeholder will still resolve to true because the system has no way of knowing that the permission was revoked in a third-party system.

context.isNewConversation

boolean

Indicates whether a new conversation is starting with the current request.

context.lastInteraction

date

The date of the last interaction between a user and your project.

Note: This value is null during the first interaction.

context.lastServiceCallError

string

In the event of a failed service call, the error message that is returned can be:

  • HTTP_ERROR: The received response code is not in the range 200-300.

  • ECONNREFUSED: No connection could be made because the target machine actively refused it.

  • ECONNRESET: A connection was forcibly closed by a peer.

  • ECONNABORTED: Service timeout

  • ENOTFOUND: Indicates a DNS failure.

  • ETIMEDOUT: A connect or send request failed because the connected party did not properly respond.

  • EPIPE: A write on a pipe, socket, or FIFO for which there is no process to read the data.

  • ECONNABORTED: The network connection has been aborted.

  • UNKNOWN: Anything else went wrong.

context.lastServiceCallStatus

number

The HTTP Status code received from a Service in the last service request performed. If the last service call returned an error, this variable will be undefined.

context.locale

string

Contains the language code of the release in BCP 47 format, such as de-DE or en-GB.

context.platform

string

The platform is currently being used. Possible values:

  • phoneV1

  • phoneV2

  • gaction

context.previousPrompt

string

The SSML prompt sent with the last response.

context.previousPromptText

string

The prompt displayText sent with the last response.

context.previousReprompt

string

The SSML prompt sent with the last response.

context.previousRepromptText

string

The prompt displayText sent with the last response.

context.reasonLastConversationEnded

string

The reason why the last conversation ended. Possible values are:

  • PARLOA_INITIATED

  • USER_INITIATED

  • NO_INPUT

  • ERROR

  • UNKNOWN

context.requestCount

number

Track of the number of back-and-forth interactions a user has had per release. The count starts at 1 for the initial interaction and increases with each subsequent exchange. It resets with different releases, only measuring the turn count for the current release. On the other hand, context.sessionCount counts the total calls a user has made to this release.

context.requestCountInSession

number

Tracks the number of conversation turns in the current session. A turn consists of a user input and a bot response. For example, a phone call initiated by the user and the bot's greeting count as one turn. The count starts at 1 and increments with each turn. It resets to 1 with each new phone call.

context.requestScopedRandomValue

number

A random float value in the range [0-1] is constant during a request but changes on each new request.

context.sessionCount

number

The number of conversations a user has had with a specific release, starting at 1 for the first conversation and incrementing with each new conversation. Different versions within the same release do not reset this counter, but different releases will have separate counts, essentially tracking the user's phone call count per release.

context.textblockUsages

string, number

This object contains the usage count for each text snippet. It can be accessed as follows: context.textblockUsages.<textsnippetName>

Key Features of Context Variables

  • They enable dynamic responses based on the conversation history.

  • Context variables can be used to repeat or reference previous interactions.

  • Some context variables are specifically intended for use within JavaScript fields to allow for advanced scripting and customization of the dialog flow.

Interaction with Context Variables

In the non-JavaScript fields of Parloa's platform, you might encounter a limited set of context variables available via the autocomplete feature. This is due to certain variables being designed exclusively for JavaScript contexts where more complex logic can be applied.

It's crucial not to confuse these context-specific variables with those used for service calls, which are designed for external interactions, such as API requests.

Example of Context Variable Usage

The example provided showcases the use of context.previousPrompt and context.previousPromptText within a dialogue block. These particular variables enable the system to repeat the last prompt heard by the user. This functionality is invaluable when the user has not understood or responded appropriately, requiring the system to reiterate the previous message.

  • The context.previousPrompt variable will repeat the last SSML (Speech Synthesis Markup Language) content, which might include specific intonation or speech pacing instructions.

  • The context.previousPromptText variable repeats the plain text version of the last message, which is useful for text-based platforms or debugging purposes.

PreviousPlatformNextServices

Last updated 1 year ago

Was this helpful?

⚙️