Mamadou DICKO 2023-11-06 14:36:13 +01:00 committed by GitHub
parent cd45b89981
commit 3eff384e39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -86,7 +86,6 @@ export const GeneralInformation = (
<Radio <Radio
items={brainStatusOptions} items={brainStatusOptions}
label={t("brain_status_label", { ns: "brain" })} label={t("brain_status_label", { ns: "brain" })}
value={status}
className="flex-1 justify-between w-[50%]" className="flex-1 justify-between w-[50%]"
{...register("status")} {...register("status")}
/> />

View File

@ -47,11 +47,12 @@ export const ModelSelection = (props: ModelSelectionProps): JSX.Element => {
<select <select
id="model" id="model"
disabled={!hasEditRights} disabled={!hasEditRights}
{...register("model")} {...register("model", {
onChange: () => {
void handleSubmit(false);
},
})}
className="px-5 py-2 dark:bg-gray-700 bg-gray-200 rounded-md" className="px-5 py-2 dark:bg-gray-700 bg-gray-200 rounded-md"
onChange={() => {
void handleSubmit(false); // Trigger form submission
}}
> >
{accessibleModels.map((availableModel) => ( {accessibleModels.map((availableModel) => (
<option value={availableModel} key={availableModel}> <option value={availableModel} key={availableModel}>

View File

@ -98,7 +98,7 @@ export const useSettingsTab = ({ brainId }: UseSettingsTabProps) => {
} }
setTimeout(() => { setTimeout(() => {
if (brain.model !== undefined) { if (brain.model !== undefined && brain.model !== null) {
setValue("model", brain.model); setValue("model", brain.model);
} }
}, 50); }, 50);

View File

@ -13,10 +13,10 @@ export type Brain = {
name: string; name: string;
documents?: Document[]; documents?: Document[];
status?: BrainAccessStatus; status?: BrainAccessStatus;
model?: Model; model?: Model | null;
max_tokens?: number; max_tokens?: number;
temperature?: number; temperature?: number;
openai_api_key?: string; openai_api_key?: string | null;
description?: string; description?: string;
prompt_id?: string | null; prompt_id?: string | null;
}; };