From 0f0d663c82202c6cf63b88dd36c8a4f49366d3a6 Mon Sep 17 00:00:00 2001 From: Sten Seegel <121229940+StenSeegel@users.noreply.github.com> Date: Mon, 27 May 2024 12:03:49 +0200 Subject: [PATCH 01/14] Update submit_vote.php Fix: Use of references in the foreach loop to correctly update feedback data --- private/app/php/submit_vote.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } } From 9141c1127ec037403b6914f69428e4032c0fc1d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20B=C3=B6ckmann?= Date: Thu, 30 May 2024 14:48:53 +0200 Subject: [PATCH 02/14] Logout environment variables fallback --- private/pages/logout.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/private/pages/logout.php b/private/pages/logout.php index 3b9c1cc..c5d977c 100644 --- a/private/pages/logout.php +++ b/private/pages/logout.php @@ -14,22 +14,23 @@ // Finally, destroy the session. session_destroy(); - if (file_exists(ENV_FILE_PATH)){ $env = parse_ini_file(ENV_FILE_PATH); - if($env['Authentication'] === 'Shibboleth'){ - $redirect_uri = $env['SHIBBOLETH_LOGOUT_URL']; - } - elseif($env['Authentication'] === 'OIDC'){ - $redirect_uri = $env['OIDC_LOGOUT_URI']; - } - else{ - // Redirect to the login page - $redirect_uri ='/login'; - } } + + $authentication = isset($env) ? $env["Authentication"] : getenv("Authentication"); + if($authentication === 'Shibboleth'){ + $redirect_uri = isset($env) ? $env["SHIBBOLETH_LOGOUT_URL"] : getenv("SHIBBOLETH_LOGOUT_URL"); + } + elseif($authentication === 'OIDC'){ + $redirect_uri = isset($env) ? $env["OIDC_LOGOUT_URI"] : getenv("OIDC_LOGOUT_URI"); + } + else{ + // Redirect to the login page + $redirect_uri ='/login'; + } + header("Location: $redirect_uri"); exit(); - ?> From 361ba464566d3b031ba799fc7737b7bf9c5545ed Mon Sep 17 00:00:00 2001 From: Ariansdf <38947447+Ariansdf@users.noreply.github.com> Date: Wed, 31 Jul 2024 11:00:09 +0200 Subject: [PATCH 03/14] Chatlog Storage - Open Source Models Connection (#79) * System Prompt Edit Function * Improved Markdown Syntax Conversion * Save Chat Log in Local Storage * syntax highlight after msg loading * GWDG Connection * New Models + Finetune --- Changelog.txt | 5 + README.md | 11 +- index.php | 5 + private/.env.example | 7 + private/app/php/GWDG-stream-api.php | 64 ++++ private/app/php/chatlog_management.php | 151 ++++++++ private/pages/interface.php | 481 +++++++++++++++---------- private/pages/login.php | 1 - private/resources/language/de_DE.json | 6 +- private/resources/language/en_US.json | 5 +- private/resources/language/es_ES.json | 5 +- private/resources/language/fr_FR.json | 6 +- private/resources/language/it_IT.json | 5 +- private/views/chat.php | 14 + public/assets/crypto-js.min.js | 1 + public/assets/lz-string.min.js | 1 + public/js/interface_functions.js | 70 +++- public/js/syntax_modifier.js | 107 +++--- public/style/interface_style.css | 68 +++- 19 files changed, 748 insertions(+), 265 deletions(-) create mode 100644 private/app/php/GWDG-stream-api.php create mode 100644 private/app/php/chatlog_management.php create mode 100644 public/assets/crypto-js.min.js create mode 100644 public/assets/lz-string.min.js 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..a128de9 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,12 @@ 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). +### Chatlog Storage + +In the new version each room's chatlog is saved by default and should be deleted to start a new chat. +For security reasons the chatlog is stored in the browser's localstorage and also encrypted with the username and server salt to 1. prevent access from outside of HAWKI, 2. prevent access when the same browser is shared between users. +The stored logs will be deleted after one week by default. + ## 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. @@ -91,14 +97,17 @@ To get started you need to add a configuration file to the project first. Copy t | 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 | +| 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..5316507 100644 --- a/index.php +++ b/index.php @@ -57,6 +57,11 @@ 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"); diff --git a/private/.env.example b/private/.env.example index 336d441..cd042d4 100644 --- a/private/.env.example +++ b/private/.env.example @@ -21,6 +21,10 @@ SHIBBOLETH_LOGOUT_URL="" 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 +53,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/pages/interface.php b/private/pages/interface.php index d586d98..b0bb33b 100644 --- a/private/pages/interface.php +++ b/private/pages/interface.php @@ -4,6 +4,7 @@ require_once BOOTSTRAP_PATH; require_once LIBRARY_PATH . 'language_controller.php'; + if(!isset($_SESSION['translation'])){ setLanguage(); } @@ -71,6 +72,9 @@ + + + @@ -79,215 +83,264 @@ SwitchDarkMode(false); UpdateSettingsLanguage(``); - + + +
+ diff --git a/public/js/interface_functions.js b/public/js/interface_functions.js index a76b7c5..7c64494 100644 --- a/public/js/interface_functions.js +++ b/public/js/interface_functions.js @@ -173,4 +173,19 @@ function toggleSystemPromptEdit(){ isEditing = !isEditing; } + +function calculateSystemPromptMaxHeight(){ + const inputWrapper = document.querySelector('.input-wrapper'); + const inputHeight = inputWrapper.getBoundingClientRect().height; + + const spPanel = document.getElementById('system-prompt-panel'); + + const windowHeight = window.innerHeight; + const remInPixels = parseFloat(getComputedStyle(document.documentElement).fontSize); + const margin = 8 * remInPixels; + + const maxHeight = windowHeight - inputHeight - margin; + spPanel.style.maxHeight = `${maxHeight}px`; +} + //#endregion \ No newline at end of file diff --git a/public/style/interface_style.css b/public/style/interface_style.css index d39c59f..597cb23 100644 --- a/public/style/interface_style.css +++ b/public/style/interface_style.css @@ -754,11 +754,14 @@ details svg{ } #system-prompt-panel{ position: absolute; - bottom: 130%; + bottom: calc(100% + 2rem); left: 0; right: 0; margin-bottom: 1rem; height: max-content; + max-height: 70vh; + overflow-y: auto; + padding: 0.5rem 2rem 1rem 2rem; /* font-size: 0.8rem; */ @@ -772,6 +775,26 @@ details svg{ opacity: 0; transition: opacity 300ms; } +#system-prompt-panel::-webkit-scrollbar { + width: 7px; +} + +#system-prompt-panel::-webkit-scrollbar-track { + background: rgba(0, 0, 0, 0); +} + +#system-prompt-panel::-webkit-scrollbar-thumb { + background: #cbcbcb; + border-radius: 5px; +} + +#system-prompt-panel::-webkit-scrollbar-thumb:hover { + background: #555; +} + + + + #system-prompt-title{ display: grid; grid-template-columns: auto 1fr auto; From f82ca0cdcf0efd8560b61fc3dceee669daf2781c Mon Sep 17 00:00:00 2001 From: Ariansdf <38947447+Ariansdf@users.noreply.github.com> Date: Thu, 15 Aug 2024 10:58:12 +0200 Subject: [PATCH 09/14] HOTFIX::disabled session_set_cookie_params session_set_cookie_params prevents requests with CSRF Token when using Safari. --- private/pages/login.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/private/pages/login.php b/private/pages/login.php index 99ce2fd..f086869 100644 --- a/private/pages/login.php +++ b/private/pages/login.php @@ -2,13 +2,13 @@ // Secure session (optional, depends on the application's specific needs) ini_set('session.cookie_httponly', 1); ini_set('session.use_only_cookies', 1); - if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') { - ini_set('session.cookie_secure', 1); - } - session_set_cookie_params([ - 'secure' => true, // cookies are sent over secure connections only - 'httponly' => true, // cookies are accessible only through the HTTP protocol - ]); + // if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') { + // ini_set('session.cookie_secure', 1); + // } + // session_set_cookie_params([ + // 'secure' => true, // cookies are sent over secure connections only + // 'httponly' => true, // cookies are accessible only through the HTTP protocol + // ]); session_start(); From bcb467e7a01751642be3b3e813396f5d2cae066d Mon Sep 17 00:00:00 2001 From: KBorm Date: Fri, 23 Aug 2024 17:24:19 +0200 Subject: [PATCH 10/14] allow to disagree with guidelines (#84) Co-authored-by: Ariansdf <38947447+Ariansdf@users.noreply.github.com> --- private/resources/language/de_DE.json | 6 ++++-- private/resources/language/en_US.json | 5 ++++- private/resources/language/es_ES.json | 5 ++++- private/resources/language/fr_FR.json | 6 ++++-- private/resources/language/it_IT.json | 5 ++++- private/views/guidelines.php | 11 +++++++---- 6 files changed, 27 insertions(+), 11 deletions(-) diff --git a/private/resources/language/de_DE.json b/private/resources/language/de_DE.json index 418e9dd..aac7bce 100644 --- a/private/resources/language/de_DE.json +++ b/private/resources/language/de_DE.json @@ -135,11 +135,13 @@ "unableToSaveRegistration": "Ihre Anmeldung konnte nicht gespeichert werden.
Bitte versuchen Sie es erneut.
", "usageNoticeTitle": "Nutzungshinweis", "usage_guideline": "

Willkommen zum Leitfaden für den Umgang mit HAWKI, das auf der OpenAI API basiert. Dieser Leitfaden soll allen Hochschulangehörigen - Studierenden, Lehrenden und Mitarbeitenden - eine klare Richtlinie bieten, wie mit dieser Technologie verantwortungsbewusst umgegangen werden soll. Bitte beachten Sie, dass dieser Leitfaden die Nutzungsbedingungen von OpenAI ergänzt und keinen Anspruch auf Vollständigkeit erhebt. Es liegt in der Verantwortung der Nutzerinnen und Nutzer, die Nutzungsbedingungen einzuhalten.

Allgemeine Bestimmungen

Was verboten ist:

  • Eingabe personenbezogener Daten über sich selbst oder über andere.
  • Nutzung der Dienste für illegale, schädliche oder missbräuchliche Aktivitäten.
  • Verletzung, Missbrauch oder Verstoß gegen die Rechte anderer.
  • Modifikation, Kopie, Vermietung, Verkauf oder Verteilung unserer Dienste.
  • Versuch der Rückentwicklung, Dekompilierung oder des Herausfindens von Quellcode oder zugrundeliegenden Komponenten.
  • Automatisches oder programmgesteuertes Extrahieren von Daten oder Output.
  • Behauptung, dass der Output von Menschen erstellt wurde, wenn dies nicht der Fall ist.
  • Beeinträchtigung oder Störung der Dienste oder Umgehung von Schutzmaßnahmen.
  • Verwendung von Output zur Entwicklung konkurrierender Modelle.

Was zu beachten ist:

Sie sind verantwortlich für den von Ihnen bereitgestellten Input und den daraus resultierenden Output. Sie müssen sicherstellen, dass Ihr Input keine Rechte verletzt und dass Sie über alle notwendigen Rechte, Lizenzen und Genehmigungen für die Bereitstellung des Inputs verfügen.

Genauigkeit:

Die Nutzung der Dienste kann zu ungenauem oder fehlerhaftem Output führen. Es ist wichtig, dass Sie den Output kritisch prüfen und nicht als alleinige Quelle der Wahrheit verwenden.Ihre Eingaben werden nicht von der HAWK, aber von OpenAI für 30 Tage gespeichert, um einen eventuellen Missbrauch festzustellen. Nach 30 Tagen werden die Daten gelöscht. Ihre Eingaben werden nicht verwendet, um das Produkt sicherer oder besser zu machen.

Spezifische Bestimmungen

Für den Einsatz generativer KI-Systeme gibt es eine vorläufige Leitlinie und eine Eigenständigkeitserklärung.

Für Studierende:

  • Verwenden Sie HAWKI zur Unterstützung Ihres Lernprozesses, aber verlassen Sie sich nicht ausschließlich auf die generierten Antworten.
  • Teilen Sie keine persönlichen Daten oder Informationen über HAWKI. Auch nicht die personenbezogenen Daten anderer.
  • Sie übernehmen die Autorenschaft. Damit bürgen Sie für die Qualität der Antwort und übernehmen die Verantwortung für den Inhalt. Die Nutzung von KI und die Art ihres Beitrags sollte klargelegt werden.

Für Lehrende:

  • HAWKI darf nicht verwendet werden, um studentische Arbeiten zu korrigieren, wenn diese Arbeiten persönliche Daten enthalten, die extrahierbar sind.
  • Nutzen Sie HAWKI als ergänzendes Werkzeug zur Vorbereitung von Lehrmaterialien, aber stellen Sie sicher, dass alle Inhalte auf ihre Richtigkeit und Relevanz überprüft werden.

Für Mitarbeitende:

  • Es ist strengstens untersagt, Geheimhaltungsverträge oder intern bestimmte Dokumente in HAWKI einzugeben. Auch keine Dokumente, die personenbezogene Daten über sich selbst oder über andere enthalten.
  • Nutzen Sie HAWKI zur Effizienzsteigerung und Unterstützung Ihrer täglichen Aufgaben, jedoch unter Beachtung der Datenschutzrichtlinien und Sicherheitsvorschriften der Hochschule.

Dieser Leitfaden dient als Orientierungshilfe für den verantwortungsbewussten Umgang mit HAWKI. Es ist wichtig, dass alle Nutzer*innen die genannten Bestimmungen verstehen und befolgen, um einen sicheren und ethischen Einsatz dieser Technologie zu gewährleisten. Die Hochschule kann diesen Service nur anbieten, wenn Sie keine persönlichen Daten eingeben. Bei Fragen oder Unsicherheiten wenden Sie sich bitte an Prof. Stefan Wölwer, Arian Sadafi, Jonas Trippler oder Vincent Timm. Ungeachtet dieses Leitfadens gelten die Nutzungsbedingungen von OpenAI.

