- Add llm-factory.ts: unified LLM provider abstraction (Google/Claude/OpenAI) - Install @langchain/anthropic and @langchain/openai packages - resolveAiProvider picks active provider from DB settings (Claude > OpenAI > Google) - All AI graphs (reminder, new-patient, reschedule, internal-chat) now accept provider+model params - Add claudeAiModel, openAiModel, googleAiModel columns to ai_settings table - New PUT /api/ai/provider-model route to save selected model per provider - UI model dropdowns for Claude (Haiku/Sonnet/Opus), OpenAI (GPT-5.x series), Google (Gemini 2.5/3.x) - Google AI section also gets model selector alongside existing API key field Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
25 lines
1.1 KiB
TypeScript
25 lines
1.1 KiB
TypeScript
import * as z from 'zod';
|
|
import type { Prisma } from '../../../generated/prisma';
|
|
import { UserArgsObjectSchema as UserArgsObjectSchema } from './UserArgs.schema'
|
|
|
|
const makeSchema = () => z.object({
|
|
id: z.boolean().optional(),
|
|
userId: z.boolean().optional(),
|
|
apiKey: z.boolean().optional(),
|
|
aiEnabled: z.boolean().optional(),
|
|
openAiKey: z.boolean().optional(),
|
|
openAiEnabled: z.boolean().optional(),
|
|
claudeAiKey: z.boolean().optional(),
|
|
claudeAiEnabled: z.boolean().optional(),
|
|
claudeAiModel: z.boolean().optional(),
|
|
openAiModel: z.boolean().optional(),
|
|
googleAiModel: z.boolean().optional(),
|
|
dentalMgmtKey: z.boolean().optional(),
|
|
dentalMgmtEnabled: z.boolean().optional(),
|
|
afterHoursEnabled: z.boolean().optional(),
|
|
openPhoneReply: z.boolean().optional(),
|
|
user: z.union([z.boolean(), z.lazy(() => UserArgsObjectSchema)]).optional()
|
|
}).strict();
|
|
export const AiSettingsSelectObjectSchema: z.ZodType<Prisma.AiSettingsSelect> = makeSchema() as unknown as z.ZodType<Prisma.AiSettingsSelect>;
|
|
export const AiSettingsSelectObjectZodSchema = makeSchema();
|