我已经升级到最新版本的botframework并开始收到错误:
哎呀,好像出了点问题。错误:[错误] D:\home\site\wwwroot\Dialogs\RootDialog\LG\en\RootDialog_en.lg 第 15:2 行 - 第 15:69 行:解析表达式 'json(fromFile('.../.../Cards/en/OnChooseIntentAdaptiveCard.json')'时出错。fromFile 没有计算器,它不是内置函数或自定义函数。
乐金代码:
# AdaptiveCard
[Activity
Attachments = ${json(AdaptiveCard.Definition())}
]
# AdaptiveCard.Definition
- ${json(fromFile('../../Cards/en/OnChooseIntentAdaptiveCard.json'))}
# chooseIntentResponseWithCard_en()
[Activity
Attachments = ${ActivityAttachment(json(fromFile('../../Cards/en/OnChooseIntentAdaptiveCard.json')), 'adaptiveCard')}
]
# Greeting_en()
[Activity
Attachments = ${ActivityAttachment(json(fromFile('../../Cards/en/GreetingCard.json')), 'adaptiveCard')}
AttachmentLayout = list
]
我错过了什么?
fromFile
现在默认处于禁用状态。您可以更改 Microsoft.Bot.Builder.LanguageGeneration.Templates 类上的值设置:
Templates.EnableFromFile = true;