", + "usage_guideline_confirm_request": "Die Funktion von HAWKI setzt für die Generierung der Ausgaben zwingend voraus, dass Ihre Eingaben an Dritte (je nach KI-Modell OpenAI Inc. oder GWDG) übermittelt werden. Sind Sie damit einverstanden und werden keine personenbezogenen Daten von Ihnen oder anderen Personen eingeben?", "username": "Benutzername", "welcomeBackTitle": "Willkommen zurück!", "writingAssistanceRequest": "Ich arbeite an einem wissenschaftlichen Projekt und benötige Hilfe beim Schreibstil und der Formatierung. Ich habe meine Arbeit bereits verfasst, bin mir aber nicht sicher, ob ich alle Formatierungsrichtlinien und Schreibkonventionen korrekt befolgt habe. Könntest du mir bitte helfen, meine Arbeit zu überprüfen und mir Ratschläge zur Verbesserung der Formatierung und des Schreibstils geben?", "deleteChat": "Dieser Chat wird endgültig gelöscht.
Möchten Sie fortfahren?", "delete": "Löschen", - "cancel": "Abbrechen" - + "cancel": "Abbrechen", + "agree": "Einverstanden", + "disagree": "Nicht einverstanden" } \ No newline at end of file diff --git a/private/resources/language/en_US.json b/private/resources/language/en_US.json index 4b85f3c..c1bef62 100644 --- a/private/resources/language/en_US.json +++ b/private/resources/language/en_US.json @@ -135,10 +135,13 @@ "unableToSaveRegistration": "Your registration could not be saved.
Please try again.
", "usageNoticeTitle": "Usage Notice", "usage_guideline": "

Welcome to the guide for using HAWKI, which is based on the OpenAI API. This guide is intended for all university affiliates - students, teachers, and staff - to provide a clear guideline on how to handle this technology responsibly. Please note that this guide supplements the terms of use of OpenAI and does not claim to be exhaustive. It is the users' responsibility to comply with these terms.

General Provisions

What is prohibited:

  • Entering personal data about oneself or others.
  • Using the services for illegal, harmful, or abusive activities.
  • Infringement, abuse, or violation of others' rights.
  • Modification, copying, renting, selling, or distributing our services.
  • Attempt at reverse engineering, decompiling, or discovering source code or underlying components.
  • Automatic or programmed extraction of data or output.
  • Claiming that the output was created by humans when it was not.
  • Interfering with or disrupting the services or circumventing protective measures.
  • Using the output to develop competing models.

What to consider:

You are responsible for the input you provide and the resulting output. You must ensure that your input does not infringe any rights and that you have all necessary rights, licenses, and permissions to provide it.

Accuracy:

Using the services can lead to inaccurate or incorrect output. It is important that you critically examine the output and not use it as the sole source of truth. Your inputs are not stored by HAWK, but by OpenAI for 30 days to detect any misuse. After 30 days, the data is deleted. Your inputs are not used to improve the product's safety or quality.

Specific Provisions

There is a provisional guideline and an independence declaration for using generative AI systems.

For students:

  • Use HAWKI to support your learning process, but do not rely solely on the generated answers.
  • Do not share personal data or information through HAWKI. Not even others' personal data.
  • You take on authorship. This means you vouch for the quality of the answer and take responsibility for the content. The use of AI and the nature of its contribution should be clarified.

For teachers:

  • It is prohibited to use HAWKI to correct student papers if they contain personal data that can be extracted.
  • Use HAWKI as a supplementary tool to prepare teaching materials, but make sure all content is checked for accuracy and relevance.

For staff:

  • It is strictly prohibited to enter confidentiality agreements or internally specified documents into HAWKI. As well as documents containing personal data about oneself or others.
  • Use HAWKI to increase efficiency and support your daily tasks, while observing the university's privacy policies and security regulations.

This guide serves as an orientation aid for the responsible handling of HAWKI. It is important that all users understand and follow these provisions to ensure safe and ethical use of this technology. The university can only offer this service if you do not enter personal data. For any questions or uncertainties, please contact Prof. Stefan Wölwer, Arian Sadafi, Jonas Trippler, or Vincent Timm. Regardless of this guide, the OpenAI Terms of Use apply.

", + "usage_guideline_confirm_request": "The function of HAWKI requires that your input is transmitted to third parties (OpenAI Inc. or GWDG, depending on the AI model) in order to generate the outputs. Do you agree to this and will you not enter any personal data about yourself or other persons?", "username": "Username", "welcomeBackTitle": "Welcome back!", "writingAssistanceRequest": "I am working on a scientific project and need help with writing style and formatting. I have already composed my work, but I am not sure if I have followed all formatting guidelines and writing conventions correctly. Could you please help me review my work and give me advice on improving the formatting and writing style?", "deleteChat": "The chat will be permanently deleted.
Do you want to continue?", "delete": "Delete", - "cancel": "Cancel" + "cancel": "Cancel", + "agree": "Agree", + "disagree": "Disagree" } \ No newline at end of file diff --git a/private/resources/language/es_ES.json b/private/resources/language/es_ES.json index 61768a8..9a41a51 100644 --- a/private/resources/language/es_ES.json +++ b/private/resources/language/es_ES.json @@ -135,10 +135,13 @@ "unableToSaveRegistration": "No se pudo guardar su registro.
Por favor, inténtelo de nuevo.
", "usageNoticeTitle": "Aviso de Uso", "usage_guideline": "

