Skip to content

Commit

Permalink
Run the synth generator and update config (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored Sep 19, 2018
1 parent cbec497 commit ab061e1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19,902 deletions.
36 changes: 18 additions & 18 deletions dialogflow/detect.v2beta1.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ function createKnowledgeBase(projectId, displayName) {
const dialogflow = require('dialogflow').v2beta1;

// Instantiate a DialogFlow client.
var client = new dialogflow.KnowledgeBasesClient();
let client = new dialogflow.KnowledgeBasesClient();

/**
* TODO(developer): Uncomment the following lines before running the sample.
*/
// const projectId = 'ID of GCP project associated with your Dialogflow agent';
// const displayName = `your knowledge base display name, e.g. myKnowledgeBase`;

var formattedParent = client.projectPath(projectId);
var knowledgeBase = {
let formattedParent = client.projectPath(projectId);
let knowledgeBase = {
displayName: displayName,
};
var request = {
let request = {
parent: formattedParent,
knowledgeBase: knowledgeBase,
};
Expand All @@ -62,7 +62,7 @@ function getKnowledgeBase(projectId, knowledgeBaseId) {
const dialogflow = require('dialogflow').v2beta1;

// Instantiate a DialogFlow client.
var client = new dialogflow.KnowledgeBasesClient({
let client = new dialogflow.KnowledgeBasesClient({
projectId: projectId,
});

Expand All @@ -71,7 +71,7 @@ function getKnowledgeBase(projectId, knowledgeBaseId) {
*/
// const projectId = 'ID of GCP project associated with your Dialogflow agent';
// const knowledgeBaseFullName = `the full path of your knowledge base, e.g my-Gcloud-project/myKnowledgeBase`;
var formattedName = client.knowledgeBasePath(projectId, knowledgeBaseId);
let formattedName = client.knowledgeBasePath(projectId, knowledgeBaseId);
client
.getKnowledgeBase({
name: formattedName,
Expand All @@ -93,7 +93,7 @@ function listKnowledgeBases(projectId) {
const dialogflow = require('dialogflow').v2beta1;

// Instantiate a DialogFlow KnowledgeBasesClient.
var client = new dialogflow.KnowledgeBasesClient({
let client = new dialogflow.KnowledgeBasesClient({
projectPath: projectId,
});

Expand All @@ -102,12 +102,12 @@ function listKnowledgeBases(projectId) {
*/
// const projectId = 'ID of GCP project associated with your Dialogflow agent';

var formattedParent = client.projectPath(projectId);
let formattedParent = client.projectPath(projectId);

client
.listKnowledgeBases({parent: formattedParent})
.then(responses => {
var resources = responses[0];
let resources = responses[0];
resources.forEach(r => {
console.log(`displayName: ${r.displayName}`);
console.log(`name: ${r.name}`);
Expand All @@ -125,7 +125,7 @@ function deleteKnowledgeBase(projectId, knowledgeBaseFullName) {
const dialogflow = require('dialogflow').v2beta1;

// Instantiate a DialogFlow KnowledgeBasesClient.
var client = new dialogflow.KnowledgeBasesClient();
let client = new dialogflow.KnowledgeBasesClient();

/**
* TODO(developer): Uncomment the following lines before running the sample.
Expand Down Expand Up @@ -160,7 +160,7 @@ function createDocument(
const dialogflow = require('dialogflow').v2beta1;

// Instantiate a DialogFlow Documents client.
var client = new dialogflow.DocumentsClient({
let client = new dialogflow.DocumentsClient({
projectId: projectId,
});

Expand All @@ -174,7 +174,7 @@ function createDocument(
// const knowledgeTypes = `The Knowledge type of the Document. e.g. FAQ`;
// const mimeType = `The mime_type of the Document. e.g. text/csv, text/html,text/plain, text/pdf etc.`;

var request = {
let request = {
parent: knowledgeBaseFullName,
document: {
knowledgeTypes: [knowledgeTypes],
Expand Down Expand Up @@ -212,7 +212,7 @@ function listDocuments(projectId, knowledgeBaseFullName) {
const dialogflow = require('dialogflow').v2beta1;

// Instantiate a DialogFlow Documents client.
var client = new dialogflow.DocumentsClient({
let client = new dialogflow.DocumentsClient({
projectId: projectId,
});

Expand All @@ -225,7 +225,7 @@ function listDocuments(projectId, knowledgeBaseFullName) {
client
.listDocuments({parent: knowledgeBaseFullName})
.then(responses => {
var resources = responses[0];
let resources = responses[0];
console.log(
`There are ${resources.length} documents in ${knowledgeBaseFullName}`
);
Expand All @@ -250,7 +250,7 @@ function getDocument(documentId) {
const dialogflow = require('dialogflow').v2beta1;

// Instantiate a DialogFlow Documents client.
var client = new dialogflow.DocumentsClient({
let client = new dialogflow.DocumentsClient({
projectId: projectId,
});

Expand All @@ -262,7 +262,7 @@ function getDocument(documentId) {
client
.getDocument({name: documentId})
.then(responses => {
var r = responses[0];
let r = responses[0];
console.log(` KnowledgeType: ${r.knowledgeType}`);
console.log(` displayName: ${r.displayName}`);
console.log(` mimeType: ${r.mimeType}`);
Expand All @@ -282,7 +282,7 @@ function deleteDocument(projectId, documentId) {
const dialogflow = require('dialogflow').v2beta1;

// Instantiate a DialogFlow Documents client.
var client = new dialogflow.DocumentsClient({
let client = new dialogflow.DocumentsClient({
projectId: projectId,
});

Expand All @@ -295,7 +295,7 @@ function deleteDocument(projectId, documentId) {
client
.deleteDocument({name: documentId})
.then(responses => {
var operation = responses[0];
let operation = responses[0];
return operation.promise();
})
.then(responses => {
Expand Down
Loading

0 comments on commit ab061e1

Please sign in to comment.