diff --git a/admin/src/components/AiChat.vue b/admin/src/components/AiChat.vue index ad568edd5..ca1d3a93a 100644 --- a/admin/src/components/AiChat.vue +++ b/admin/src/components/AiChat.vue @@ -1,57 +1,76 @@ @@ -68,11 +87,12 @@ const sendMessage = () => { position: absolute; bottom: 0; right: 0; + border: 1px solid darkblue; } .chat-window { - width: 300px; - height: 400px; + width: 450px; + height: 600px; background-color: white; border: 1px solid #ccc; border-radius: 8px; @@ -109,11 +129,11 @@ const sendMessage = () => { margin-left: auto; } -.message.bot { +.message.assistant { text-align: left; } -.message.bot .message-content { +.message.assistant .message-content { background-color: #e9ecef; color: black; margin-right: auto; diff --git a/admin/src/config/index.js b/admin/src/config/index.js index b73657219..0b63726ba 100644 --- a/admin/src/config/index.js +++ b/admin/src/config/index.js @@ -51,11 +51,14 @@ const debug = { DEBUG_DISABLE_AUTH: process.env.DEBUG_DISABLE_AUTH === 'true' ?? false, } +const OPENAI_ACTIVE = process.env.OPENAI_ACTIVE === 'true' ?? false + const CONFIG = { ...version, ...environment, ...endpoints, ...debug, + OPENAI_ACTIVE, ADMIN_MODULE_URL, COMMUNITY_URL, } diff --git a/admin/src/config/schema.js b/admin/src/config/schema.js index 7aee8136f..459cbdd08 100644 --- a/admin/src/config/schema.js +++ b/admin/src/config/schema.js @@ -6,6 +6,7 @@ const { DEBUG, GRAPHQL_URI, NODE_ENV, + OPENAI_ACTIVE, PRODUCTION, } = require('gradido-config/build/src/commonSchema.js') const Joi = require('joi') @@ -18,6 +19,7 @@ module.exports = Joi.object({ DEBUG, GRAPHQL_URI, NODE_ENV, + OPENAI_ACTIVE, PRODUCTION, ADMIN_HOSTING: Joi.string() diff --git a/admin/src/graphql/aiChat.graphql b/admin/src/graphql/aiChat.graphql new file mode 100644 index 000000000..7d4d726eb --- /dev/null +++ b/admin/src/graphql/aiChat.graphql @@ -0,0 +1,7 @@ +mutation sendMessage($input: OpenaiMessage!) { + sendMessage(input: $input) { + content + role + threadId + } +} \ No newline at end of file diff --git a/admin/src/locales/de.json b/admin/src/locales/de.json index 237705ec2..d009946ac 100644 --- a/admin/src/locales/de.json +++ b/admin/src/locales/de.json @@ -3,9 +3,13 @@ "actions": "Aktionen", "alias": "Alias", "all_emails": "Alle Nutzer", + "ai": { + "chat": "Chat", + "chat-open": "Chat öffnen", + "chat-placeholder": "Schreibe eine Nachricht..." + }, "back": "zurück", "change_user_role": "Nutzerrolle ändern", - "chat": "Chat", "close": "Schließen", "contributionLink": { "amount": "Betrag", @@ -226,6 +230,7 @@ "removeNotSelf": "Als Admin/Moderator kannst du dich nicht selber löschen.", "reset": "Zurücksetzen", "save": "Speichern", + "send": "Senden", "statistic": { "activeUsers": "Aktive Mitglieder", "count": "Menge", diff --git a/admin/src/locales/en.json b/admin/src/locales/en.json index cb1f24477..eec10eece 100644 --- a/admin/src/locales/en.json +++ b/admin/src/locales/en.json @@ -3,9 +3,13 @@ "actions": "Actions", "alias": "Alias", "all_emails": "All users", + "ai": { + "chat": "Chat", + "chat-open": "Open chat", + "chat-placeholder": "Type your message here..." + }, "back": "back", "change_user_role": "Change user role", - "chat": "Chat", "close": "Close", "contributionLink": { "amount": "Amount", @@ -226,6 +230,7 @@ "removeNotSelf": "As an admin/moderator, you cannot delete yourself.", "reset": "Reset", "save": "Save", + "send": "Send", "statistic": { "activeUsers": "Active members", "count": "Count", diff --git a/admin/src/pages/CreationConfirm.vue b/admin/src/pages/CreationConfirm.vue index d23402f6d..557ba587f 100644 --- a/admin/src/pages/CreationConfirm.vue +++ b/admin/src/pages/CreationConfirm.vue @@ -69,7 +69,7 @@ align="center" :hide-ellipsis="true" /> - +