diff --git a/DSL/Resql/rag-search/POST/get-llm-connections-paginated.sql b/DSL/Resql/rag-search/POST/get-llm-connections-paginated.sql
index 922c16ec..d4c15efb 100644
--- a/DSL/Resql/rag-search/POST/get-llm-connections-paginated.sql
+++ b/DSL/Resql/rag-search/POST/get-llm-connections-paginated.sql
@@ -24,7 +24,7 @@ SELECT
END AS budget_status
FROM rag_search.llm_connections
WHERE connection_status <> 'deleted'
- AND environment = 'testing'
+ -- AND environment = 'testing'
AND (:llm_platform IS NULL OR :llm_platform = '' OR llm_platform = :llm_platform)
AND (:llm_model IS NULL OR :llm_model = '' OR llm_model = :llm_model)
AND (:environment IS NULL OR :environment = '' OR environment = :environment)
diff --git a/DSL/Ruuter.private/accounts/GET/user-role.yml b/DSL/Ruuter.private/accounts/GET/user-role.yml
new file mode 100644
index 00000000..cd8f3830
--- /dev/null
+++ b/DSL/Ruuter.private/accounts/GET/user-role.yml
@@ -0,0 +1,38 @@
+declaration:
+ call: declare
+ version: 0.1
+ description: "Get user roles dynamically from TIM"
+ method: get
+ accepts: json
+ returns: json
+ namespace: rag-search
+ allowlist:
+ headers:
+ - field: cookie
+ type: string
+ description: "Cookie field"
+
+get_user_info:
+ call: http.post
+ args:
+ url: "[#RAG_SEARCH_TIM]/jwt/custom-jwt-userinfo"
+ contentType: plaintext
+ headers:
+ cookie: ${incoming.headers.cookie}
+ plaintext: "customJwtCookie"
+ result: res
+ next: check_user_info_response
+
+check_user_info_response:
+ switch:
+ - condition: ${200 <= res.response.statusCodeValue && res.response.statusCodeValue < 300}
+ next: return_result
+ next: return_empty_array
+
+return_result:
+ return: ${res.response.body.authorities}
+ next: end
+
+return_empty_array:
+ return: success
+ next: end
diff --git a/DSL/Ruuter.public/rag-search/GET/accounts/user-role.yml b/DSL/Ruuter.public/rag-search/GET/accounts/user-role.yml
new file mode 100644
index 00000000..d37b8911
--- /dev/null
+++ b/DSL/Ruuter.public/rag-search/GET/accounts/user-role.yml
@@ -0,0 +1,38 @@
+declaration:
+ call: declare
+ version: 0.1
+ description: "Get user roles dynamically from TIM"
+ method: get
+ accepts: json
+ returns: json
+ namespace: backoffice
+ allowlist:
+ headers:
+ - field: cookie
+ type: string
+ description: "Cookie field"
+
+get_user_info:
+ call: http.post
+ args:
+ url: "[#CKB_TIM]/jwt/custom-jwt-userinfo"
+ contentType: plaintext
+ headers:
+ cookie: ${incoming.headers.cookie}
+ plaintext: "customJwtCookie"
+ result: res
+ next: check_user_info_response
+
+check_user_info_response:
+ switch:
+ - condition: ${200 <= res.response.statusCodeValue && res.response.statusCodeValue < 300}
+ next: return_result
+ next: return_empty_array
+
+return_result:
+ return: ${res.response.body.authorities}
+ next: end
+
+return_empty_array:
+ return: success
+ next: end
diff --git a/GUI/.env.development b/GUI/.env.development
index ae5b1356..c15f05c6 100644
--- a/GUI/.env.development
+++ b/GUI/.env.development
@@ -4,4 +4,6 @@ REACT_APP_CUSTOMER_SERVICE_LOGIN=http://localhost:3004/et/dev-auth
REACT_APP_SERVICE_ID=conversations,settings,monitoring
REACT_APP_NOTIFICATION_NODE_URL=http://localhost:4040
REACT_APP_CSP=upgrade-insecure-requests; default-src 'self'; font-src 'self' data:; img-src 'self' data:; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; object-src 'none'; connect-src 'self' http://localhost:8086 http://localhost:8088 http://localhost:3004 http://localhost:4040 ws://localhost;
-REACT_APP_ENABLE_HIDDEN_FEATURES=TRUE
\ No newline at end of file
+REACT_APP_ENABLE_HIDDEN_FEATURES=TRUE
+REACT_APP_ENABLE_MULTI_DOMAIN=FALSE
+REACT_APP_MENU_JSON= '[{"id":"conversations","label":{"et":"Vestlused","en":"Conversations"},"path":"/chat","children":[{"label":{"et":"Vastamata","en":"Unanswered"},"path":"/unanswered"},{"label":{"et":"Aktiivsed","en":"Active"},"path":"/active"},{"label":{"et":"Ootel","en":"Pending"},"path":"/pending"},{"label":{"et":"Ajalugu","en":"History"},"path":"/history"},{"label":{"et":"Valideerimised","en":"Validations"},"path":"/validations"}]},{"id":"training","label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Teemad","en":"Themes"},"path":"/training/intents"},{"hidden":true,"label":{"et":"Avalikud teemad","en":"Public themes"},"path":"/training/common-intents"},{"label":{"et":"Teemade järeltreenimine","en":"Post training themes"},"path":"/training/intents-followup-training"},{"label":{"et":"Vastused","en":"Answers"},"path":"/training/responses"},{"label":{"et":"Reeglid","en":"Rules"},"path":"/training/rules"},{"hidden":true,"label":{"et":"Konfiguratsioon","en":"Configuration"},"path":"/training/configuration"},{"label":{"et":"Vormid","en":"Forms"},"path":"/training/forms"},{"label":{"et":"Mälukohad","en":"Slots"},"path":"/training/slots"}]},{"label":{"et":"Ajaloolised vestlused","en":"Historical conversations"},"path":"/history","children":[{"label":{"et":"Ajalugu","en":"History"},"path":"/history/history"},{"hidden":true,"label":{"et":"Pöördumised","en":"Appeals"},"path":"/history/appeal"}]},{"label":{"et":"Mudelipank ja analüütika","en":"Modelbank and analytics"},"path":"/analytics","children":[{"label":{"et":"Teemade ülevaade","en":"Overview of topics"},"path":"/analytics/overview"},{"label":{"et":"Mudelite võrdlus","en":"Comparison of models"},"path":"/analytics/models"},{"hidden":true,"label":{"et":"Testlood","en":"testTracks"},"path":"/analytics/testcases"}]},{"label":{"et":"Treeni uus mudel","en":"Train new model"},"path":"/train-new-model"}]},{"id":"analytics","label":{"et":"Analüütika","en":"Analytics"},"path":"/analytics","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Vestlused","en":"Chats"},"path":"/chats"},{"label":{"et":"Tagasiside","en":"Feedback"},"path":"/feedback"},{"label":{"et":"Avaandmed","en":"Reports"},"path":"/reports"}]},{"id":"services","hidden":true,"label":{"et":"Teenused","en":"Services"},"path":"/services","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Uus teenus","en":"New Service"},"path":"/newService"},{"label":{"et":"Probleemsed teenused","en":"Faulty Services"},"path":"/faultyServices"}]},{"id":"knowledge-center","label":{"et":"Teadmuskeskus","en":"Knowledge Center"},"path":"/knowledge-center","children":[{"id":"rag-search","label":{"et":"Mudelid ja seadistused","en":"Models management"},"path":"/rag-search","children":[{"label":{"et":"Mudelite ühendused","en":"LLM connections"},"path":"/llm-connections"},{"label":{"et":"Viiba Seaded","en":"Prompt Configurations"},"path":"/prompt-configurations"},{"label":{"et":"Testi mudelit","en":"Test LLM"},"path":"/test-llm"}]},{"id":"ckb","label":{"et":"Teadmusbaas","en":"Knowledge Base"},"path":"/ckb","children":[{"label":{"et":"Agentuur","en":"Agency"},"path":"/agency"},{"label":{"et":"Aruanded","en":"Reports"},"path":"/reports"},{"label":{"et":"API Integratsioonid","en":"API Integrations"},"path":"/api"}]}]},{"id":"settings","label":{"et":"Haldus","en":"Administration"},"path":"/settings","children":[{"label":{"et":"Kasutajad","en":"Users"},"path":"/users"},{"label":{"et":"Vestlusbot","en":"Chatbot"},"path":"/chatbot","children":[{"label":{"et":"Seaded","en":"Settings"},"path":"/chatbot/settings"},{"label":{"et":"Tervitussõnum","en":"Welcome message"},"path":"/chatbot/welcome-message"},{"label":{"et":"Välimus ja käitumine","en":"Appearance and behavior"},"path":"/chatbot/appearance"},{"label":{"et":"Erakorralised teated","en":"Emergency notices"},"path":"/chatbot/emergency-notices"},{"label":{"et":"Tagasiside","en":"Feedback"},"path":"/chatbot/feedback"}]},{"label":{"et":"Vestluste analüüs","en":"Chat analysis"},"path":"/chat-analysis"},{"label":{"et":"Asutuse tööaeg","en":"Office opening hours"},"path":"/working-time"},{"label":{"et":"Vestluse Kustutamine","en":"Delete Conversations"},"path":"/delete-conversations"},{"label":{"et":"Sessiooni pikkus","en":"Session length"},"path":"/session-length"},{"label":{"et":"SKMi konfiguratsioon","en":"SKM Configuration"},"path":"/skm-configuration"},{"label":{"et":"Anonümiseerija","en":"Anonymizer"},"path":"/anonymizer"}]},{"id":"monitoring","hidden":true,"label":{"et":"Seire","en":"Monitoring"},"path":"/monitoring","children":[{"label":{"et":"Aktiivaeg","en":"Working hours"},"path":"/uptime"}]}]'
diff --git a/GUI/package-lock.json b/GUI/package-lock.json
index c0f45b17..5f1f779d 100644
--- a/GUI/package-lock.json
+++ b/GUI/package-lock.json
@@ -8,6 +8,8 @@
"name": "byk-training-module-gui",
"version": "0.0.0",
"dependencies": {
+ "@buerokratt-ria/header": "^0.1.52",
+ "@buerokratt-ria/menu": "^0.2.15",
"@buerokratt-ria/styles": "^0.0.1",
"@fontsource/roboto": "^4.5.8",
"@formkit/auto-animate": "^1.0.0-beta.5",
@@ -89,7 +91,7 @@
"eslint-plugin-typescript": "^0.14.0",
"mocksse": "^1.0.4",
"msw": "^0.49.2",
- "prettier": "^2.8.1",
+ "prettier": "^2.8.8",
"sass": "^1.57.0",
"typescript": "^4.9.3",
"vite": "^4.0.0",
@@ -2154,6 +2156,81 @@
"node": ">=6.9.0"
}
},
+ "node_modules/@buerokratt-ria/header": {
+ "version": "0.1.52",
+ "resolved": "https://registry.npmjs.org/@buerokratt-ria/header/-/header-0.1.52.tgz",
+ "integrity": "sha512-4k9Ekym6UqQpyF2nEIIT0n3wdp6Ax9sTvWK4HeZ7xuwf9YdgYnYRARRnZxcfsJCMm54JUQ8IKV9Y5i5ULVk1Bg==",
+ "license": "ISC",
+ "dependencies": {
+ "@buerokratt-ria/styles": "^0.0.1",
+ "@types/react": "^18.2.21",
+ "react": "^18.2.0"
+ },
+ "peerDependencies": {
+ "@fontsource/roboto": "^4.5.8",
+ "@formkit/auto-animate": "^0.7.0",
+ "@radix-ui/react-accessible-icon": "^1.0.3",
+ "@radix-ui/react-dialog": "^1.0.4",
+ "@radix-ui/react-switch": "^1.0.3",
+ "@radix-ui/react-toast": "^1.1.4",
+ "@tanstack/react-query": "^4.32.1",
+ "axios": "^1.4.0",
+ "clsx": "^1.2.1",
+ "howler": "^2.2.4",
+ "i18next": "^23.2.3",
+ "i18next-browser-languagedetector": "^7.1.0",
+ "path": "^0.12.7",
+ "react": "^18.2.0",
+ "react-cookie": "^4.1.1",
+ "react-dom": "^18.2.0",
+ "react-hook-form": "^7.45.4",
+ "react-i18next": "^12.1.1",
+ "react-icons": "^4.10.1",
+ "react-idle-timer": "^5.7.2",
+ "react-router-dom": "^6.14.2",
+ "react-select": "^5.7.4",
+ "rxjs": "^7.8.1",
+ "tslib": "^2.3.0",
+ "vite-plugin-dts": "^3.5.2",
+ "vite-plugin-svgr": "^3.2.0",
+ "zustand": "^4.4.0"
+ }
+ },
+ "node_modules/@buerokratt-ria/menu": {
+ "version": "0.2.15",
+ "resolved": "https://registry.npmjs.org/@buerokratt-ria/menu/-/menu-0.2.15.tgz",
+ "integrity": "sha512-xtjIyD/3Mdg2UZ7A6Yv/3ZsZX8LGUFGpYtr3LaYeyfhv5FsLWfDwXNPL2ViooOdpPJaD4hmKURrBF2VgpmBfUw==",
+ "license": "ISC",
+ "dependencies": {
+ "@buerokratt-ria/styles": "^0.0.1",
+ "@types/react": "^18.2.21",
+ "react": "^18.2.0"
+ },
+ "peerDependencies": {
+ "@radix-ui/react-accessible-icon": "^1.0.3",
+ "@radix-ui/react-dialog": "^1.0.4",
+ "@radix-ui/react-switch": "^1.0.3",
+ "@radix-ui/react-toast": "^1.1.4",
+ "@tanstack/react-query": "^4.32.1",
+ "clsx": "^1.2.1",
+ "i18next": "^23.2.3",
+ "i18next-browser-languagedetector": "^7.1.0",
+ "path": "^0.12.7",
+ "react": "^18.2.0",
+ "react-cookie": "^4.1.1",
+ "react-dom": "^18.2.0",
+ "react-hook-form": "^7.45.4",
+ "react-i18next": "^12.1.1",
+ "react-icons": "^4.10.1",
+ "react-idle-timer": "^5.7.2",
+ "react-router-dom": "^6.14.2",
+ "rxjs": "^7.8.1",
+ "tslib": "^2.3.0",
+ "vite-plugin-dts": "^3.5.2",
+ "vite-plugin-svgr": "^3.2.0",
+ "zustand": "^4.4.0"
+ }
+ },
"node_modules/@buerokratt-ria/styles": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/@buerokratt-ria/styles/-/styles-0.0.1.tgz",
@@ -14263,6 +14340,7 @@
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
"dev": true,
+ "license": "MIT",
"bin": {
"prettier": "bin-prettier.js"
},
diff --git a/GUI/package.json b/GUI/package.json
index ec9c4e78..e1dc0692 100644
--- a/GUI/package.json
+++ b/GUI/package.json
@@ -11,6 +11,8 @@
"prettier": "prettier --write \"{,!(node_modules)/**/}*.{ts,tsx,js,json,css,less,scss}\""
},
"dependencies": {
+ "@buerokratt-ria/header": "^0.1.52",
+ "@buerokratt-ria/menu": "^0.2.15",
"@buerokratt-ria/styles": "^0.0.1",
"@fontsource/roboto": "^4.5.8",
"@formkit/auto-animate": "^1.0.0-beta.5",
@@ -92,7 +94,7 @@
"eslint-plugin-typescript": "^0.14.0",
"mocksse": "^1.0.4",
"msw": "^0.49.2",
- "prettier": "^2.8.1",
+ "prettier": "^2.8.8",
"sass": "^1.57.0",
"typescript": "^4.9.3",
"vite": "^4.0.0",
diff --git a/GUI/src/App.tsx b/GUI/src/App.tsx
index 5839b180..43c50753 100644
--- a/GUI/src/App.tsx
+++ b/GUI/src/App.tsx
@@ -64,8 +64,7 @@ const App: FC = () => {
{t('testModels.inferenceErrorMessage') || 'Failed to get inference result. Please try again.'}
, - footer: ( - - ), - }); - }, - }); - - const handleSend = () => { - if (testLLM.connectionId && testLLM.text) { - inferenceMutation.mutate({ - llmConnectionId: Number(testLLM.connectionId), - message: testLLM.text, - }); - } - }; - - const handleButtonClick = (payload: string) => { - if (!testLLM.connectionId) return; - setPendingButtons([]); - inferenceMutation.mutate({ - llmConnectionId: Number(testLLM.connectionId), - message: payload, - }); - }; - - const handleChange = (key: string, value: string | number) => { - // Prevent changes while inference is loading - if (inferenceMutation.isLoading) { - return; - } - setTestLLM((prev) => ({ - ...prev, - [key]: value, - })); - }; - - const markdownComponents = { - ol: ({children}: any) => ( -{t('testModels.llmConnectionLabel') || 'LLM Connection'}
-{t('testModels.classifyTextLabel') || 'Enter text to test'}
-{t('testModels.classificationFailed') || 'Inference failed. Please try again.'}
-{t('testModels.llmConnectionLabel') || 'LLM Connection'}
+