Skip to content

Commit d429a21

Browse files
committed
Merge branch 'development' into feat/Martin/Docker-infrastructure
2 parents de21634 + 34517c7 commit d429a21

File tree

8 files changed

+29
-6
lines changed

8 files changed

+29
-6
lines changed

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
# - APP_PREVIOUS_KEYS: Comma seperated list of previously used encryption keys
4040
# - APP_MAINTENANCE_DRIVER: Maintenance mode driver: "cache" or "file": "cache" allows setting the maintenance mode across multiple machines
4141
# - APP_MAINTENANCE_STORE: Maintenance mode storage: "database" or ???
42+
# - AI_MENTION_HANDLE: Hnadle to mention AI in group chats.
43+
4244

4345
PROJECT_NAME=hawki2
4446
APP_NAME= HAWKI2
@@ -57,6 +59,9 @@ APP_PREVIOS_KEYS=
5759
APP_MAINTENANCE_DRIVER= cache
5860
APP_MAINTENANCE_STORE= database
5961

62+
AI_MENTION_HANDLE="hawki"
63+
64+
6065
# ===============
6166
# Database server
6267
# ===============

config/app.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,18 @@
123123
'store' => env('APP_MAINTENANCE_STORE', 'database'),
124124
],
125125

126+
127+
/*
128+
|--------------------------------------------------------------------------
129+
| AI Mention Handle
130+
|--------------------------------------------------------------------------
131+
|
132+
| The handle which allows users to mention AI in groupchats.
133+
|
134+
|
135+
*/
136+
'aiHandle' => '@'. env('AI_MENTION_HANDLE', 'hawki'),
137+
138+
139+
126140
];

public/js_v2.0.1/groupchat_functions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ async function onSendMessageToRoom(inputField) {
9494

9595
// console.log(messageObj);
9696
// if HAWKI is targeted send copy to stream controller
97-
if(submittedObj.filteredContent.aiMention && submittedObj.filteredContent.aiMention.toLowerCase().includes('@hawki')){
97+
if(submittedObj.filteredContent.aiMention && submittedObj.filteredContent.aiMention.toLowerCase().includes(aiHandle.toLowerCase())){
9898

9999
const aiCryptoSalt = await fetchServerSalt('AI_CRYPTO_SALT');
100100
const aiKey = await deriveKey(roomKey, activeRoom.slug, aiCryptoSalt);

public/js_v2.0.1/message_functions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ function detectMentioning(rawText){
422422
let processedText = rawText;
423423

424424
for (const mention of mentionMatches) {
425-
if (mention.toLowerCase() === "@hawki") {
425+
if (mention.toLowerCase() === aiHandle.toLowerCase()) {
426426
returnObj.aiMentioned = true;
427427
returnObj.aiMention = mention; // Remove the '@' for aiMention
428428
processedText = processedText.replace(new RegExp(mention, 'i'), '').trim();

resources/language/de_DE.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"Impressum": "Impressum",
7979
"Info": "Info",
8080
"Input_Placeholder_Chat": "Hier kannst Du deine Anfrage stellen",
81-
"Input_Placeholder_Room": "Schreibe eine Gruppennachricht oder erwähne @hawki, um die KI zu nutzen.",
81+
"Input_Placeholder_Room": "Schreibe eine Gruppennachricht oder nutze die KI mit ",
8282
"language": "Sprache",
8383
"LeaveRoom": "Raum Verlassen",
8484
"LeftRoom": "hat den Raum verlassen",

resources/language/en_US.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"Impressum": "Imprint",
7777
"Info": "Info",
7878
"Input_Placeholder_Chat": "You can enter your request here",
79-
"Input_Placeholder_Room": "Write a group message or mention to use the AI.",
79+
"Input_Placeholder_Room": "Write a group message or use the AI model by mentioning",
8080
"language": "Language",
8181
"LeaveRoom": "Leave Room",
8282
"LeftRoom": "left room",

resources/views/layouts/home.blade.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,12 @@
8585
const defaultModel = @json($models).defaultModel;
8686
const systemModels = @json($models).systemModels;
8787
88+
89+
const aiHandle = "{{ config('app.aiHandle') }}";
90+
91+
8892
window.addEventListener('DOMContentLoaded', async (event) => {
89-
93+
9094
setSessionCheckerTimer(0);
9195
CheckModals()
9296

resources/views/partials/home/input-field.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class="input-field"
174174

175175
@elseif($activeModule === 'groupchat')
176176

177-
placeholder="{{ $translation['Input_Placeholder_Room'] }}"
177+
placeholder="{{ $translation['Input_Placeholder_Room'] ." ". config('app.aiHandle')}}"
178178
oninput="resizeInputField(this); onGroupchatType()"
179179
onkeypress="onHandleKeydownRoom(event)"
180180

0 commit comments

Comments
 (0)