bixby - Bixby 函数中收到未定义的参数
问题描述
我正在尝试处理格式为“从弹劾圣人获取新闻”的话语,其中弹劾圣人对应于出版物名称的枚举。Bixby 成功地理解了话语并试图调用我的目标 (GetNewsByName),但经过训练的值没有到达函数。(这是基于用户持久性数据示例)。
因此,函数的操作部分是:
function getNewsByName(altBrainsNames) {
// const name = "Impeachment Sage" //hard coded for testing
const url = properties.get("config", "baseUrl") + "altbrains"
console.log("i got to restdb.js and the url is ", url);
console.log("AltBrainsNames is", altBrainsNames)
const query = {
apikey: properties.get("secret", "apiKey"),
q: "{\"" + "name" + "\":\"" + name + "\"}"
// q: "{}"
}
console.log("query", query)
const options = {
format: "json",
query: query,
cacheTime: 0
}
const response = http.getUrl(url, options)
if (response) {
const content1 = response
// const altBrainsData = response[0][properties.get("config", "altbrainsName")]
// altbrainsData.$id = response[0]["_id"]
console.log('content1', content1);
console.log('identifier', content1)
return content1
} else {
// Doesn't exist
console.log('doesnae exist');
return
}
}
值没有达到函数的地方发生了什么?
动作模型是:
action (GetNewsByName) {
description ("Get news data from remote Content db by searching on AltBrain name")
type (Calculation)
output (Content)
collect {
input (altBrainsNames) {
type (AltBrainsNames)
min (Required) max (One) //this means js must catch error when multiple names offered
}
}
}
解决方案
推荐阅读
- episerver - Episerver geta categories 插件在加载时冻结页面
- applescript - Applescript:pdf到pptx的转换
- docker - Rabbitmq 日志记录选项不适用于 docker
- python-3.x - 使用 .bash_profile 更改默认 PYTHONPATH 会引发“找不到图像”错误
- python - 更改动画线图中沿线移动的标记的大小
- python - 比较groupby中不同行的值
- rest - 在 Loopback 4 中实现批量删除的正确方法是什么?
- ios - 命令 PhaseScriptExecution 失败,退出代码非零,构建应用程序
- java - Android Mapbox NavigationView 样式
- vue.js - Nuxt 显示 2 个 Vue 运行实例