Bienvenidos a la guía para el manejo de HAWKI, basada en la API de OpenAI. Esta guía está diseñada para todos los miembros de la universidad - estudiantes, docentes y personal - para proporcionar una línea clara de cómo manejar esta tecnología de forma responsable. Por favor, tenga en cuenta que esta guía complementa las condiciones de uso de OpenAI y no es exhaustiva. Es responsabilidad de los usuarios cumplir con estas condiciones.

Disposiciones generales

Lo que está prohibido:

  • Introducir datos personales sobre uno mismo o sobre otros.
  • Usar los servicios para actividades ilegales, dañinas o abusivas.
  • Infracción, abuso o violación de los derechos de otros.
  • Modificación, copia, alquiler, venta o distribución de nuestros servicios.
  • Intento de ingeniería inversa, descompilación o descubrimiento del código fuente o componentes subyacentes.
  • Extracción automática o programada de datos o resultados.
  • Afirmar que el resultado fue creado por humanos cuando no es así.
  • Alteración o interrupción de los servicios o evasión de medidas de protección.
  • Uso de resultados para desarrollar modelos competidores.

Lo que debe considerarse:

Usted es responsable de la entrada que proporciona y del resultado que genera. Debe asegurarse de que su entrada no infrinja derechos y de que posee todos los derechos, licencias y permisos necesarios para proporcionarla.

Precisión:

El uso de los servicios puede llevar a resultados inexactos o erróneos. Es importante que revise críticamente el resultado y no lo utilice como la única fuente de verdad. Sus entradas no son almacenadas por HAWK, sino por OpenAI por 30 días para detectar posibles abusos. Después de 30 días, los datos son eliminados. Sus entradas no se utilizan para mejorar la seguridad o calidad del producto.

Disposiciones específicas

Existen una guía provisional y una declaración de independencia para el uso de sistemas de IA generativa.

Para estudiantes:

  • Use HAWKI para apoyar su proceso de aprendizaje, pero no dependa exclusivamente de las respuestas generadas.
  • No comparta datos personales o información a través de HAWKI. Tampoco datos personales de otros.
  • Usted asume la autoría. Esto significa que garantiza la calidad de la respuesta y asume la responsabilidad del contenido. El uso de IA y la naturaleza de su contribución deben ser clarificados.

Para docentes:

  • Está prohibido usar HAWKI para corregir trabajos de estudiantes si estos contienen datos personales que pueden extraerse.
  • Utilice HAWKI como una herramienta complementaria para preparar materiales de enseñanza, pero asegúrese de verificar todo el contenido por su precisión y relevancia.

Para el personal:

  • Está estrictamente prohibido introducir contratos de confidencialidad o documentos internamente determinados en HAWKI. Asimismo, documentos que contengan datos personales sobre uno mismo o sobre otros.
  • Utilice HAWKI para aumentar la eficiencia y apoyar sus tareas diarias, siempre respetando las políticas de privacidad y las regulaciones de seguridad de la universidad.

Esta guía sirve como una herramienta de orientación para el manejo responsable de HAWKI. Es crucial que todos los usuarios comprendan y sigan estas disposiciones para asegurar un uso seguro y ético de esta tecnología. La universidad solo puede ofrecer este servicio si no se introducen datos personales. Para cualquier pregunta o incertidumbre, por favor contacte a Prof. Stefan Wölwer, Arian Sadafi, Jonas Trippler o Vincent Timm. Independientemente de esta guía, se aplican las condiciones de uso de OpenAI.

", + "usage_guideline_confirm_request": "La función HAWKI requiere que sus datos sean transmitidos a terceros (OpenAI Inc. o GWDG, dependiendo del modelo de IA) para generar los resultados. Está de acuerdo con ello y no se introducirán datos personales suyos ni de otras personas?", "username": "Nombre de Usuario", "welcomeBackTitle": "¡Bienvenido de nuevo!", "writingAssistanceRequest": "Estoy trabajando en un proyecto científico y necesito ayuda con el estilo de escritura y la formateación. Ya he redactado mi trabajo, pero no estoy seguro de si he seguido todas las directrices de formateo y convenciones de escritura correctamente. ¿Podrías ayudarme a revisar mi trabajo y ofrecerme consejos para mejorar la formateación y el estilo de escritura?", "deleteChat": "El chat se borrará permanentemente.
¿Quieres continuar?", "delete": "Borrar", - "cancel": "Cancelar" + "cancel": "Cancelar", + "agree": "De acuerdo", + "disagree": "En desacuerdo" } \ No newline at end of file diff --git a/private/resources/language/fr_FR.json b/private/resources/language/fr_FR.json index 040ff7a..8ba5595 100644 --- a/private/resources/language/fr_FR.json +++ b/private/resources/language/fr_FR.json @@ -135,11 +135,13 @@ "unableToSaveRegistration": "Votre inscription n'a pas pu être sauvegardée.
Veuillez réessayer.
", "usageNoticeTitle": "Conseil d'Utilisation", "usage_guideline": "

