latapp 10 месяцев назад
Родитель
Сommit
66e83d79a9
4 измененных файлов с 8 добавлено и 5 удалено
  1. 1 0
      llm_logs.txt
  2. 3 3
      public/index.html
  3. 1 1
      public/js/app.js
  4. 3 1
      public/js/service.js

+ 1 - 0
llm_logs.txt

@@ -0,0 +1 @@
+asd: ¡Parece que hubo un pequeño error! 😄 Si tienes alguna pregunta sobre nuestro menú o necesitas recomendaciones, ¡estaré encantado de ayudarte! 🍻✨

+ 3 - 3
public/index.html

@@ -38,7 +38,7 @@
     <section id="menuTab" data-tab>
       <div class="px-4 pt-4 pb-3 "></div>
         <h2 class="text-[22px] mx-4 font-bold text-[#101419]">
-          PIDE TU SHOP EXPRESS  🍺
+          PIDE TU SHOP EXPRESS  ⚡🍺
         </h2>
         <p class="product-type mx-4 text-[#58728d] text-sm pb-4 mb-4 border-b border-gray-200">*solo lo más vendido</p>
       </div>
@@ -163,11 +163,11 @@
 
     <input id="clientCodeInput"
            class="w-full border px-3 py-2 rounded-md"
-           placeholder="Nombre" />
+           placeholder="Ingresa tu nombre" />
     <input id="tableInput"
            type="number" min="1"
            class="w-full border px-3 py-2 rounded-md"
-           placeholder="Mesa #" />
+           placeholder="Ingresa tu numero de mesa" />
 
 
     <button id="sessionAcceptBtn"

+ 1 - 1
public/js/app.js

@@ -251,7 +251,7 @@ async function sendMessageToAI() {
     aiLoadingIndicator.classList.remove("hidden");
 
     try {
-        const response = await serviceSendMessage(userInput, chatHistory);
+        const response = await serviceSendMessage(userInput, chatHistory, userName);
         if (!response) {
             displayChatMessage("ai", "Hubo un problema al conectar con el Chef IA.");
         } else if (response === "not_init") {

+ 3 - 1
public/js/service.js

@@ -24,13 +24,15 @@ async function sendMessage(message, messageList, userName) {
     return;
   }
   messageList.push({ role: "user", content: message });
+  const cuerpo = { messages: messageList, user: userName }
+  console.log(cuerpo)
   const response = await fetch("/api/chat/completions", {
     method: "POST",
     headers: {
       "Content-Type": "application/json",
       "X-App-Token": chatToken
     },
-    body: JSON.stringify({ messages: messageList, user: userName })
+    body: JSON.stringify(cuerpo)
   });
   if (!response.ok) {
     const errorData = await response.json().catch(() => ({ message: "Respuesta no válida del servidor." }));