Aura Bot generic-ai-dialog-v3

Description of Aura bot generic-ai-dialog-v3, that allows managing several experiences for TV channels using AI services and complex logic resolution.

Introduction

The generic-ai-dialog-v3 allows OBs to implement search and recommendation use cases for TV channels based on AI services and complex logic resolution for channelData v3 channels.

You can check its source code in Github: generic-ai-dialog-v3.ts.

Environment variables

Property Type Description Mandatory
AURA_AUTHORIZATION_HEADER string Authorization header to be sent to AURA_GATEWAY_API_ENDPOINT yes
AURA_COMPLEX_LOGIC_ENDPOINT string URL of Complex Logic endpoint to interact with resolution API. yes
AURA_GATEWAY_API_ENDPOINT string URL of Aura Gateway API endpoint yes
AURA_GATEWAY_API_ISSUER_URL string Issuer URL for token info yes
AURA_CHANNELDATA_DEFAULT_VERSION string Default version of channelData. By default 1.0.0. no
AURA_CHANNELDATA_LA_DEFAULT_VERSION string Default version of channelData for Latin America. By default 2.0.0. no

Adding configurations for the AI Service

To use the AI Service, you need to add the intent configurations to the channel settings. The configurations should be added in the following format:

{
    "atria": {
        "dialogs": {
            "intent.tv.retrieve": {
                "applicationId": "816bdab6-3ea3-4a77-bdea-12945d6d7053",
                "presetId": "5d06f26c-a8d8-4f45-a999-102aaa8b191b"
            }
        }
    }
}

With this configuration, when the generic-ia-dialog-v3 is called with the intent intent.tv.retrieve, it will use the specified applicationId and presetId to call the generative API.

How it works

Steps

  • The dialog starts by retrieving the intent information from the context and logging the start of the dialog.
  • Then, it calls the AI service to get a generative response based on the intent and the current session ID. The session ID is updated in the context for future requests.
  • Next, it calls the complex logic service to get a resolution based on the intent and entities from the generative response.
  • If the resolution indicates no content found, it redirects to the conversational-search dialog.
  • Otherwise, it builds an activity to be sent to the user using the intent result, intent settings, and resolution.
  • If any error occurs during these steps, it logs the error, sets the error in the context, and builds an activity from the error.
  • Finally, it sends the activity to the user and ends the dialog.

Sequence diagram

sequenceDiagram
    autonumber
    participant User
    participant Dialog
    participant AI Services
    participant Complex Logic
    participant Conversational Search
    Dialog->>Dialog: Retrieve intent information from context
    Dialog->>AI Services: Call AI service with intent and session ID
    AI Services->>Dialog: Return generative response and session ID
    Dialog->>Complex Logic: Call complex logic service with intent and entities
    Complex Logic->>Dialog: Return resolution
    alt No content found in resolution
        Dialog->>Conversational Search: Redirect to conversational-search dialog
    else Content found
        Dialog->>Dialog: Build activity with intent result, intent settings, and resolution
        Dialog->>User: Send activity to user
    end
    Dialog->>Dialog: End dialog