Add tone support

This commit is contained in:
2025-04-08 18:38:07 +03:00
parent 8082eae230
commit 3fb4afd4fa
8 changed files with 53 additions and 18 deletions

View File

@@ -2,7 +2,7 @@
<div class="flex justify-between items-center gap-4">
<div>
<div class="font-semibold"><slot name="title" /></div>
<div class="text-slate-600 text-sm">
<div class="text-slate-600 text-sm hidden md:block">
<slot name="description" />
</div>
</div>

View File

@@ -13,9 +13,10 @@ interface FormData {
const preferences = useState<FormData>("preferences", () => ({
enabled: false,
language: "English",
tone: "Casual",
}));
const { status, refresh } = useFetch("/api/preferences", {
const { status } = useFetch("/api/preferences", {
onResponse({ error, response }) {
if (error) {
return;
@@ -86,6 +87,20 @@ const saveOp = watchPausable(
/>
</template>
</CardField>
<CardField>
<template #title> Model tone </template>
<template #description>
Tone used for generated titles and descriptions.
</template>
<template #value>
<USelect
class="min-w-28"
v-model="preferences.tone"
:items="tones"
/>
</template>
</CardField>
</div>
</UCard>
</UContainer>

View File

@@ -1,7 +0,0 @@
export const languages = ref([
"English",
"Greek",
"German",
"Italian",
"Polish",
]);

20
app/utils/model.ts Normal file
View File

@@ -0,0 +1,20 @@
export const languages = ref([
"English",
"Greek",
"German",
"Italian",
"Polish",
]);
export const tones = ref([
"Motivational",
"Casual",
"Funny",
"Epic",
"Minimalist",
"Reflective",
"Poetic",
"Competitive",
"Adventure",
"Snarky",
]);