mirror of
https://github.com/StanGirard/quivr.git
synced 2024-11-28 13:42:41 +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
|
<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")}
|
||||||
/>
|
/>
|
||||||
|
@ -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}>
|
||||||
|
@ -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);
|
||||||
|
@ -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;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user