Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Error "Interaction did not trigger the preview of an action" but sendInteraction() is called #6

Open
ujja opened this issue Jun 9, 2021 · 0 comments

Comments

@ujja
Copy link

ujja commented Jun 9, 2021

As I see there are some bugs in readme

1, reviewSettings -> previewSettings

async function writePreviewFromDraft(projectId = 'your-project-id') {
  // Create request payload
  const request = {
    parent: `projects/${projectId}`,
    reviewSettings: {sandbox: {value: true}},

see:

                interface IWritePreviewRequest {

                    /** WritePreviewRequest parent */
                    parent?: (string|null);

                    /** WritePreviewRequest previewSettings */
                    previewSettings?: (google.actions.sdk.v2.WritePreviewRequest.IPreviewSettings|null);

2, parent -> project (just in sendIteraction, in writePreview is it parent)

async function sendInteraction(projectId = 'your-project-id', queryText = 'example query text') {
  const request = {
    parent: `projects/${projectId}`,
    input: {query: queryText}
  };

see:

                interface ISendInteractionRequest {

                    /** SendInteractionRequest project */
                    project?: (string|null);

3 So i use this payload for sendInteraction

  const request = {
    // parent: `projects/${projectId}`,
    project: `projects/${projectId}`,
    input: {
      type: 'VOICE',
      query: 'Parler avec audiobooks'
    },
    deviceProperties: {
      surface: 'SMART_DISPLAY',
      location: {
        coordinates: {
          latitude: -90.0,
          longitude: -90.0
        },
        formattedAddress: '1600 Amphitheatre Pkwy, Mountain View, CA 94043',
        zipCode: '94043',
        city: 'Mountain View'
      },
      locale: 'en',
      timeZone: 'America/New_York'
    }

  }

but got

{"code":3,"details":"Interaction did not trigger the preview of an action.","metadata":{"internalRepr":{},"options":{}}}

And I call the writePreviewFromDraft before. What can be the problem?

@ujja ujja changed the title What is the correct payload for sendInteraction? (Interaction did not trigger the preview of an action) Error "Interaction did not trigger the preview of an action" but sendInteraction() is called Aug 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant