moving copilot work under common folder and adding _studio_dependencies

This commit is contained in:
Peter Morton 2025-08-20 09:30:17 -05:00
parent bc11ec76d0
commit 403c73fc83
10 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,57 @@
/*
Proxy Script for CoPilot integration with IVAS
*/
console.log({ script: "copilot", body: req.body});
req.body.event.metadata = _.merge(req.body.event.metadata, {
channel: copilot_settings.channel
});
const messengerUrl = `${copilot_settings.nlu.apiBaseURL}ProxyScript/run/${req.params.workspaceId}/${req.params.branch}/${copilot_settings.messengerRouteName}`;
(async () => {
try {
const { data: recognizedData } = await axios({
url: messengerUrl,
method: "post",
data: req.body,
// headers: {
// Authorization: `Bearer ${copilot_settings.ops.token}`
// }
});
res.send(recognizedData);
} catch (error) {
console.log(error.message);
res.send({
answers: ['Something went wrong. Please try again.'],
outputs: {}
});
}
})();/*
Proxy Script for CoPilot integration with IVAS
*/
console.log({ script: "copilot", body: req.body});
req.body.event.metadata = _.merge(req.body.event.metadata, {
channel: copilot_settings.channel
});
const messengerUrl = `${copilot_settings.nlu.apiBaseURL}ProxyScript/run/${req.params.workspaceId}/${req.params.branch}/${copilot_settings.messengerRouteName}`;
(async () => {
try {
const { data: recognizedData } = await axios({
url: messengerUrl,
method: "post",
data: req.body,
// headers: {
// Authorization: `Bearer ${copilot_settings.ops.token}`
// }
});
res.send(recognizedData);
} catch (error) {
console.log(error.message);
res.send({
answers: ['Something went wrong. Please try again.'],
outputs: {}
});
}
})();

View File

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

Before

Width:  |  Height:  |  Size: 533 B

After

Width:  |  Height:  |  Size: 533 B

View File

Before

Width:  |  Height:  |  Size: 961 B

After

Width:  |  Height:  |  Size: 961 B

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB