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
items={brainStatusOptions}
label={t("brain_status_label", { ns: "brain" })}
value={status}
className="flex-1 justify-between w-[50%]"
{...register("status")}
/>

View File

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

View File

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

View File

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