Gustavo Zanatta 8 часов назад
Родитель
Сommit
445bb7e947
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      src/components/profile/ProfileHelpDialog.vue

+ 4 - 1
src/components/profile/ProfileHelpDialog.vue

@@ -110,6 +110,7 @@
             input-class="text-text"
             :placeholder="$t('profile.help.message_placeholder')"
             :disable="loading"
+            :maxlength="MESSAGE_MAX_LENGTH"
             @keyup.enter="sendMessage()"
           />
           <q-btn
@@ -148,6 +149,8 @@ const $q = useQuasar();
 const { t } = useI18n();
 const store = chatbotStore();
 
+const MESSAGE_MAX_LENGTH = 4000;
+
 const messageInput = ref('');
 const loading = ref(false);
 const messagesContainer = ref(null);
@@ -192,7 +195,7 @@ const sendMessage = async (text) => {
 
   try {
     const history = store.messages
-      .slice(-6, -1)
+      .slice(0, -1)
       .map(({ role, text: msgText }) => ({ role, text: msgText }));
 
     const reply = await sendChatMessage({ message: content, history });