为什么我从文件中得到错误而不是 botframework 中的内置函数
Why do I get the error fromFile not a built-in function in botframework
我已经升级到最新版本的botframework,开始报错:
糟糕,好像出了点问题。 Error:[Error] D:\home\site\wwwroot\Dialogs\RootDialog\LG\en\RootDialog_en.lg line 15:2 - line 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
]
我错过了什么?
fromFile
是 now disabled by default。您可以更改 Microsoft.Bot.Builder.LanguageGeneration.Templates class:
上的设置值
Templates.EnableFromFile = true;
我已经升级到最新版本的botframework,开始报错:
糟糕,好像出了点问题。 Error:[Error] D:\home\site\wwwroot\Dialogs\RootDialog\LG\en\RootDialog_en.lg line 15:2 - line 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
]
我错过了什么?
fromFile
是 now disabled by default。您可以更改 Microsoft.Bot.Builder.LanguageGeneration.Templates class:
Templates.EnableFromFile = true;