Skip to content

Commit

Permalink
Merge branch 'main' into features/self-deploy-PRE
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriele Panico committed Dec 18, 2024
2 parents 9d6d9e4 + 6246f57 commit 6c548b2
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 147 deletions.
8 changes: 4 additions & 4 deletions tybotRoute/TdCache.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class TdCache {
* Connect redis client
*/
this.client = redis.createClient(
{
url: `redis://${this.redis_host}:${this.redis_port}`,
password: this.redis_password
});
{
url: `redis://${this.redis_host}:${this.redis_port}`,
password: this.redis_password
});
this.client.on('error', err => {
reject(err);
if (callback) {
Expand Down
2 changes: 1 addition & 1 deletion tybotRoute/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const bodyParser = require('body-parser');
const { TiledeskClient } = require('@tiledesk/tiledesk-client');
const { ExtApi } = require('./ExtApi.js');
const { ExtUtil } = require('./ExtUtil.js');
const { TdCache } = require('./TdCache.js');
const { TdCache } = require('./TdCache_v3.js');
const { TiledeskChatbot } = require('./models/TiledeskChatbot.js');
const { MongodbBotsDataSource } = require('./models/MongodbBotsDataSource.js');
// const { MongodbIntentsMachine } = require('./models/MongodbIntentsMachine.js');
Expand Down
217 changes: 79 additions & 138 deletions tybotRoute/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tybotRoute/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"mongoose": "^6.3.5",
"multer": "^1.4.5-lts.1",
"nanoid": "^3.1.25",
"redis": "^4.7.0",
"redis": "^3.1.2",
"uuid": "^3.3.3",
"vm2": "^3.9.13"
},
Expand Down
4 changes: 2 additions & 2 deletions tybotRoute/tiledeskChatbotPlugs/directives/DirAskGPTV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -624,10 +624,10 @@ class DirAskGPTV2 {
return new Promise((resolve) => {
let engine = {
name: "pinecone",
type: "pod",
type: process.env.PINECONE_TYPE,
apikey: "",
vector_size: 1536,
index_name: "pugliai-tiledesk"
index_name: process.env.PINECONE_INDEX
}
resolve(engine);
})
Expand Down
4 changes: 3 additions & 1 deletion tybotRoute/tiledeskChatbotPlugs/directives/DirMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class DirMessage {
this.token = context.token;
this.log = this.context.log;
this.supportRequest = this.context.supportRequest
this.hMessage = false
}

execute(directive, callback) {
Expand Down Expand Up @@ -70,6 +71,7 @@ class DirMessage {
}
if (directive.name === Directives.HMESSAGE) {
action.attributes.subtype = "info";
this.hMessage = true;
}
// if (directive.name === Directives.HMESSAGE) {
// action.sender = "tiledesk";
Expand All @@ -95,7 +97,7 @@ class DirMessage {
const message = action;
if (this.log) {console.log("Message to extEndpoint:", JSON.stringify(message))};

if(this.supportRequest && !this.supportRequest.draft){
if(this.hMessage && this.supportRequest && !this.supportRequest.draft){
callback();
return;
}
Expand Down

0 comments on commit 6c548b2

Please sign in to comment.