Models: one for analyses and forecasts, one for answers; Opus 5.5 default and fallback
CI / test (push) Successful in 1m1s
CI / build (push) Successful in 4m56s
CI / deploy (push) Skipped

- Admin Modellek: summary, analyses + forecast (shared), question-answer (own model)
- Every default is Opus 5.5; when the chosen model fails twice (permanent: once),
  the default model takes over with fresh attempts before the unit is refunded
- The page shows how often the fallback was needed in the last 30 days

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-18 21:11:08 +00:00
co-authored by Claude Opus 5.5
parent 5af08ab689
commit 769b4791ae
18 changed files with 370 additions and 138 deletions
@@ -4,13 +4,15 @@ import { useEffect, useMemo, useState } from "react";
import { api, errorText } from "@/lib/api";
import { formatDate } from "@/lib/astro";
import type { CatalogModel, ModelFunction, PromptKind } from "@/lib/types";
import type { CatalogModel, ModelFunction } from "@/lib/types";
const LABELS: Record<Exclude<PromptKind, "question">, { title: string; about: string }> = {
const LABELS: Record<ModelFunction["kind"], { title: string; about: string }> = {
summary: { title: "Tömör összefoglaló", about: "Ingyenes, minden új képlethez magától elkészül. Olcsó, gyors modell elég." },
natal: { title: "Részletes képletelemzés", about: "Fizetős, hat fejezet." },
synastry: { title: "Kapcsolati elemzés", about: "Fizetős, öt fejezet két képletről." },
forecast: { title: "Éves előrejelzés", about: "Fizetős, öt fejezet, a leghosszabb adatsorral." },
analysis: {
title: "Elemzések és éves előrejelzés",
about: "Fizetős szövegek: részletes képletelemzés, kapcsolati elemzés és éves előrejelzés.",
},
question: { title: "Kérdés-válasz", about: "A kész elemzésekre és előrejelzésekre feltett kérdések válasza (legfeljebb 250 szó)." },
};
/** How many models the picker lists at once (narrow it with the search). */
@@ -58,7 +60,8 @@ export function AdminModels() {
</p>
)}
<p className="hint">
Az elemzésekre feltett kérdésekre mindig ugyanaz a modell válaszol, amelyik az adott elemzést írta.
Tartalék: ha a választott modell kétszer hibára fut (vagy egyszer végleges hibával), az alapértelmezett modell írja
meg a szöveget. Csak ha az is elbukik, kapja vissza a felhasználó az egységét.
</p>
{functions.map((f) => (
<FunctionModel key={f.kind} fn={f} catalog={catalog} onSaved={replace} />
@@ -82,7 +85,7 @@ function FunctionModel({
const [error, setError] = useState<string | null>(null);
const current = catalog?.find((m) => m.id === fn.model);
const cost = estimate(fn, current);
const label = LABELS[fn.kind as keyof typeof LABELS];
const label = LABELS[fn.kind];
const searchId = `model-search-${fn.kind}`;
const matches = useMemo(() => {
@@ -134,6 +137,11 @@ function FunctionModel({
? `Módosítva: ${fn.updated_at ? formatDate(fn.updated_at, true) : ""}${fn.updated_by ? `, ${fn.updated_by}` : ""}`
: "Alapértelmezett"}
</span>
{fn.custom && (
<span className={fn.fallbacks_30d > 0 ? "hint warn" : "hint"}>
Tartalék: {fn.default} · az elmúlt 30 napban {fn.fallbacks_30d} / {fn.finished_30d} szövegnél kellett
</span>
)}
</div>
</div>
<div className="form-actions">