最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

dialogflow cx - Passing parameters from API to Playbook (Routine) - Stack Overflow

programmeradmin1浏览0评论

Given the following API implementation:

const session = client.projectLocationAgentSessionPath(
      this.projectId,
      this.location,
      this.agentId,
      this.requestData.sessionId
    );

    const request = {
      session,
      queryInput: {
        text: {
          text: this.requestData.query,
        },
        languageCode: this.requestData.languageCode || 'en-US',
      },
      queryParams: {
        parameters: {
          fields: {
            uid: { stringValue: this.requestData.uid },
            conversationId: { stringValue: this.requestData.sessionId },
            token: { stringValue: '1234567890' }
          }
        }
      }
    };
    return client.serverStreamingDetectIntent(request);

I would like to know how to access the parameters that have been passed to the Playbook. Here is the plabook screnshot:

It's not clear how to access the parameters in the Playbooks instructions. If I try to use uid - $session.uid it doesn't work, the values returned are random. For example, I'm trying to pass the uid to a Tool which needs it in order to save the profile information it collects to a specific user based on their UID. E.g:

- If the user says save the profile, then send the profile information and uid using ${TOOL:Save Profile}

The profile info is captured during the conversation and it is successfully sent to the TOOL however, the UID is completely fictional and random. It doesn't use the input parameter value.

发布评论

评论列表(0)

  1. 暂无评论