Skip to content

Commit

Permalink
GDB-9132 "Talk to Your Graph" user interface fails to read graphdb.ex…
Browse files Browse the repository at this point in the history
…ternal-url

* Changed building request to rest/chat/retrieval to consider different path if provided.
  • Loading branch information
martina.dimova committed Nov 15, 2023
1 parent 25e3982 commit 2ebb52a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/js/angular/chatgpt/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit 2ebb52a

Please sign in to comment.