Files
lunch/lib/ai-settings.ts
T
kai 12b38cb34e
release / which version (push) Successful in 2s
release / olares chart · sanity (push) Successful in 4s
release / app (push) Successful in 1m7s
release / tag and release (push) Successful in 2s
Olares Router as the default AI, custom endpoint optional (26.11.17) (#18)
2026-11-07 06:29:47 +00:00

12 lines
518 B
TypeScript

import "server-only";
import { effectiveAi, loadAi, type AiSettings } from "./ai";
import { loadInstance } from "./auth/webauthn";
import { withAuth, withHousehold } from "./db";
/** Die geltende AI-Einstellung eines Haushalts (Router als Standard, siehe effectiveAi). */
export async function aiFor(householdId: string): Promise<AiSettings | null> {
const stored = await withHousehold(householdId, loadAi);
const instance = await withAuth(loadInstance);
return effectiveAi(stored, instance?.origin ?? null);
}