How to import a dialogflow zip using an API

你。 提交于 2019-12-25 01:48:11

问题


I've got a C# project and the dialogflow google api reference added in it.

using Google.Cloud.Dialogflow.V2;

And I want to know if I can use that to import a zip to my dialogflow agent.

Using the Dialogflow Web Console I can do this:

Would be great if I could achieve this functionality in C# somehow.

Any help / advice would be appreciated.


回答1:


I'd expect that to be a matter of calling AgentsClient.ImportAgent, e.g.

var zipFile = File.ReadAllBytes("agent.zip");
var zipByteString = ByteString.CopyFrom(zipFile);
var client = AgentsClient.Create();
var request = new ImportAgentRequest
{
    ParentAsProjectName = new ProjectName("[YOUR PROJECT ID]")
    AgentContent = zipByteString
};
var operation = client.ImportAgent(client);
operation.PollUntilCompleted();


来源:https://stackoverflow.com/questions/57480321/how-to-import-a-dialogflow-zip-using-an-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!