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?