Bixby 函数中收到未定义的参数
undefined parameter received in Bixby function
我正在尝试处理格式为 "Get News from Impeachment Sage" 的话语,其中 Impeachment Sage 对应于出版物名称的枚举。 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
}
}
}
我们离线解决了这个问题,只是想在 public 频道上跟进任何看到此问题的 Bixby 开发人员。调用'getNewsByName'的函数需要接收入参。填充后,操作成功。
我正在尝试处理格式为 "Get News from Impeachment Sage" 的话语,其中 Impeachment Sage 对应于出版物名称的枚举。 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
}
}
}
我们离线解决了这个问题,只是想在 public 频道上跟进任何看到此问题的 Bixby 开发人员。调用'getNewsByName'的函数需要接收入参。填充后,操作成功。