From 2ebb52a589fafcf6633377756bae80da1c00e43d Mon Sep 17 00:00:00 2001 From: "martina.dimova" Date: Wed, 15 Nov 2023 08:59:42 +0200 Subject: [PATCH] GDB-9132 "Talk to Your Graph" user interface fails to read graphdb.external-url * Changed building request to rest/chat/retrieval to consider different path if provided. --- src/js/angular/chatgpt/controllers.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/angular/chatgpt/controllers.js b/src/js/angular/chatgpt/controllers.js index c2ceffb12..0025423a6 100644 --- a/src/js/angular/chatgpt/controllers.js +++ b/src/js/angular/chatgpt/controllers.js @@ -10,6 +10,8 @@ angular ChatGptCtrl.$inject = ['$scope', '$http', '$timeout', '$translate', '$uibModal', '$repositories', 'toastr', 'ModalService', 'LocalStorageAdapter']; +const CHATGPTRETRIEVAL_ENDPOINT = 'rest/chat/retrieval'; + function ChatGptCtrl($scope, $http, $timeout, $translate, $uibModal, $repositories, toastr, ModalService, LocalStorageAdapter) { function scrollToEnd() { $timeout(() => { @@ -82,7 +84,7 @@ function ChatGptCtrl($scope, $http, $timeout, $translate, $uibModal, $repositori const questionMsg = {"role": "question", "content": $scope.question}; - $http.post(`/rest/chat/retrieval?repositoryID=${$repositories.getActiveRepository()}`, chatRequest).then((response) => { + $http.post(`${CHATGPTRETRIEVAL_ENDPOINT}?repositoryID=${$repositories.getActiveRepository()}`, chatRequest).then((response) => { $scope.history.pop(); response.data.forEach((e) => $scope.history.push(e)); }).catch((error) => {