You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Bot Composer V2.1中如何将属性值设为LUIS datetimeV2实体的resolution值

Bot Composer V2.1获取datetimeV2实体resolution值的解决方案

Bot Composer V2.1默认仅会将datetimeV2实体的timex字段同步到turn.recognized.entities对象中,resolution字段不会默认映射到该节点,需要从LUIS返回的原始响应对象中读取,具体操作如下:

  • 正确取值的表达式为:
    =turn.recognized.luisResult.prediction.entities.datetimeV2[0].values[0].resolution[0].start
    
    取值逻辑是直接读取LUIS返回的完整原始响应节点turn.recognized.luisResult,而非经过Composer处理后的turn.recognized.entities节点。
  • 若需要避免空值报错,可使用空安全的表达式写法:
    =coalesce(turn.recognized.luisResult.prediction.entities.datetimeV2?[0]?.values?[0]?.resolution?[0]?.start, '')
    
    该表达式在解析不到对应值时会返回空字符串,不会触发运行时错误。
  • 额外校验项:可以登录LUIS管理门户,进入对应应用的实体设置页,确认datetimeV2实体的返回配置中已开启resolution字段返回,该配置默认处于开启状态。

内容的提问来源于stack exchange,提问作者n1k1

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.07 21:39:03