Understanding Generative AI Responses

Updated 

Note: Before starting, ensure you set up content sources, deploy the model in the dialogue tree, and test the bot.

Source of the Final Response

Understanding the API Response Structure

Accessing the API Response: In the debug log, navigate to the Generative AI API node from where the response has been published. Hover over the value in the "gpt_api_output" output variable to get a pop-up box containing the API Response.

Output Variables:

  • gpt api output

    • Description: The raw response received from the OpenAI API after processing the prompt. This output is typically unrefined and may require further processing or parsing to generate the final answer.

    • Example: "gpt_api_output": "You can reset your password by following the steps in the 'Account Settings' section."

  • gpt answer

    • Description: The final, refined answer provided by the Smart FAQ system. This answer is derived from the raw API response and formatted for the user, ensuring clarity and relevance to the user’s query.

    • Example: "gpt_answer": "To reset your password, go to the 'Account Settings' section and click on 'Change Password.'"

  • gpt context

    • Description: The sources or references from which the Smart FAQ system derived its answer. This helps track the origin of the information and ensures transparency in how the response was generated.

    • Example: "gpt_context": ["account_settings_faq_article", "help_center_guide_01"]

  • gpt_reworded_question

    • Description: A reworded version of the user’s original question, generated by GPT. This helps clarify the context or intent of the user’s question for better response generation.

    • Example: "gpt_reworded_question": "How do I change my account password?"

SuggestedResponses: Provide suggestions to the user's query.

  • Text: Contains the direct response to the user's query.

  • Origin of the Response: Sources referenced in brackets [1], etc., correspond to the source numbers listed below (refer to Image #1 for visual guidance).

  • Raw Response: Contains the direct response to the user's query, with sources referenced in brackets [1], etc., corresponding to the source numbers listed below (see Image #1 for visual guidance).

Locating Sources

  • You can find the names and page/slide numbers of the files in the 'sources' under the 'additional' field.

  • Use the source number to cross-reference with the published response.

Identifying Used Excerpts

  • In the 'placeholders' section, look for the field named 'context'. This contains excerpts from the files or knowledge base uploaded within the Content Sources UI.

  • This part of the API response helps you verify if the information used to answer the user's query was retrieved from the uploaded content sources.

Additional Information from the API Response

  • Conv Ended: Always sent as true.

  • Fallback: Indicates when the user's query is out of scope for the AI.

  • Question: The reworded user query used to search the knowledge base for context.