我正在尝试像这样在QnA Maker
的知识库中向现有问题添加问题:
public async static void CallTrain(string host, FeedbackRecords feedbackRecords, string kbId, string key, CancellationToken cancellationToken)
{
var uri = host + "/knowledgebases/" + kbId + "/train/";
using (var client = new HttpClient())
{
using (var request = new HttpRequestMessage())
{
request.Method = HttpMethod.Post;
request.RequestUri = new Uri(uri);
request.Content = new
StringContent(JsonConvert.SerializeObject(feedbackRecords),
Encoding.UTF8, "application/json");
request.Headers.Add("Authorization", "EndpointKey " + key);
var response = await client.SendAsync(request, cancellationToken);
await response.Content.ReadAsStringAsync();
}
}
}
FeedbackRecords示例:
[
{
"userId":"xxx",
"userQuestion":"what is your name",
"qnaId":1
}
]
一切正常,并添加了问题,但我必须先在QnA Maker门户中接受添加的问题,才能看到它们。
所以我的问题是如何通过编程方式接受所有问题并重新培训知识库?
答案 0 :(得分:0)