我试图创建DialogFlow新Entity
:错误:资源名称“富”不匹配“项目/ * /剂”
const dialogflow = require('dialogflow');
/**
* trains the NLP to recognize language constructs
*/
export function intTraining() {
const ENTITY_DEFINITION_BOOLEAN = {
parent: 'foo',
entityType: {
displayName: 'myBoolean',
kind: 'KIND_MAP',
autoExpansionMode: 'AUTO_EXPANSION_MODE_UNSPECIFIED',
entities: [
{value: 'true', synonyms: [ 'yes', 'yeah', 'sure', 'okay' ]},
{value: 'false', synonyms: [ 'no', 'no thanks', 'never' ]}
],
},
};
// allocate
const entityTypesClient = new dialogflow.EntityTypesClient();
// declare promises
const promises = [];
// allocate entities
prepareEntity(entityTypesClient, promises, ENTITY_DEFINITION_BOOLEAN);
// execute state initialization
Promise.all(promises);
}
/** Buffers an Entity onto the Promise Queue. */
function prepareEntity(entityTypesClient, promises, definition) {
// boolean entity
promises.push(entityTypesClient
.createEntityType(definition)
.then(responses => { })
.catch(err => { console.error('', err) })
);
}
当我执行该代码,但是,我收到以下错误:
Error: Resource name 'foo' does not match 'projects/*/agent'.
我已经使用gcloud auth application-default login
我的机器上创建API访问凭据,以foo
配置为当前选择的项目,但是这并没有帮助。
我在做什么错?