Skip to content

Commit ea7f544

Browse files
authored
しきい値を0-1から0.1-1に変更 (#191)
* refactor(api): change guardian score threshold * refactor(web): change guardian playgroud score threshold
1 parent 9a59c66 commit ea7f544

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

apps/web/src/app/(main)/dashboard/(palygroud)/components/playground-form.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@ export function PlaygroundForm() {
8080
<Field>
8181
<Label htmlFor={fields.score_threshold.id}>しきい値</Label>
8282
<div className="flex flex-wrap items-center gap-3 md:flex-nowrap">
83-
<SliderConform meta={fields.score_threshold} max={1} step={0.1} />
83+
<SliderConform
84+
meta={fields.score_threshold}
85+
max={1}
86+
step={0.1}
87+
min={0.1}
88+
/>
8489
<ScoreThresholdDescription
8590
value={Number(fields.score_threshold.value)}
8691
/>

apps/web/src/app/(main)/dashboard/(palygroud)/components/score-threshold-description.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ export default function ScoreThresholdDescription({
1616
setDescription('中程度の問題あり')
1717
} else if (value >= 0.3) {
1818
setDescription('軽度の懸念あり')
19-
} else if (value >= 0.1) {
20-
setDescription('批判の可能性ありまたは、受け手によって解釈が異なる')
2119
} else {
22-
setDescription('問題なし')
20+
setDescription('批判の可能性ありまたは、受け手によって解釈が異なる')
2321
}
2422
}, [value])
2523

apps/web/src/app/(main)/dashboard/(palygroud)/schemas/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const playgroundSchema = z.object({
88
.string({ required_error: 'テキストは必須です' })
99
.min(1, { message: 'テキストは1文字以上で入力してください' })
1010
.max(500, { message: 'テキストは500文字以下で入力してください' }),
11-
score_threshold: z.number().max(1).min(0).optional().default(0.5),
11+
score_threshold: z.number().max(1).min(0.1).optional().default(0.5),
1212
result: z.any().optional(),
1313
isLimitReached: z.boolean().optional(),
1414
})

packages/shared/src/schemas/guardian.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const modelsSchema = z.union([
1616

1717
export const guardianTextRequestSchema = z.object({
1818
text: z.string().max(500),
19-
score_threshold: z.number().max(1).min(0).optional().default(0.5),
19+
score_threshold: z.number().max(1).min(0.1).optional().default(0.5),
2020
model: modelsSchema.optional().default('gpt-4o-mini'),
2121
})
2222

0 commit comments

Comments
 (0)