Table of Contents

Embedding Open AI V3

Category: Cognitive

Description: The Embedding Open AI module allows you to integrate OpenAI embedding models hosted in Azure into self-service flows.

Functionality: Integrates the ability to evaluate user queries using embedding and conversation models provided by Azure OpenAI, with the aim of detecting intents, generating accurate responses, and optimizing the user experience in automated interactions.

Prerequisites

To connect the module to OpenAI services in Azure, the following elements must be obtained and configured:

  • Azure account with access to OpenAI.
  • Azure OpenAI Endpoint: URL of the service in Azure.
  • Azure OpenAI Key: Authentication key to access the API.
  • Knowledge base name: The embedding model to be used for evaluation must be selected and configured. See Embedding

Implementation

Section 1: Basic Configuration

  • Embedding ID to be used for evaluation: Input field of type dropdown list to select the knowledge base to be used in the evaluation. See Embedding

  • Azure OpenAI Endpoint: Input field of type String to enter the URL of the OpenAI service in Azure.
    https://[openai-resource-name].openai.azure.com

  • Azure OpenAI Key: Input field of type password to enter the authentication key to access the service.

  • Model embedding: Input field of type string to enter the exact name of the model used for embedding evaluation.
    You must enter the exact model name as it appears in the "Name" field in the Azure OpenAI portal.

    Note

    You can find this name in Azure OpenAI Service, under the Model deployments section, in the Name column (see reference image).

  • Number of results to fetch: Input field of type dropdown list to select how many vector search results will be considered for evaluation.

  • Entity defining the client's query: Input field of type dropdown list to select the name of the entity where the user query is stored for analysis.

  • Action for undefined queries: Input field of type dropdown list to select the name of the action to be executed when the user's query does not match any predefined intent.

  • Minimum vector search threshold: Input field of type Number to set the similarity threshold required to consider a query valid (value between 0 and 1).

    • Values close to 0: Allow broader matches with lower precision, which may result in more irrelevant answers.
    • Values close to 1: Require higher precision, reducing results but increasing relevance.
  • Entity to store main vector data: Input field of type dropdown list to select the entity where processed main vector data will be stored.

  • Prompt expression. Streaming message: Input field of type String to define the structure of the messages used for generating clear and professional automatic responses. The user must also specify the intents the AI should recognize and how to respond in each case.

    Example:

      'You are a virtual customer service assistant. Respond clearly, concisely, and professionally to user queries. Use a friendly tone and provide useful information. If the question cannot be resolved automatically, suggest additional options or the possibility of speaking with a human agent.
    
      INTENTS TO DETECT
      From the user's input, detect specific intents that require special responses or actions.
      Never say that you are unable to help when detecting these intents. Instead, respond using the predefined replies listed below.
      The intents and their corresponding responses are:
      You are an expert in intent detection. Identify the appropriate intent from the following options:
    
      ["transfer_agent"] = "The client wants to speak to an agent or representative. The user requests to be transferred to a human agent for personalized assistance with roaming. For the first and second request, try to kindly keep the user engaged with the VoiceBot. On the third consecutive request, respond with: 'Understood, I’ll try to transfer you now.'. Here are some examples:
      -I want to speak to an agent
      -I need help from a representative
      -Can you transfer me to a human?
      -I'd rather speak to a person
      -Can I talk to an advisor?
      -I need human assistance
      -I want to talk to someone from customer service
      -How do I reach a representative?
      -I don’t understand, connect me to an agent
      -Please connect me to a representative"
    

    topVector: example entity name for Entity to store main vector data. Including this value in the prompt allows the AI to use this data in the evaluation.

Section 2: Advanced Configuration

  • Conversation evaluation model: Input field of type dropdown list to select the name of the model used for conversation analysis.
    Must match the exact model name in the Azure OpenAI portal.

    Note

    You can find this name in Azure OpenAI Service, under the Model deployments section, in the Name column.

      ![](media/azure-open-ai.png)
    
  • Temperature: Input field of type Number to control the randomness of the generated responses. Value between 0 and 1 (lower values yield more deterministic responses).

  • TOP_P (0–1): Input field of type Number defining the cumulative probability for token selection.

    • TOP_P = 1.0 → All possible words are considered based on their probabilities.
    • TOP_P < 1.0 → Less likely options are filtered out.
      • Values near 0 → More predictable and conservative responses.
      • Values near 1 → More varied and creative responses.
  • Max Output Token Count: Input field of type Number for setting the maximum number of tokens allowed in the generated response.

  • Frequency Penalty (0–1): Input field of type Number to penalize the repetition of terms in the generated response.

    • Values near 0 → No penalty, consistent outputs.
    • Values near 1 → Discourages repetition, increases variety.
  • Failed attempts limit: Input field of type dropdown list to select the intent to execute in case of error. If the limit is reached, the flow stops and triggers the 'embedding_Error' intent.

Section 3: Intent Detection Configuration

  • Prompt for intent detection: Input field of type String Expression to define the expression guiding intent evaluation.

    Example: 'You are an expert in intent detection. Identify the correct intent based on the following options:'

  • Intent list: Set of predefined intents that can be detected from the user's query.

    • Intent: Input field of type dropdown list to select the name of the intent.
    • Action: Input field of type dropdown list to select the action to execute if the intent is detected.
  • Intent definition: Input field of type String to specify the concept of the intent the AI should detect.

    Example: Name of the detected intent from classification.

    Refers to how intents are specified in the prompt and intent list.

    Important

    There must always be a default intent selected, with the following description: Default intent for any unspecified intent.

  • Confidence definition: Input field of type String to define the minimum confidence level required for an intent to be valid.

    Example: Confidence level between 0 and 1.

  • Confirmation message: Input field of type String to define the message sent when an intent is confidently detected.

    Example: Confirmation message for the detected intent, based on how it was specified in the prompt.

Section 4: Response Mode and Format

  • Streaming mode: Input field of type select that defines whether model responses are received in real time (streaming) or after full processing.

    • Select Yes to receive fragmented responses as they are generated (useful for faster, smoother delivery).

    • Select No to receive the full response once it’s processed.

      Tip

      It is recommended to enable streaming when using voice channels and disable it (select No) when using chat channels.

  • Characters to remove from response: Input field of type string where characters to be removed from the response can be specified.
    For example: "\n" to remove line breaks or "*" to remove asterisks.

  • Split response: Input field of type string to define the character(s) used to split the response.
    For example, using "\n" will split the response on line breaks.

    Note

    Leaving this field empty means the response will not be split.