diff --git a/src/actions/photosActions.ts b/src/actions/photosActions.ts index dfb16c57..6def8de9 100644 --- a/src/actions/photosActions.ts +++ b/src/actions/photosActions.ts @@ -638,7 +638,7 @@ export function fetchNoTimestampPhotoPaginated(dispatch: AppDispatch, page: numb export function generatePhotoIm2txtCaption(image_hash: string) { return function cb(dispatch: Dispatch) { dispatch({ type: "GENERATE_PHOTO_CAPTION" }); - Server.post("photosedit/generateim2txt", { image_hash }) + Server.post("photosedit/generateim2txt", { image_hash }, { timeout: 200000 }) .then(() => { dispatch({ type: "GENERATE_PHOTO_CAPTION_FULFILLED" }); // @ts-ignore diff --git a/src/api_client/site-settings.ts b/src/api_client/site-settings.ts index fe7b2d37..5bc35105 100644 --- a/src/api_client/site-settings.ts +++ b/src/api_client/site-settings.ts @@ -15,6 +15,7 @@ const SiteSettingsSchema = z.object({ map_api_key: z.string(), map_api_provider: z.string(), captioning_model: z.string(), + llm_model: z.string(), }); export type SiteSettings = z.infer; diff --git a/src/layouts/settings/Settings.tsx b/src/layouts/settings/Settings.tsx index 3ad4da3a..60a6038d 100644 --- a/src/layouts/settings/Settings.tsx +++ b/src/layouts/settings/Settings.tsx @@ -268,6 +268,54 @@ export function Settings() { }} /> + + + + <Trans i18nKey="settings.llm">Large Language Model Settings</Trans> + + { + setUserSelfDetails({ + ...userSelfDetails, + llm_settings: { + ...userSelfDetails.llm_settings, + enabled: event.currentTarget.checked, + }, + }); + }} + /> + { + setUserSelfDetails({ + ...userSelfDetails, + llm_settings: { + ...userSelfDetails.llm_settings, + add_person: event.currentTarget.checked, + }, + }); + }} + /> + { + setUserSelfDetails({ + ...userSelfDetails, + llm_settings: { + ...userSelfDetails.llm_settings, + add_location: event.currentTarget.checked, + }, + }); + }} + /> + + { - console.log(input); if (input.heavyweight_process && input.heavyweight_process > 3) { setWarning("heavyweight"); open(); @@ -81,6 +86,7 @@ export function SiteSettings() { setAllowRegistration(settings.allow_registration); setAllowUpload(settings.allow_upload); setCaptioningModel(settings.captioning_model); + setLlmModel(settings.llm_model); } }, [settings, isLoading]); @@ -249,6 +255,28 @@ export function SiteSettings() { }} /> + + + {t("sitesettings.llm_model_header")} + + {t("sitesettings.llm_model_description")} + + + + +