mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-14 17:03:29 +03:00
fix: allow to change model bro brain settings tab (#1590)
Issue: https://github.com/StanGirard/quivr/issues/1550 https://github.com/StanGirard/quivr/assets/63923024/f58e1ecb-635b-4d65-a6d9-288b0842a3ae
This commit is contained in:
parent
cd45b89981
commit
3eff384e39
@ -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")}
|
||||
/>
|
||||
|
@ -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}>
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user