当我启动一个事件时,这个调用意图但不会显示在客户端应用程序中

时间:2018-02-15 08:02:35

标签: chatbot dialogflow

我有这个事件: Image of the intent

我在FullFillment中有这个代码:

  function LanzarEvento(session) {
    //var user = firebase.auth().currentUser;
    const uuid = require('uuid');
    const sessionId = uuid.v1();//user.uid;
    
    // Imports the Dialogflow library
    const dialogflow = require('dialogflow');

    // Instantiates a sessison client
    const sessionClient = new dialogflow.SessionsClient();

    // The path to identify the agent that owns the created intent.
    const sessionPath = session;//sessionClient.sessionPath(projectId, sessionId);
    console.log('sessionPath -> ' + sessionPath);
    let responseToUser = {
        'fulfillmentText': 'Voy a buscar los mejores alojamientos, dame unos segundos.'
    };
    sendResponse(responseToUser);

    // The text query request.
    const request = {
        session: sessionPath,
        queryInput: {
            event: {
                name: 'PruebaEvento',
                parameters: jsonToStructProto({user_name: 'Andres',name: 'Andres'}),
                languageCode: languageCode,
            },
        },
    };

    sessionClient
    .detectIntent(request)
    .then(responses => {
        console.log('Detected intent');
        logQueryResult(sessionClient, responses[0].queryResult);
    })
    .catch(err => {
        console.error('ERROR:', err);
    });
  }

这是Dialogflow培训部分的对话: Trainning capture

你怎么看,事件正在回归“Hola Andres”,但这种情况从未出现在Facebook Messenger或Slack中。

拜托,我需要你的帮助。你能救我吗?

提前致谢, 安德烈斯·吉拉伯特

0 个答案:

没有答案
相关问题