Importing Quick-Intents
From version 5.0 Oscova supports a new CSV format to import Quick-Intents into backed Dialogs via a CSV
File or Text.
Currently Quick-Intents can only be imported into declared Dialogs
within the development environment. To import Quick-Intents from CSV data, use the ImportFromFile
if the CSV data resides within a file or ImportFromText
if the CSV data is available in string format, for example within a database system.
public class GreetingQuickIntentDialog: Dialog
{
public GreetingQuickIntentDialog()
{
IntentAlias = "QuickIntent.Greetings";
QuickIntents.ImportFromFile("quick-intents.csv", QuickIntentDataFormat.Csv);
}
}
public class GreetingQuickIntentDialog: Dialog
{
public GreetingQuickIntentDialog()
{
IntentAlias = "QuickIntent.Greetings";
var csvData = SomeDatabase.Get("greetings"); //Any source
QuickIntents.ImportFromText(csvData, QuickIntentDataFormat.Csv);
}
}
The Quick-Intent CSV format requires that the first line declares 2 discreet headers, Query
and Response
and the succeeding lines would then contain the actual queries and responses.
The following shows the format of the file with a few queries and their responses.
Query, Response
How are you?, I am fine.
How is it going?, It's going great!
Tell me about yourself, I am an AI Help Agent.
You can specify multiple (random) responses for a single query by leaving the Query
column empty as Oscova will automatically add the response to the last mentioned query.
Query,Response
How are you?, I am fine.
, Doing well.
, Going great!
Tell me about yourself, I am an AI Help Agent.
In the above example the query How are you?
will receive I am fine
, Doing well.
and Going Great!
as responses.
The above would look something like the following as a spreadsheet.