<div class="flex flex-col gap-4">
  <div class="flex gap-2 items-top border-b pb-4">
    <%= form.check_box :enable_shared_messages, class: "rounded-md bg-gray-400 w-4 h-4 m-2 p-2 w-6", data: { id: @bot.id, controller: "botsettings", action: "click->botsettings#toggle_setting", field: "enable_shared_messages" } %>
    <div class="flex-1">
      <%= form.label :enable_shared_messages, "Enable knowledge sharing (recommended)", class: "text-gray-700" %>
      <div class="text-gray-500 text-xs"><%= it("Allows bot to share knowledge gained with other bots on this server.") %></div>
    </div>
  </div>
  <div class="flex gap-2 items-top border-b pb-4">
    <%= form.check_box :enable_observations, class: "rounded-md bg-gray-400 w-4 h-4 m-2 p-2 w-6", data: { id: @bot.id, controller: "botsettings", action: "click->botsettings#toggle_setting", field: "enable_observations" } %>
    <div class="flex-1">
      <%= form.label :enable_observations, "Enable observations", class: "text-gray-700" %>
      <div class="text-gray-500 text-xs"><%= it("Make private observations about the user after each message exchange. Happens automatically in a background process.") %></div>
    </div>
  </div>
  <div class="flex gap-2 items-top">
    <%= form.check_box :short_term_memory, class: "rounded-md bg-gray-400 w-4 h-4 m-2 p-2 w-6", data: { id: @bot.id, controller: "botsettings", action: "click->botsettings#toggle_setting", field: "short_term_memory" } %>
    <div class="flex-1">
      <%= form.label :short_term_memory, "Enable short term memory", class: "text-gray-700" %>
      <div class="text-gray-500 text-xs"><%= it("Inserts most recent and important observations into the start of each conversation. (Hidden to user.)") %></div>
    </div>
  </div>
  <% if @bot.short_term_memory? %>
    <div class="ml-12">
      <div class="flex gap-2 items-center">
        <%= form.label :recent_thoughts_count, it("How many thoughts to insert?"), class: "text-gray-700 mb-1" %>
        <%= form.number_field :recent_thoughts_count, class: "w-12 text-gray-800 rounded-sm border-0 p-1 text-sm text-center mb-1", required: true, min: 1, max: 20 %>
      </div>
      <div class="text-gray-500 text-xs"><%= it("How many thoughts to insert from 1 to 20. Suggested value is 10.") %></div>
    </div>
  <% end %>
  <div class="flex gap-2 items-top  border-t pt-4">
    <%= form.check_box :long_term_memory, class: "rounded-md bg-gray-400 w-4 h-4 m-2 p-2 w-6", data: { id: @bot.id, controller: "botsettings", action: "click->botsettings#toggle_setting", field: "long_term_memory" } %>
    <div class="flex-1">
      <%= form.label :long_term_memory, it("Enable long-term memory"), class: "text-gray-700" %>
      <div class="text-gray-500 text-xs"><%= it("Considers what observations may be relevant prior to answering a prompt. Adds 5-15 seconds latency to each interaction.") %></div>
    </div>
  </div>
  <% if @bot.long_term_memory? %>
    <div class="ml-12">
      <div class="flex gap-2 items-center">
        <%= form.label :ltm_recent_messages_count, it("How many recent messages to use as context?"), class: "text-gray-700 mb-1" %>
        <%= form.number_field :ltm_recent_messages_count, class: "w-12 text-gray-800 rounded-sm border-0 p-1 text-sm text-center mb-1", required: true, min: 2, max: 10 %>
      </div>
      <div class="text-gray-500 text-xs"><%= it("How many latest messages to use as context for memory search. Suggested value is 2.") %></div>
    </div>
  <% end %>
</div>
