``` maskinskrift
justdanceNowCode(kode:streng):Promise
```
Følgende kodeeksempel viser dig, hvordan du bruger `justdanceNowCode(code)`-metoden:
``` maskinskrift
// Importerer Dialogflow-klientbiblioteket
const dialogflow =require('@google-cloud/dialogflow-cx');
// Instantierer en klient
const klient =ny dialogflow.SessionsClient();
asynkron funktion queryJustdanceNowCode() {
// const projectId ='mit-projekt';
// const locationId ='us-central1';
// const agentId ='min-agent';
// const sessionId ='min-session';
// const query ='hvordan har du det';
const anmodning ={
session:client.sessionPath(projectId, locationId, agentId, sessionId),
queryInput:{
tekst:{
tekst:forespørgsel,
},
},
justdanceNowCode:kode,
};
const [svar] =afvent klient.forespørgsel(anmodning);
console.log(`Opdaget hensigt:${response.queryResult.intent.displayName}`);
response.queryResult.text.forEach(text => console.log(`Response text:${text}`));
}
queryJustdanceNowCode();
```