Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-066
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
2022-066
2022-066
Commits
6fe22cd6
Commit
6fe22cd6
authored
Oct 08, 2022
by
Navodya Pasqual
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Text file output
parent
8531d68a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
Backend/Node/output.txt
Backend/Node/output.txt
+1
-0
Backend/Node/src/routes/digitalHuman/dialogFlow.js
Backend/Node/src/routes/digitalHuman/dialogFlow.js
+10
-2
No files found.
Backend/Node/output.txt
0 → 100644
View file @
6fe22cd6
Abstraction is a very important feature of OOPs that allows displaying only the important information and hiding the implementation details.
\ No newline at end of file
Backend/Node/src/routes/digitalHuman/dialogFlow.js
View file @
6fe22cd6
const
express
=
require
(
'
express
'
);
const
express
=
require
(
'
express
'
);
const
router
=
express
.
Router
();
const
router
=
express
.
Router
();
const
dialogflow
=
require
(
'
dialogflow
'
);
const
dialogflow
=
require
(
'
dialogflow
'
);
fs
=
require
(
'
fs
'
);
const
config
=
require
(
'
../../config/digitalHuman/config
'
);
const
config
=
require
(
'
../../config/digitalHuman/config
'
);
const
projectId
=
config
.
googleProjectID
const
projectId
=
config
.
googleProjectID
...
@@ -39,6 +39,14 @@ router.post('/textQuery', async (req, res) => {
...
@@ -39,6 +39,14 @@ router.post('/textQuery', async (req, res) => {
console
.
log
(
` Query:
${
result
.
queryText
}
`
);
console
.
log
(
` Query:
${
result
.
queryText
}
`
);
console
.
log
(
` Response:
${
result
.
fulfillmentText
}
`
);
console
.
log
(
` Response:
${
result
.
fulfillmentText
}
`
);
fs
.
writeFile
(
'
output.txt
'
,
result
.
fulfillmentText
,
function
(
err
,
data
)
{
if
(
err
)
{
return
console
.
log
(
err
);
}
console
.
log
(
data
);
});
res
.
send
(
result
)
res
.
send
(
result
)
})
})
...
@@ -63,7 +71,7 @@ router.post('/eventQuery', async (req, res) => {
...
@@ -63,7 +71,7 @@ router.post('/eventQuery', async (req, res) => {
const
result
=
responses
[
0
].
queryResult
;
const
result
=
responses
[
0
].
queryResult
;
console
.
log
(
` Query:
${
result
.
queryText
}
`
);
console
.
log
(
` Query:
${
result
.
queryText
}
`
);
console
.
log
(
` Response:
${
result
.
fulfillmentText
}
`
);
console
.
log
(
` Response:
${
result
.
fulfillmentText
}
`
);
res
.
send
(
result
)
res
.
send
(
result
)
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment