@@ -26,19 +26,19 @@ function createKnowledgeBase(projectId, displayName) {
2626 const dialogflow = require ( 'dialogflow' ) . v2beta1 ;
2727
2828 // Instantiate a DialogFlow client.
29- var client = new dialogflow . KnowledgeBasesClient ( ) ;
29+ let client = new dialogflow . KnowledgeBasesClient ( ) ;
3030
3131 /**
3232 * TODO(developer): Uncomment the following lines before running the sample.
3333 */
3434 // const projectId = 'ID of GCP project associated with your Dialogflow agent';
3535 // const displayName = `your knowledge base display name, e.g. myKnowledgeBase`;
3636
37- var formattedParent = client . projectPath ( projectId ) ;
38- var knowledgeBase = {
37+ let formattedParent = client . projectPath ( projectId ) ;
38+ let knowledgeBase = {
3939 displayName : displayName ,
4040 } ;
41- var request = {
41+ let request = {
4242 parent : formattedParent ,
4343 knowledgeBase : knowledgeBase ,
4444 } ;
@@ -62,7 +62,7 @@ function getKnowledgeBase(projectId, knowledgeBaseId) {
6262 const dialogflow = require ( 'dialogflow' ) . v2beta1 ;
6363
6464 // Instantiate a DialogFlow client.
65- var client = new dialogflow . KnowledgeBasesClient ( {
65+ let client = new dialogflow . KnowledgeBasesClient ( {
6666 projectId : projectId ,
6767 } ) ;
6868
@@ -71,7 +71,7 @@ function getKnowledgeBase(projectId, knowledgeBaseId) {
7171 */
7272 // const projectId = 'ID of GCP project associated with your Dialogflow agent';
7373 // const knowledgeBaseFullName = `the full path of your knowledge base, e.g my-Gcloud-project/myKnowledgeBase`;
74- var formattedName = client . knowledgeBasePath ( projectId , knowledgeBaseId ) ;
74+ let formattedName = client . knowledgeBasePath ( projectId , knowledgeBaseId ) ;
7575 client
7676 . getKnowledgeBase ( {
7777 name : formattedName ,
@@ -93,7 +93,7 @@ function listKnowledgeBases(projectId) {
9393 const dialogflow = require ( 'dialogflow' ) . v2beta1 ;
9494
9595 // Instantiate a DialogFlow KnowledgeBasesClient.
96- var client = new dialogflow . KnowledgeBasesClient ( {
96+ let client = new dialogflow . KnowledgeBasesClient ( {
9797 projectPath : projectId ,
9898 } ) ;
9999
@@ -102,12 +102,12 @@ function listKnowledgeBases(projectId) {
102102 */
103103 // const projectId = 'ID of GCP project associated with your Dialogflow agent';
104104
105- var formattedParent = client . projectPath ( projectId ) ;
105+ let formattedParent = client . projectPath ( projectId ) ;
106106
107107 client
108108 . listKnowledgeBases ( { parent : formattedParent } )
109109 . then ( responses => {
110- var resources = responses [ 0 ] ;
110+ let resources = responses [ 0 ] ;
111111 resources . forEach ( r => {
112112 console . log ( `displayName: ${ r . displayName } ` ) ;
113113 console . log ( `name: ${ r . name } ` ) ;
@@ -125,7 +125,7 @@ function deleteKnowledgeBase(projectId, knowledgeBaseFullName) {
125125 const dialogflow = require ( 'dialogflow' ) . v2beta1 ;
126126
127127 // Instantiate a DialogFlow KnowledgeBasesClient.
128- var client = new dialogflow . KnowledgeBasesClient ( ) ;
128+ let client = new dialogflow . KnowledgeBasesClient ( ) ;
129129
130130 /**
131131 * TODO(developer): Uncomment the following lines before running the sample.
@@ -160,7 +160,7 @@ function createDocument(
160160 const dialogflow = require ( 'dialogflow' ) . v2beta1 ;
161161
162162 // Instantiate a DialogFlow Documents client.
163- var client = new dialogflow . DocumentsClient ( {
163+ let client = new dialogflow . DocumentsClient ( {
164164 projectId : projectId ,
165165 } ) ;
166166
@@ -174,7 +174,7 @@ function createDocument(
174174 // const knowledgeTypes = `The Knowledge type of the Document. e.g. FAQ`;
175175 // const mimeType = `The mime_type of the Document. e.g. text/csv, text/html,text/plain, text/pdf etc.`;
176176
177- var request = {
177+ let request = {
178178 parent : knowledgeBaseFullName ,
179179 document : {
180180 knowledgeTypes : [ knowledgeTypes ] ,
@@ -212,7 +212,7 @@ function listDocuments(projectId, knowledgeBaseFullName) {
212212 const dialogflow = require ( 'dialogflow' ) . v2beta1 ;
213213
214214 // Instantiate a DialogFlow Documents client.
215- var client = new dialogflow . DocumentsClient ( {
215+ let client = new dialogflow . DocumentsClient ( {
216216 projectId : projectId ,
217217 } ) ;
218218
@@ -225,7 +225,7 @@ function listDocuments(projectId, knowledgeBaseFullName) {
225225 client
226226 . listDocuments ( { parent : knowledgeBaseFullName } )
227227 . then ( responses => {
228- var resources = responses [ 0 ] ;
228+ let resources = responses [ 0 ] ;
229229 console . log (
230230 `There are ${ resources . length } documents in ${ knowledgeBaseFullName } `
231231 ) ;
@@ -250,7 +250,7 @@ function getDocument(documentId) {
250250 const dialogflow = require ( 'dialogflow' ) . v2beta1 ;
251251
252252 // Instantiate a DialogFlow Documents client.
253- var client = new dialogflow . DocumentsClient ( {
253+ let client = new dialogflow . DocumentsClient ( {
254254 projectId : projectId ,
255255 } ) ;
256256
@@ -262,7 +262,7 @@ function getDocument(documentId) {
262262 client
263263 . getDocument ( { name : documentId } )
264264 . then ( responses => {
265- var r = responses [ 0 ] ;
265+ let r = responses [ 0 ] ;
266266 console . log ( ` KnowledgeType: ${ r . knowledgeType } ` ) ;
267267 console . log ( ` displayName: ${ r . displayName } ` ) ;
268268 console . log ( ` mimeType: ${ r . mimeType } ` ) ;
@@ -282,7 +282,7 @@ function deleteDocument(projectId, documentId) {
282282 const dialogflow = require ( 'dialogflow' ) . v2beta1 ;
283283
284284 // Instantiate a DialogFlow Documents client.
285- var client = new dialogflow . DocumentsClient ( {
285+ let client = new dialogflow . DocumentsClient ( {
286286 projectId : projectId ,
287287 } ) ;
288288
@@ -295,7 +295,7 @@ function deleteDocument(projectId, documentId) {
295295 client
296296 . deleteDocument ( { name : documentId } )
297297 . then ( responses => {
298- var operation = responses [ 0 ] ;
298+ let operation = responses [ 0 ] ;
299299 return operation . promise ( ) ;
300300 } )
301301 . then ( responses => {
0 commit comments