如何使用QNA和Sharepoint配置将python azure聊天机器人部署到azure应用程序服务?

2024-06-16 15:04:01 发布

您现在位置:Python中文网/ 问答频道 /正文

我在聊天机器人中工作,我必须将用户基本信息保存到sharepoint列表中,并使用QNA中的知识库回答常见问题。 我使用python实现了这两个部分,并且它在Bot仿真器(localy)中工作。 请查看附件, enter image description here 我的config.py

class DefaultConfig:
    """ Bot Configuration """

    PORT = 3978
    #########server
    APP_ID = "xxxxxxxxxxxxxxxxxxxxxx"
    APP_PASSWORD = "xxxxxxxxxxxxxxxxxxxxx"

    QNA_KNOWLEDGEBASE_ID = "xxxxxxxxxxxxxxxxxxxx"
    QNA_ENDPOINT_KEY = "xxxxxxxxxxxxxxxxxxxx"
    QNA_ENDPOINT_HOST = "xxxxxxxxxxxxxxxxxxxxxxxxxxx"
    ####ExpireAfterSeconds
    EXPIRE_AFTER_SECONDS = 30

它在服务器中单独使用QNA部件时运行良好。我从vs代码到azure应用程序服务进行了部署,并在团队和webchat频道中对此部分进行了测试。 后来,我使用shareplum库将用户保存部分添加到sharepoint,它在Bot Emulator中工作得非常好。 不幸的是,当我尝试在服务器中部署它并在webchat中进行测试时,它显示错误“将此消息发送到您的bot时出错:HTTP状态代码ServiceUnavailable” 是因为sharepoint配置吗?如何在config.py中更新sharepoint配置? 请查找Azure应用程序服务配置, enter image description here

我遵循的代码模板是,
https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/python/11.qnamakerhttps://github.com/microsoft/BotBuilder-Samples/tree/main/samples/python/44.prompt-for-user-input


Tags: 代码用户py服务器idconfigapp应用程序