Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Cannot get generator to give me the links out of a csv faq structured data type in dialogflow cx

I have a structured CSV file where the headers are consistent in capitalization, specifically the "Answer" and "Question" columns. No matter what I try, I cannot extract the links using $request.knowledge.answers[0] . I'm unsure what I'm doing wrong and would appreciate any help.

0 2 196
2 REPLIES 2

Hi @CosminB,

Welcome to Google Cloud Community!

To extract information from your CSV file, you’ll need to map the data to Dialogflow intents and entities. Ensure that your CSV file has consistent headers for the “Answer” and “Question” columns.

In Dialogflow CX, create an intent that corresponds to your FAQ questions. Map the “Question” column from your CSV to the training phrases in the intent. For the “Answer” column, you can use a fulfillment webhook to dynamically retrieve the answer based on the matched intent.

For Webhook Fulfillment:

  • Set up a webhook in Dialogflow CX to handle the logic for extracting links.
  • In your webhook code, parse the CSV data and extract the relevant links.
  • Return the extracted links as part of the response to the user.

For Testing and Debugging:

  • Test your chatbot by sending sample questions and verifying that the correct answers (including links) are returned.
  • Use the Dialogflow CX console to inspect the interactions and ensure proper data extraction.

Remember that structured data in Dialogflow CX involves both intent design and fulfillment logic.

I hope the above information is helpful.

Thank you for the detailed explanation, Ruth. However, I'm struggling to understand why I need to set up intents and use a webhook in this scenario. If I have to manually map and train intents and entities, it feels like I could just handle everything manually inside the console and bypass the webhook, generator, and datastore altogether.

My expectation was that using a structured data type, such as a CSV with consistent headers, would allow the LLM to dynamically leverage that data to generate responses. If a generator can extract relevant information from an unstructured document and respond appropriately, why can't it do the same with a structured CSV file in a datastore?

Is there a way to do it as I described? It seems counterintuitive that I would need to go through this manual process when working with a structured dataset. I was hoping Dialogflow would be able to directly utilize the data from the CSV to generate responses without additional intent matching and entity types. Could you clarify why this additional setup is necessary, or if there’s a more efficient way to achieve the desired functionality?