在微搭自定义链接器中,选择 自定义代码,把官方录音文件识别结果查询的餐卡代码放进去,点击测试时报错,Cannot read property 'then' of undefined ,谁知道是什么原因么?
方法代码:
// Depends on tencentcloud-sdk-nodejs version 4.0.3 or higher
const tencentcloud = require("tencentcloud-sdk-nodejs");
const AsrClient = tencentcloud.asr.v20190614.Client;
// 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey,此处还需注意密钥对的保密
// 密钥可前往https://console.cloud.tencent.com/cam/capi网站进行获取
const clientConfig = {
credential: {
secretId: "SecretId",
secretKey: "SecretKey",
},
region: "",
profile: {
httpProfile: {
endpoint: "asr.tencentcloudapi.com",
},
},
};
// 实例化要请求产品的client对象,clientProfile是可选的
const client = new AsrClient(clientConfig);
const params = {};
client.DescribeTaskStatus(params).then(
(data) => {
console.log(data);
},
(err) => {
console.error("error", err);
}
);
相似问题