"use client"; import Field from "@/lib/components/ui/Field"; import { BrainConfig, Model, PaidModels, anthropicModels, models, paidModels, } from "@/lib/context/BrainConfigProvider/types"; import { UseFormRegister } from "react-hook-form"; interface ModelConfigProps { register: UseFormRegister; model: Model | PaidModels; openAiKey: string | undefined; temperature: number; maxTokens: number; } export const ModelConfig = ({ register, model, openAiKey, temperature, maxTokens, }: ModelConfigProps): JSX.Element => { const defineMaxTokens = (model: Model | PaidModels): number => { //At the moment is evaluating only models from OpenAI switch (model) { case "gpt-3.5-turbo": return 3000; case "gpt-3.5-turbo-0613": return 3000; case "gpt-3.5-turbo-16k": return 14000; case "gpt-4": return 6000; case "gpt-4-0613": return 6000; default: return 3000; } }; return ( <>

Model config

{(anthropicModels as readonly string[]).includes(model) && ( )}
); };