Skip to content

Commit f5bb97b

Browse files
committed
Refactor ChatBot Index component for improved code readability and layout
1 parent d7d7562 commit f5bb97b

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

resources/js/Pages/ChatBot/Index.vue

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
<label class="block text-sm font-medium text-gray-700 dark:text-gray-200">
1717
Model
1818
</label>
19-
<select v-model="selectedModel"
20-
class="mt-1 w-full p-2 border rounded-md bg-white dark:bg-gray-700
21-
text-gray-900 dark:text-gray-200 border-gray-300 dark:border-gray-600">
19+
<select v-model="selectedModel" class="mt-1 w-full p-2 border rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-200 border-gray-300 dark:border-gray-600">
2220
<option value="gpt-3.5-turbo">GPT-3.5 Turbo</option>
2321
<option value="gpt-4o-mini">GPT-4o-mini</option>
2422
<option value="gpt-4o">GPT-4o</option>
@@ -28,18 +26,14 @@
2826
<label class="block text-sm font-medium text-gray-700 dark:text-gray-200">
2927
Temperature
3028
</label>
31-
<input type="number" step="0.1" min="0" max="1.5" v-model="temperature"
32-
class="mt-1 w-full p-2 border rounded-md bg-white dark:bg-gray-700
33-
text-gray-900 dark:text-gray-200 border-gray-300 dark:border-gray-600"/>
29+
<input type="number" step="0.1" min="0" max="1.5" v-model="temperature" class="mt-1 w-full p-2 border rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-200 border-gray-300 dark:border-gray-600"/>
3430
</div>
3531
<!-- Prompt as Select -->
3632
<div class="flex-1">
3733
<label class="block text-sm font-medium text-gray-700 dark:text-gray-200">
3834
Prompt
3935
</label>
40-
<select v-model="prompt"
41-
class="mt-1 w-full p-2 border rounded-md bg-white dark:bg-gray-700
42-
text-gray-900 dark:text-gray-200 border-gray-300 dark:border-gray-600">
36+
<select v-model="prompt" class="mt-1 w-full p-2 border rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-200 border-gray-300 dark:border-gray-600">
4337
<option value="assistant">Assistant</option>
4438
<option value="grammar_correction">Grammar Correction</option>
4539
<option value="sarcastic_response">Sarcastic</option>
@@ -54,9 +48,7 @@
5448
</div>
5549

5650
<!-- Chat Messages -->
57-
<div ref="chatContainer"
58-
:class="['border border-gray-300 dark:border-gray-600 rounded-md p-4 h-96 overflow-y-auto mb-4', { blinking: isGenerating }]"
59-
>
51+
<div ref="chatContainer" :class="['border border-gray-300 dark:border-gray-600 rounded-md p-4 h-96 overflow-y-auto mb-4', { blinking: isGenerating }]">
6052
<div
6153
v-for="(msg, index) in messages"
6254
:key="index"
@@ -71,8 +63,7 @@
7163
<div
7264
v-else
7365
:class="[ 'message', 'bg-blue-500 text-white' ]"
74-
class="p-3 rounded-md max-w-lg md:max-w-xl"
75-
>
66+
class="p-3 rounded-md max-w-lg md:max-w-xl">
7667
{{ msg.text }}
7768
</div>
7869
</div>

0 commit comments

Comments
 (0)