Bienvenue dans le guide d'utilisation de HAWKI, basé sur l'API OpenAI. Ce guide est destiné à tous les membres de l'université - étudiants, enseignants et personnel - afin de fournir une ligne directrice claire sur la manière de gérer cette technologie de manière responsable. Veuillez noter que ce guide complète les conditions d'utilisation d'OpenAI et n'est pas exhaustif. Il est de la responsabilité des utilisateurs de respecter ces conditions.

Dispositions générales

Ce qui est interdit :

  • Saisir des données personnelles sur soi-même ou sur d'autres personnes.
  • Utiliser les services pour des activités illégales, nuisibles ou abusives.
  • Viol, abus ou violation des droits d'autres personnes.
  • Modification, copie, location, vente ou distribution de nos services.
  • Tentative de rétro-ingénierie, décompilation ou de découverte du code source ou des composants sous-jacents.
  • Extraction automatique ou programmée de données ou de sorties.
  • Pretendre que la sortie a été créée par des humains lorsque ce n'est pas le cas.
  • Altération ou perturbation des services ou contournement des mesures de protection.
  • Utilisation de la sortie pour développer des modèles concurrents.

À noter :

Vous êtes responsable de l'entrée que vous fournissez et de la sortie résultante. Vous devez vous assurer que votre entrée ne viole aucun droit et que vous disposez de tous les droits, licences et autorisations nécessaires pour fournir l'entrée.

Exactitude :

L'utilisation des services peut entraîner une sortie inexacte ou incorrecte. Il est important de critiquer la sortie et de ne pas l'utiliser comme la seule source de vérité. Vos entrées ne sont pas stockées par HAWK, mais par OpenAI pendant 30 jours pour détecter d'éventuels abus. Après 30 jours, les données sont supprimées. Vos entrées ne sont pas utilisées pour améliorer la sécurité ou la qualité du produit.

Dispositions spécifiques

Il existe une directive provisoire et une déclaration d'indépendance pour l'utilisation des systèmes de IA générative.

Pour les étudiants :

  • Utilisez HAWKI pour soutenir votre processus d'apprentissage, mais ne vous fiez pas exclusivement aux réponses générées.
  • Ne partagez pas de données personnelles ou d'informations via HAWKI. Pas même celles d'autres personnes.
  • Vous prenez la responsabilité de l'auteur. Vous garantissez la qualité de la réponse et assumez la responsabilité du contenu. L'utilisation de l'IA et la nature de sa contribution doit être clarifiée.

Pour les enseignants :

  • Il est interdit d'utiliser HAWKI pour corriger les travaux étudiants contenant des données personnelles extractibles.
  • Utilisez HAWKI comme un outil complémentaire pour la préparation du matériel pédagogique, mais assurez-vous que tout le contenu est vérifié pour son exactitude et sa pertinence.

Pour le personnel :

  • Il est strictement interdit de saisir des accords de confidentialité ou des documents internes dans HAWKI. Ainsi que des documents contenant des données personnelles sur soi-même ou sur d'autres personnes.
  • Utilisez HAWKI pour augmenter l'efficacité et soutenir vos tâches quotidiennes, tout en respectant les politiques de confidentialité et les réglementations de sécurité de l'université.

Ce guide vise à fournir une orientation pour une gestion responsable de HAWKI. Il est crucial que tous les utilisateurs comprennent et suivent ces dispositions pour assurer une utilisation sûre et éthique de cette technologie. L'université ne peut offrir ce service que si aucune donnée personnelle n'est saisie. Pour toute question ou incertitude, veuillez contacter Prof. Stefan Wölwer, Arian Sadafi, Jonas Trippler ou Vincent Timm. Indépendamment de ce guide, les conditions d'utilisation d'OpenAI s'appliquent.

