diff --git a/Changelog.txt b/Changelog.txt
index bdda323..494bd77 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,5 +1,10 @@
CHANGE LOG:
+31.07.2024
+
+ - Open Source Models Connection (API and Endpoint adjustable from .env)
+ - Chatlog is saved on the localstorage
+
16.04.2024 Changelog – HAWKI V1.
- Multi language package added.
diff --git a/README.md b/README.md
index 719748c..698b2e6 100644
--- a/README.md
+++ b/README.md
@@ -39,7 +39,10 @@ Display of mathematical formulas, LaTex and improvement of syntax highlighting.
Dark Mode for our night owls.
-System prompts can now be viewed transparently.
+System prompts can now be viewed and edited.
+
+In the new version each room's chatlog is saved by default and should be deleted before starting a new chat.
+
### Security updates
@@ -72,6 +75,7 @@ The new version also supports the Shibboleth for user authentication. Define you
To generate answers HAWKI uses the Open AI api. Follow the instructions on https://platform.openai.com/docs/introduction to generate an API key and paste it in the configuration file like instructed in chapter [Configuration](#configuration).
+
## Configuration
To get started you need to add a configuration file to the project first. Copy the file ".env.example" from the root directory and rename it to ".env". Replace the example values in it with your own configuration. A detailed description of all values is listed below.
@@ -85,20 +89,25 @@ To get started you need to add a configuration file to the project first. Copy t
| LDAP_SEARCH_DN | string | "ou=...,dc=..." | Distinguished name that is used for authenticating users. |
| LDAP_PORT | string | "..." | The LDAP port. |
| LDAP_FILTER | string | "..." | LDAP Filter. Choose the filter based on your LDAP configuration. See .env.example for more details.|
+| LDAP_DEFAULT_INITIALS | string | "ABC" | User initials to use for every user. If not set, try to compute initials from LDAP displayname.|
| SHIBBOLET_LOGIN_PATH | string | "..." | Path to shibboleth login page. |
| SHIBBOLET_LOGIN_PAGE | string | "..." | Shibboleth login page. |
| OIDC_IDP | string | "https://...." | URL of the Identity provider supporting OpenID Connect. |
| OIDC_CLIENT_ID | string | "..." | Client Id for this application in Identity provider. |
| OIDC_CLIENT_SECRET | string | "..." | Secret key for OpenID Connect.
| OIDC_LOGOUT_URI | string | "https://...." | URL to logout from Identity provider |
-| OPENAI_API_URL | string | "https://api.openai.com/v1/chat/completions" | Open AI URL |
+| MODEL_SELECTOR_ACTIVATION | string | "true" | Set to true to activate dropdown. Deactivated Dropdown will force Gpt-4-0 as default model. |
+| OPENAI_API_URL | string | "https://api.openai.com/v1/chat/completions" | Open AI Endpoint URL |
| OPENAI_API_KEY | string | sk-... | Open AI Api key |
+| GWDG_API_URL | string | "https://api.openai.com/v1/chat/completions" | GWDG Endpoint URL |
+| GWDG_API_KEY | string | | GWDG Api key |
| IMPRINT_LOCATION | string | https://your-university/imprint | A link to your imprint. Alternatively you can replace the file index.php under /impressum with your own html/ php of your imprint. |
| PRIVACY_LOCATION | string | https://your-university/privacy-policy | A link to your privacy policy. Alternatively you can replace the file index.php under /datenschutz with your own html/ php of your privacy policy. |
| TESTUSER | string | "tester" | Set value for testing purposes. Leave TESTUSER and TESTPASSWORD empty or comment them out to disable test user. |
| TESTPASSWORD | string | "superlangespasswort123" | Set value for testing purposes. Leave TESTUSER and TESTPASSWORD empty or comment them out to disable test user. |
| FAVICON_URI | string | "https://...." | Link to favicon |
| DEFAULT_LANGUAGE | string | "de_DE"/ "en_US"/ "es_ES"/ "fr_FR"/ "it_IT" | Default website language. Only applicable if the user has not previously changed the language or their browser language is not one of the supported languages. Current supported languages: 'de_DE', 'en_US', 'es_ES', 'fr_FR', 'it_IT' |
+| CHATLOG_ENCRYPTION_SALT | string | ... | Set a strong salt specific to your application. This will be user to encrypt users' chatlogs in localstorage.|
## Web Server Configuration
There are a few things to keep in mind when publishing your HAWKI instance on a webserver.
diff --git a/index.php b/index.php
index 78de8be..9006d62 100644
--- a/index.php
+++ b/index.php
@@ -57,8 +57,13 @@
include_once( LIBRARY_PATH . "stream-api.php");
}
exit;
+ case('/api/GWDG-api'):
+ if($_SERVER["REQUEST_METHOD"] == "POST"){
+ include_once( LIBRARY_PATH . "GWDG-stream-api.php");
+ }
+ exit;
default:
- header("Location: /login");
+ header("Location: login");
exit();
}
\ No newline at end of file
diff --git a/private/.env.example b/private/.env.example
index 336d441..4201af8 100644
--- a/private/.env.example
+++ b/private/.env.example
@@ -11,16 +11,24 @@ LDAP_PORT=""
; (|(sAMAccountName=username)(mail=username))
; (|(uid=username)(mail=username))
LDAP_FILTER="(|(sAMAccountName=username)(mail=username))"
+; LDAP_DEFAULT_INITIALS="ABC"
#Shibbolet
SHIBBOLETH_LOGIN_PATH="Shibboleth.sso/Login?target="
SHIBBOLETH_LOGIN_PAGE="login.php"
SHIBBOLETH_LOGOUT_URL=""
+# Activates Model Selector Dropdown
+MODEL_SELECTOR_ACTIVATION="true"
+
# Open Ai config
OPENAI_API_URL="https://api.openai.com/v1/chat/completions"
OPENAI_API_KEY="sk-..."
+#GWDG Ai Config
+GWDG_API_URL="https://chat-ai.academiccloud.de/v1/chat/completions"
+GWDG_API_KEY=""
+
# Legal config
IMPRINT_LOCATION="https://my-univiersity.com/imprint"
PRIVACY_LOCATION="https://my-univiersity.com/ai-privacy-policy"
@@ -49,3 +57,6 @@ FAVICON_URI=""
# Default Language, leave blank to use default language of the user's browser.
DEFAULT_LANGUAGE="de_DE"
+
+# fix salt for encryption users' chatlog in localstorage
+CHATLOG_ENCRYPTION_SALT=""
diff --git a/private/app/php/GWDG-stream-api.php b/private/app/php/GWDG-stream-api.php
new file mode 100644
index 0000000..e4e7b58
--- /dev/null
+++ b/private/app/php/GWDG-stream-api.php
@@ -0,0 +1,64 @@
+
+
+
diff --git a/private/app/php/submit_vote.php b/private/app/php/submit_vote.php
index dd3eb89..0eebc2f 100644
--- a/private/app/php/submit_vote.php
+++ b/private/app/php/submit_vote.php
@@ -56,9 +56,9 @@
// Find the feedback entry by ID
$foundFeedback = null;
- foreach ($feedbackData as $feedback) {
+ foreach ($feedbackData as &$feedback) {
if ($feedback['id'] === $data['id']) {
- $foundFeedback = $feedback;
+ $foundFeedback = &$feedback;
break;
}
}
diff --git a/private/app/php/user_feedback.php b/private/app/php/user_feedback.php
new file mode 100644
index 0000000..075bbf8
--- /dev/null
+++ b/private/app/php/user_feedback.php
@@ -0,0 +1,104 @@
+
diff --git a/private/pages/interface.php b/private/pages/interface.php
index f6c96ed..9975f4c 100644
--- a/private/pages/interface.php
+++ b/private/pages/interface.php
@@ -4,13 +4,14 @@
require_once BOOTSTRAP_PATH;
require_once LIBRARY_PATH . 'language_controller.php';
+
if(!isset($_SESSION['translation'])){
setLanguage();
}
$translation = $_SESSION['translation'];
if (!isset($_SESSION['username'])) {
- header("Location: login.php");
+ header("Location: login");
exit;
}
@@ -52,27 +53,30 @@
media="screen" />
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
+
+
+
+
+
+
-