mirror of
https://github.com/we-promise/sure.git
synced 2026-04-08 14:54:49 +00:00
* Replace Maybe for Sure in select code areas * Make sure passwords are consistent * Remove (admin|member) from demo data first name * Database and schema names finally to `sure` * Fix broken test * Another (benchmarking) database name to `sure_*` * More rebranding to Sure * Missed this Maybe mention in the same page * Random nitpicks and more Maybes * Demo data accounts and more Maybes * Test data account updates * Impersonation test accounts * Consistency with `compose.example.yml`
27 lines
1.3 KiB
Plaintext
27 lines
1.3 KiB
Plaintext
<div class="rounded-lg p-4 bg-container shadow-border-xs">
|
|
<div class="flex justify-center mb-4">
|
|
<%= render "chats/ai_avatar" %>
|
|
</div>
|
|
|
|
<h3 class="text-sm font-medium text-primary mb-1 -mt-2 text-center">Enable AI Chats</h3>
|
|
|
|
<p class="text-gray-600 mb-4 text-sm text-center">
|
|
<% if Current.user.ai_available? %>
|
|
AI chat can answer financial questions and provide insights based on your data. To use this feature you'll need to explicitly enable it.
|
|
<% else %>
|
|
To use the AI assistant, you need to set the <code class="bg-surface-inset px-1 py-0.5 rounded font-mono text-xs">OPENAI_ACCESS_TOKEN</code>
|
|
environment variable or configure it in the Self-Hosting settings of your instance.
|
|
<% end %>
|
|
</p>
|
|
|
|
<% if Current.user.ai_available? %>
|
|
<%= form_with url: user_path(Current.user), method: :patch, class: "w-full", data: { turbo: false } do |form| %>
|
|
<%= form.hidden_field "user[ai_enabled]", value: true %>
|
|
<%= form.hidden_field "user[redirect_to]", value: "home" %>
|
|
<%= form.submit "Enable AI Chats", class: "cursor-pointer hover:bg-inverse-hover w-full py-2 px-4 bg-inverse fg-inverse rounded-lg text-sm font-medium" %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<p class="text-xs text-secondary text-center mt-2">Disable anytime. All data sent to our LLM providers is anonymized.</p>
|
|
</div>
|