", + "usage_guideline_confirm_request": "Le fonctionnement de HAWKI suppose impérativement, pour la génération des sorties, que vos entrées soient transmises à des tiers (selon le modèle d'IA, OpenAI Inc. ou GWDG). Êtes-vous d'accord avec cela et ne saisirez-vous pas de données personnelles vous concernant ou concernant d'autres personnes?", "username": "Nom d'utilisateur", "welcomeBackTitle": "Bienvenue de nouveau !", "writingAssistanceRequest": "Je travaille sur un projet scientifique et j'ai besoin d'aide pour le style d'écriture et la mise en forme. J'ai déjà rédigé mon travail, mais je ne suis pas sûr d'avoir suivi toutes les directives de formatage et les conventions d'écriture correctement. Pourriez-vous m'aider à réviser mon travail et me donner des conseils pour améliorer la mise en forme et le style d'écriture ?", "deleteChat": "La discussion sera définitivement supprimée.
Voulez-vous continuer ?", "delete": "Supprimer", - "cancel": "Annuler" - + "cancel": "Annuler", + "agree": "d'accord", + "disagree": "pas d'accord" } \ No newline at end of file diff --git a/private/resources/language/it_IT.json b/private/resources/language/it_IT.json index 75d6810..c614c8e 100644 --- a/private/resources/language/it_IT.json +++ b/private/resources/language/it_IT.json @@ -135,10 +135,13 @@ "unableToSaveRegistration": "La registrazione non può essere salvata.
Si prega di riprovare.
", "usageNoticeTitle": "Avviso di Utilizzo", "usage_guideline": "

Benvenuti alla guida per l'uso di HAWKI, basata sull'API di OpenAI. Questa guida è destinata a tutti i membri dell'università - studenti, insegnanti e personale - per fornire una linea guida chiara su come gestire questa tecnologia in modo responsabile. Si prega di notare che questa guida integra i termini di utilizzo di OpenAI e non è esaustiva. È responsabilità degli utenti rispettare tali termini.

Disposizioni generali

Cosa è vietato:

  • Inserire dati personali su se stessi o su altri.
  • Utilizzare i servizi per attività illegali, dannose o abusive.
  • Violazione, abuso o infrazione dei diritti altrui.
  • Modifica, copia, noleggio, vendita o distribuzione dei nostri servizi.
  • Tentativo di reverse engineering, decompilazione o scoperta del codice sorgente o dei componenti sottostanti.
  • Estrazione automatica o programmata di dati o output.
  • Affermare che l'output è stato creato da umani quando non è così.
  • Alterazione o interruzione dei servizi o elusione delle misure di protezione.
  • Uso dell'output per sviluppare modelli concorrenti.

Cosa tenere presente:

Siete responsabili dell'input fornito e dell'output risultante. Dovete assicurarvi che il vostro input non violi alcun diritto e che disponiate di tutti i diritti, licenze e autorizzazioni necessari per fornirlo.

Accuratezza:

L'utilizzo dei servizi può portare a output inaccurati o errati. È importante che valutiate criticamente l'output e che non lo utilizziate come unica fonte di verità. I vostri input non sono memorizzati da HAWK, ma da OpenAI per 30 giorni al fine di rilevare eventuali abusi. Dopo 30 giorni, i dati vengono cancellati. I vostri input non sono utilizzati per migliorare la sicurezza o la qualità del prodotto.

Disposizioni specifiche

Ci sono una linea guida provvisoria e una dichiarazione di indipendenza per l'utilizzo dei sistemi di IA generativa.

Per gli studenti:

  • Utilizzate HAWKI per supportare il vostro processo di apprendimento, ma non affidatevi esclusivamente alle risposte generate.
  • Non condividete dati personali o informazioni tramite HAWKI. Nemmeno i dati personali di altri.
  • Assumete la paternità. Ciò significa che garantite la qualità della risposta e assumete la responsabilità del contenuto. L'uso dell'IA e la natura del suo contributo devono essere chiariti.

Per gli insegnanti:

  • È vietato utilizzare HAWKI per correggere i lavori degli studenti se contengono dati personali estraibili.
  • Utilizzate HAWKI come strumento complementare per la preparazione dei materiali didattici, ma assicuratevi che tutto il contenuto sia verificato per la sua accuratezza e rilevanza.

Per il personale:

  • È severamente proibito inserire accordi di riservatezza o documenti interni su HAWKI. Anche documenti che contengono dati personali su se stessi o su altri.
  • Utilizzate HAWKI per aumentare l'efficienza e supportare le vostre attività quotidiane, rispettando sempre le politiche di privacy e le normative di sicurezza dell'università.

Questa guida serve come orientamento per un uso responsabile di HAWKI. È importante che tutti gli utenti comprendano e seguano queste disposizioni per garantire un utilizzo sicuro ed etico di questa tecnologia. L'università può offrire questo servizio solo se non vengono inseriti dati personali. Per qualsiasi domanda o incertezza, si prega di contattare il Prof. Stefan Wölwer, Arian Sadafi, Jonas Trippler o Vincent Timm. Indipendentemente da questa guida, si applicano le condizioni d'uso di OpenAI.

", + "usage_guideline_confirm_request": "La funzione HAWKI prevede che i vostri input vengano trasmessi a terzi (OpenAI Inc. o GWDG, a seconda del modello di AI) per generare gli output. Siete d'accordo e non verranno inseriti dati personali da parte vostra o di altre persone?", "username": "Nome Utente", "welcomeBackTitle": "Bentornato!", "writingAssistanceRequest": "Sto lavorando a un progetto scientifico e ho bisogno di aiuto con lo stile di scrittura e la formattazione. Ho già redatto il mio lavoro, ma non sono sicuro di aver seguito tutte le linee guida di formattazione e le convenzioni di scrittura correttamente. Potresti aiutarmi a rivedere il mio lavoro e fornirmi consigli su come migliorare la formattazione e lo stile di scrittura?", "deleteChat": "La chat sarà cancellata in modo permanente.
Volete continuare?", "delete": "Cancellare", - "cancel": "Annullamento" + "cancel": "Annullamento", + "agree": "Sono d'accordo", + "disagree": "Non sono d'accordo" } \ No newline at end of file diff --git a/private/views/guidelines.php b/private/views/guidelines.php index a6a2ddd..564bbaf 100644 --- a/private/views/guidelines.php +++ b/private/views/guidelines.php @@ -10,10 +10,13 @@

-
- - -
+

+ +

+ + +
+


From dabb4f2744b09e29cffabe82896f61707422faea Mon Sep 17 00:00:00 2001 From: Ariansdf <38947447+Ariansdf@users.noreply.github.com> Date: Fri, 23 Aug 2024 17:33:23 +0200 Subject: [PATCH 11/14] class added to guideline buttons --- private/views/guidelines.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/private/views/guidelines.php b/private/views/guidelines.php index 564bbaf..1e53932 100644 --- a/private/views/guidelines.php +++ b/private/views/guidelines.php @@ -12,9 +12,9 @@

-

- +


From 6b79ee2ead9a8dfca6dd780da1170eb0a4699af5 Mon Sep 17 00:00:00 2001 From: Tim <37832993+ShUl0w@users.noreply.github.com> Date: Fri, 23 Aug 2024 17:40:41 +0200 Subject: [PATCH 12/14] Improved code copy behaviour (#82) hey @ShUl0w thanks for your contribution and detailed description. and sorry for the late reply. I'm going to merge your pull request into development. --- private/pages/interface.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/private/pages/interface.php b/private/pages/interface.php index fe6506c..ce949d6 100644 --- a/private/pages/interface.php +++ b/private/pages/interface.php @@ -722,6 +722,30 @@ function CopyContentToClipboard(target) { table.parentNode.replaceChild(textNode, table); }); + // Remove code language from copy content + if(clone.tagName === "CODE") { + const firstChildNode = clone.firstChild; + const lastChildNode = clone.lastChild; + + if(firstChildNode && firstChildNode.nodeName === "#text") { + // Remove the first node, as it contains the code language + // It is possible that the code language is followed by actual code, so check for that + if(firstChildNode.textContent.includes("\n")) { + firstChildNode.textContent = firstChildNode.textContent.split("\n")[1]; + } else { + clone.removeChild(firstChildNode); + } + } + + if (lastChildNode && lastChildNode.nodeName === "#text") { + // In some cases, there might be markdown content at the end of the code block due to formatting errors + const re = "\n?```" + if(lastChildNode.textContent.match(re)) { + lastChildNode.textContent = lastChildNode.textContent.replace("\n```", ""); + } + } + } + // Get the text content of the modified clone const msgTxt = clone.textContent.trim(); From 056ae1eea6736af609c7a9fa5243e0d7312ad2f8 Mon Sep 17 00:00:00 2001 From: ItsNotYou Date: Fri, 23 Aug 2024 17:46:10 +0200 Subject: [PATCH 13/14] Add option for default username initials. (#80) Hey @ItsNotYou Thanks for you contribution and sorry for the late reply. I'm going to merge your request into development. --- README.md | 1 + private/.env.example | 1 + private/app/php/auth.php | 14 ++++++++++---- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ebd7028..698b2e6 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,7 @@ 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. | diff --git a/private/.env.example b/private/.env.example index eb9a622..4201af8 100644 --- a/private/.env.example +++ b/private/.env.example @@ -11,6 +11,7 @@ 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=" diff --git a/private/app/php/auth.php b/private/app/php/auth.php index e5d487d..0f6bb03 100644 --- a/private/app/php/auth.php +++ b/private/app/php/auth.php @@ -121,10 +121,16 @@ function handleLdapLogin($username, $password){ // Close LDAP connection ldap_close($ldapConn); - // Extract initials from user's display name - $name = $info[0]["displayname"][0]; - $parts = explode(", ", $name); - $initials = substr($parts[1], 0, 1) . substr($parts[0], 0, 1); + // Get username + if (isset($env['LDAP_DEFAULT_INITIALS']) && !empty($env['LDAP_DEFAULT_INITIALS'])) { + // Use default initials + $initials = $env['LDAP_DEFAULT_INITIALS']; + } else { + // Extract initials from user's display name + $name = $info[0]["displayname"][0]; + $parts = explode(", ", $name); + $initials = substr($parts[1], 0, 1) . substr($parts[0], 0, 1); + } // Set session variables $_SESSION['username'] = $initials; From 14d3168adea7bd672099d8b34d2fb704bbc881e0 Mon Sep 17 00:00:00 2001 From: Nils Date: Tue, 17 Sep 2024 14:22:33 +0200 Subject: [PATCH 14/14] Fix evaluation of MODEL_SELECTOR_ACTIVATION config variable (#86) Co-authored-by: Ariansdf <38947447+Ariansdf@users.noreply.github.com> --- private/pages/interface.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/private/pages/interface.php b/private/pages/interface.php index ce949d6..e29da67 100644 --- a/private/pages/interface.php +++ b/private/pages/interface.php @@ -206,9 +206,9 @@
-