81
1
using System;
2
using System.IO;
3
using System.Net;
4
using System.Web;
5
using Newtonsoft.Json.Linq;
6
7
public class Program
8
{
9
public static void Main(string[] args)
10
{
11
string query = Console.ReadLine();
12
while (query != "end")
13
{
14
string apiEndPointUrl = "https://api.projectoxford.ai/luis/v1/application?id={0}&subscription-key={1}&q={2}&timezoneOffset=0.0";
15
string applicationId = "YourApplicationIdHere";
16
string key = "YourKeyHere";
17
string url = string.Format(apiEndPointUrl, applicationId, key, HttpUtility.UrlEncode(query));
18
string response = ProcessRequest(url);
19
string intent = GetIntent(response);
20
string nextResponse = GetNextResponseFromIntent(intent);
21
Console.WriteLine(nextResponse);
22
query = Console.ReadLine();
23
} ;
24
}
Cached Result