Skip to content

Commit

Permalink
updated tybot-connector to 0.2.57-rc1
Browse files Browse the repository at this point in the history
update kb endpoints in openaiService
  • Loading branch information
Giovanni Troisi committed Feb 29, 2024
1 parent 08e1af1 commit 2bd84c0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
14 changes: 7 additions & 7 deletions 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@tiledesk/tiledesk-messenger-connector": "^0.1.18",
"@tiledesk/tiledesk-rasa-connector": "^1.0.10",
"@tiledesk/tiledesk-telegram-connector": "^0.1.10",
"@tiledesk/tiledesk-tybot-connector": "^0.2.56",
"@tiledesk/tiledesk-tybot-connector": "^0.2.57-rc1",
"@tiledesk/tiledesk-whatsapp-connector": "^0.1.63",
"@tiledesk/tiledesk-whatsapp-jobworker": "^0.0.7",
"@tiledesk/tiledesk-train-jobworker": "^0.0.5",
Expand Down
23 changes: 12 additions & 11 deletions services/openaiService.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ require('dotenv').config();

let openai_endpoint = process.env.OPENAI_ENDPOINT;
let kb_endpoint = process.env.KB_ENDPOINT;
let kb_endpoint_dev = process.env.KB_ENDPOINT_DEV;
let kb_endpoint_train = process.env.KB_ENDPOINT_TRAIN;
let kb_endpoint_qa = process.env.KB_ENDPOINT_QA;

class OpenaiService {

Expand Down Expand Up @@ -100,12 +101,12 @@ class OpenaiService {

// PUGLIA AI V2
singleScrape(data) {
winston.debug("[OPENAI SERVICE] kb endpoint: " + kb_endpoint_dev);
winston.debug("[OPENAI SERVICE] kb endpoint: " + kb_endpoint_train);

return new Promise((resolve, reject) => {

axios({
url: kb_endpoint_dev + "/scrape/single",
url: kb_endpoint_train + "/scrape/single",
headers: {
'Content-Type': 'application/json'
},
Expand All @@ -121,12 +122,12 @@ class OpenaiService {
}

scrapeStatus(data) {
winston.debug("[OPENAI SERVICE] kb endpoint: " + kb_endpoint_dev);
winston.debug("[OPENAI SERVICE] kb endpoint: " + kb_endpoint_train);

return new Promise((resolve, reject) => {

axios({
url: kb_endpoint_dev + "/scrape/status",
url: kb_endpoint_train + "/scrape/status",
headers: {
'Content-Type': 'application/json'
},
Expand All @@ -141,12 +142,12 @@ class OpenaiService {
}

askNamespace(data) {
winston.debug("[OPENAI SERVICE] kb endpoint: " + kb_endpoint_dev);
winston.debug("[OPENAI SERVICE] kb endpoint: " + kb_endpoint_qa);

return new Promise((resolve, reject) => {

axios({
url: kb_endpoint_dev + "/qa",
url: kb_endpoint_qa + "/qa",
headers: {
'Content-Type': 'application/json'
},
Expand All @@ -162,12 +163,12 @@ class OpenaiService {
}

deleteIndex(data) {
winston.debug("[OPENAI SERVICE] kb endpoint: " + kb_endpoint_dev);
winston.debug("[OPENAI SERVICE] kb endpoint: " + kb_endpoint_train);

return new Promise((resolve, reject) => {

axios({
url: kb_endpoint_dev + "/delete/id",
url: kb_endpoint_train + "/delete/id",
headers: {
'Content-Type': 'application/json'
},
Expand All @@ -182,12 +183,12 @@ class OpenaiService {
}

deleteNamespace(data) {
winston.debug("[OPENAI SERVICE] kb endpoint: " + kb_endpoint_dev);
winston.debug("[OPENAI SERVICE] kb endpoint: " + kb_endpoint_train);

return new Promise((resolve, reject) => {

axios({
url: kb_endpoint_dev + "/delete/namespace",
url: kb_endpoint_train + "/delete/namespace",
headers: {
'Content-Type': 'application/json'
},
Expand Down

0 comments on commit 2bd84c0

Please sign in to comment.