问题
UPDATE and GitHub Examples
To see the code of the sample on Speech to Text see the Microsoft Bot Builder GitHub. I have some personal examples on my GitHub as well starting with myLUISBankingBot.
Original Post
Trouble getting started with the Example Speech to Text Bot. In the code snippet it asks for a clientid and clientSecret, but I am not sure where to find these. In my Free Subscriptions (Bing Search - Free in particular) I have only a Key 1 and Key 2, not sure where the clientid and clientSecret information could live. I believe I can not move forward in the tutorial unless some help is given on where I can find the clientid and clientSecret information.
Thanks for the help! Happy botting!
回答1:
Greg, glad you figured it out on your own. My team wrote the example and the new sample code in Github. I understand the confusion. We'll make some edits to make the mapping of userid->clientid and apikey->clientsecret more clear. Thanks for posting!
回答2:
Suuuuper simple oversight here. The naming threw me off in the code sample, but check it!
tl;dr
UserID = clientID
ApiKey = clientSecret
The class header for the Authentication class has params clientId and clientSecret... but wait a minutes...
public Authentication(string clientId, string clientSecret)
When making an instance of an Authentication, the current code snippet as of the writing of this post has the params for you to the fill in as
YOURUSERID
and
<YOUR API KEY FROM MICROSOFT.COM/COGNITIVE
Authentication auth = new Authentication("YOURUSERID", "<YOUR API KEY FROM MICROSOFT.COM/COGNITIVE");
So another way of looking at this is :
YOURUSERID = clientID
<YOUR API KEY FROM MICROSOFT.COM/COGNITIVE = clientSecret
That's it.
来源:https://stackoverflow.com/questions/39884809/microsoft-bot-framework-example-speech-to-text-bot-clientid-and-clientsecret