0

我已经升级到最新版本的 botframework 并开始收到错误:

糟糕,好像出了点问题。错误:[错误] D:\home\site\wwwroot\Dialogs\RootDialog\LG\en\RootDialog_en.lg 第 15:2 行 - 第 15:69 行:解析表达式 'json(fromFile('.../.../ Cards/en/OnChooseIntentAdaptiveCard.json'))'。fromFile 没有评估器,它不是内置函数或自定义函数。

LG 代码:


# 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
]

我错过了什么?

4

1 回答 1

1

fromFile现在默认禁用。您可以更改设置 Microsoft.Bot.Builder.LanguageGeneration.Templates 类的值:

Templates.EnableFromFile = true;

于 2021-12-07T23:11:54.330 回答