我正在创建一个聊天机器人,从BigQuery检索数据,但我在Dialogflow中的数据类型遇到了问题:
Dialogflow参数是:Rating(@sys.number-int),Country(string),Department(String)
当我执行下面的代码时,似乎bigquery将Rating作为字符串接收(Country和Department是字符串,在BigQuery中正常工作),所以我尝试过CAST,但没有成功。
有人能帮我从Dialogflow传递INT64变量到BigQuery吗?
Dialogflow参数是:Rating(@sys.number-int),Country(string),Department(String)
当我执行下面的代码时,似乎bigquery将Rating作为字符串接收(Country和Department是字符串,在BigQuery中正常工作),所以我尝试过CAST,但没有成功。
有人能帮我从Dialogflow传递INT64变量到BigQuery吗?
function buyAgainPredictor(agent) {
const OPTIONS = {
query: 'WITH pred_table AS (SELECT CAST(`request.body.queryResult.outputContexts[0].parameters.Rating´ AS INT64) as Rating, "request.body.queryResult.outputContexts[0].parameters.Department" as Department, "request.body.queryResult.outputContexts[0].parameters.Country" as Country)' +
'SELECT cast(predicted_label as INT64) as predicted_label ' +
'FROM ML.PREDICT(MODEL Customer_feedback.recommend_model, TABLE pred_table)',
timeoutMs: 10000,
useLegacySql: false,
queryParameters: {}