Skip to content
This repository was archived by the owner on Aug 16, 2023. It is now read-only.
This repository was 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

@ujja

Description

@ujja

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions