Azure问题回答机器人 - 如何添加身份验证?

发布于 2025-01-29 16:33:41 字数 2361 浏览 4 评论 0 原文

我创建了一个基本的Azure“自定义问题回答” bot( https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/question-service/question-swering/question-swering/quickstart/sdk?pivots?pivots=studio )。我通过语言工作室创建了机器人: 通过语言工作室创建bot

我想添加身份验证,以便只有拥有我的用户是我的一部分Azure AD能够与机器人交互。我已经尝试遵循以下列出的教程:

我无法遵循这些教程,因为它们认为该机器人是从以下任何一个代码库中构建的:

我通过语言工作室部署的机器人看起来是从以下框架中构建的:

如何将身份验证添加到我通过Azure Language Studio (认知服务)部署的自定义问题的身份验证?目前,任何人都会与我的机器人互动。

谢谢

I have created a basic Azure 'Custom Question Answering' bot (https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/question-answering/quickstart/sdk?pivots=studio). I created the bot through Language Studio:
bot creation through language studio

I want to add authentication so that only users with who are part of my Azure AD are able to interact with the bot. I've tried following the tutorials listed below:

I've not been able to follow these tutorials, as they assume the bot is built from either of the following code bases:

Whereas the bot that I deployed through Language Studio looks like it is built from the following framework:

How can I add authentication to the custom question answering bot I deployed through Azure Language Studio (Cognitive services)? Currently anyone would be bale to interact with my bot.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

紫竹語嫣☆ 2025-02-05 16:33:41

为了添加身份验证,需要使用Python编程安装库支持。

pip install azure-ai-language-questionanswering

添加上面的库以开始身份验证过程。

与客户端进行身份验证

从Azure认知服务中获取API密钥。

az cognitiveservices account keys list --resource-group <resource-group-name> --name <resource-name>

要实例化询问Answerclient

from azure.core.credentials import AzureKeyCredential
from azure.ai.language.questionanswering import QuestionAnsweringClient

endpoint = "https://{myaccount}.api.cognitive.microsoft.com"
credential = AzureKeyCredential("{api-key}")

client = QuestionAnsweringClient(endpoint, credential)

以获取进一步的参考,请检查下面的链接:

https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell

To add authentication, there is a need to install a library supportive with Python Programming.

pip install azure-ai-language-questionanswering

Add the above library to start authentication process.

Authenticate with Client

Get an API key from Azure Cognitive Services.

az cognitiveservices account keys list --resource-group <resource-group-name> --name <resource-name>

To Instantiate QuestioningAnswerClient

from azure.core.credentials import AzureKeyCredential
from azure.ai.language.questionanswering import QuestionAnsweringClient

endpoint = "https://{myaccount}.api.cognitive.microsoft.com"
credential = AzureKeyCredential("{api-key}")

client = QuestionAnsweringClient(endpoint, credential)

For further reference, Check the below link:

https://pypi.org/project/azure-ai-language-questionanswering/

https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell

护你周全 2025-02-05 16:33:41

由于这些都是样本,因此它们都是为了简单起见而设计的。您需要做的实际上是直接的(在概念上,如果不是总是在实践中)。您应该查看AUTH样本的代码和文档,并将身份验证部分与CQA Bot集成。另外,您可以将CQA部分与Auth Bot集成。无论您从哪个基础开始,目标都是相同的。结合两个。

Since these are all samples, they're all designed to do one thing for simplicity's sake. What you need to do is actually straightforward (in concept, if not always in practice). You should look at the code and docs of the auth samples and integrate the authentication sections with your CQA bot. Alternatively, you could integrate the CQA sections with an auth bot. Regardless of which base you start with, the goal is the same. Combine the two.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文