我目前正在尝试使用 Microsoft 的 Bot Framework 编写聊天机器人。我想使用选择提示,但它不会等待我/用户选择一个选项。甚至这里的示例代码都不适合我。请参阅此工作示例:
var restify = require('restify');
var builder = require('botbuilder');
var botbuilder_azure = require("botbuilder-azure");
// Setup Restify Server
var server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function () {
console.log('%s listening to %s', server.name, server.url);
});
// Create chat connector for communicating with the Bot Framework Service
var connector = new builder.ChatConnector({
appId: process.env.MicrosoftAppId,
appPassword: process.env.MicrosoftAppPassword,
openIdMetadata: process.env.BotOpenIdMetadata
});
// Listen for messages from users
server.post('/api/messages', connector.listen());
var bot = new builder.UniversalBot(connector);
bot.set('storage', …Run Code Online (Sandbox Code Playgroud) 如何在上一个 BotChat 对话中禁用输入/提交按钮操作 - Microsoft Bot Framework (C#) 中的 AdaptiveCards
我正在尝试使用 python 在带有 botframework 的 Skype 中创建一个非常简单的机器人。这是我做的步骤。
我通过网络聊天测试了机器人,并且在我的 python 网络服务中得到了一个 json
{
"recipient": {
"id": "txBot@b0X6R31x6uQ",
"name": "txBot"
},
"from": {
"id": "1xFUIEqdQfv",
"name": "You"
},
"entities": [
{
"supportsTts": true,
"supportsListening": true,
"type": "ClientCapabilities",
"requiresBotState": true
}
],
"locale": "en",
"timestamp": "2018-11-22T13:00:42.9086958Z",
"channelId": "webchat",
"channelData": {
"clientActivityId": "1542891640077.5912976099256072.0"
},
"conversation": {
"id": "b5b52b9e464b4e958b1219dadedfffce"
},
"serviceUrl": "https://webchat.botframework.com/",
"text": "hello from test",
"textFormat": "plain",
"type": "message",
"id": "b5b52b9e464b4e958b1219dadedfffce|0000002"
}
Run Code Online (Sandbox Code Playgroud)我能够处理这个 json 并且能够在这个例子中将用户输入“hello …
为了审计/历史目的,我必须在 CosmosDB 中记录用户与机器人的对话。在使用 .Net 的 V3 中,我使用的是表记录器模块,如下面的代码。
builder.RegisterModule(new TableLoggerModule(account, chatHistoryTableName));
现在我们正在 NodeJS 中将机器人升级/重写到 V4。请指导是否有类似的方法可用于 NodeJS 中的 V4 来保存整个对话?
我们已经在我们的企业团队中启用了 Bot Framework 应用程序,我们希望使用它AdaptiveCards向用户呈现丰富的内容。例如,我们发送AdaptiveImage包含指向企业形象商店的 url。
示例代码:
new AdaptiveImage
{
Size = AdaptiveImageSize.Small,
Url = new Uri("https://corporate-storage.com/images/image1.png"), // This is image not hosted publicly.
AltText = "Some text"
}
Run Code Online (Sandbox Code Playgroud)
这在 WebChat 客户端中工作得很好,因为 url 只是附加到HTML 标记src的属性中img。然而,在 MS Teams 中,它似乎是由一些奇怪的代理/MITM 进行预处理的,并且 url 结果如下:
https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fcorporate-proxy.com%2fimages%2fimage1.png
当我们尝试浏览 url 以查看图片未渲染的原因时,我们在调试器中看到带有 502 响应代码的空白页面。
有没有办法强制 MS Teams 不更改src图片属性。
尝试创建托管在 Web 应用程序上的机器人服务时,在尝试部署到存在现有 Linux 应用程序服务计划的资源组时遇到错误。我并没有尝试在该 ASP 上托管我的 Bot 服务,只是尝试为 Bot 服务部署新的 ASP,但出现以下错误:

考虑到资源组设计,如果我想要任何机器人服务 Web 应用程序,我是否无法将它们部署在具有 Linux ASP 的资源组中?
我似乎无法让 Azure Bot Framework Emulator 与 Ngork 一起使用。
环境 :
我遵循的步骤:
{
"error_code": 102,
"status_code": 400,
"msg": "invalid tunnel configuration",
"details":
{ …Run Code Online (Sandbox Code Playgroud) BotFrameworkAdapter已被弃用,CloudAdapter是替代品,因此我们必须移植我们的机器人。
已搜索所有 Microsoft 和 BotBuilder 站点,但找不到任何描述新适配器优点的文档以及任何移植指南。(是的,有示例echobot代码,但没有更改的背景或上下文)
例如,对于使用 Azure AD 进行身份验证的 Botbuilder 构建的自托管 C#/.NET Teams Bot,当我们移植到新适配器时会获得哪些新功能?
有任何性能提升吗?
对于那些已成功将 Teams 机器人移植到 CloudAdapter 的人来说,是否有任何陷阱或学习内容可以让其他人开始执行此任务?
该机器人在 2023 年 9 月 26 日之前一直运行良好。从今天开始,我看到一个错误
RestError: Failed to decrypt conversation id
at new RestError (webpack://workflow/./node_modules/@azure/ms-rest-js/es/lib/restError.js?:12:28)
at eval (webpack://workflow/./node_modules/@azure/ms-rest-js/es/lib/policies/deserializationPolicy.js?:116:37)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Function.getUserInfoFromContext (webpack://workflow/./src/msTeams/helpers/utils.ts?:53:20)
at async Array.eval (webpack://workflow/./src/msTeams/teamsBot.ts?:41:31) {
code: 'BadArgument',
statusCode: 403,
request: WebResource {
streamResponseBody: false,
url: 'https://smba.trafficmanager.net/in/v3/conversations/a%3A1WbgJK2VMFJ98rna-P-r4r_yFfqrfm2I5z1M30nwXUCOWy1qLzSUx7ohZErhkNLuSwTJhzoVfXqJvNsEA2RjakN3FbJ-8JbwKICzdShrSsIf2QCJHxBW1_mK-aMFzYlrK/members/29%3A19s7N49yDmzdeN0e0VANE7DyQTUrOwmDF-_rBZ-4yL5hgYf_vYHrIv8PdV8fgiJqwnOYSRyR57hmWV96OzIcXhQ',
method: 'GET',
headers: HttpHeaders { _headersMap: [Object] },
body: undefined,
query: undefined,
formData: undefined,
withCredentials: false,
abortSignal: undefined,
timeout: 0,
onUploadProgress: undefined,
onDownloadProgress: undefined,
proxySettings: undefined,
keepAlive: undefined,
agentSettings: undefined,
redirectLimit: undefined,
operationSpec: {
httpMethod: 'GET',
path: …Run Code Online (Sandbox Code Playgroud)