From a5f0527eecae29ebe9fa78f0375b017d1363dc32 Mon Sep 17 00:00:00 2001 From: Enrico Ros Date: Mon, 23 Dec 2024 02:14:27 -0800 Subject: [PATCH] DLLMs: keep user edits by default --- src/common/app.release.ts | 2 +- src/common/stores/llms/store-llms.ts | 2 +- src/modules/llms/llm.client.hooks.ts | 4 ++-- .../llms/vendors/openrouter/OpenRouterServiceSetup.tsx | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/app.release.ts b/src/common/app.release.ts index c43cc52cc..974710ddd 100644 --- a/src/common/app.release.ts +++ b/src/common/app.release.ts @@ -27,7 +27,7 @@ export const Release = { // this is here to trigger revalidation of data, e.g. models refresh Monotonics: { - Aix: 4, + Aix: 5, NewsVersion: 191, }, diff --git a/src/common/stores/llms/store-llms.ts b/src/common/stores/llms/store-llms.ts index bed91b359..245e5d29e 100644 --- a/src/common/stores/llms/store-llms.ts +++ b/src/common/stores/llms/store-llms.ts @@ -77,7 +77,7 @@ export const useModelsStore = create()(persist( ...llm, ...(existing.userLabel !== undefined ? { userLabel: existing.userLabel } : {}), ...(existing.userHidden !== undefined ? { userHidden: existing.userHidden } : {}), - ...(existing.userParameters !== undefined ? { userParameters: existing.userParameters } : {}), + ...(existing.userParameters !== undefined ? { userParameters: { ...existing.userParameters } } : {}), }; }); } diff --git a/src/modules/llms/llm.client.hooks.ts b/src/modules/llms/llm.client.hooks.ts index 10c8769ef..015038de1 100644 --- a/src/modules/llms/llm.client.hooks.ts +++ b/src/modules/llms/llm.client.hooks.ts @@ -14,7 +14,7 @@ import { llmsUpdateModelsForServiceOrThrow } from './llm.client'; export function useLlmUpdateModels( enabled: boolean, service: DModelsService | null, - keepUserEdits?: boolean, + discardUserEdits?: boolean, ): { isFetching: boolean, refetch: () => void, @@ -27,7 +27,7 @@ export function useLlmUpdateModels( queryFn: async () => { if (!service) throw new Error('No service provided to fetch models for'); - return await llmsUpdateModelsForServiceOrThrow(service.id, keepUserEdits === true); + return await llmsUpdateModelsForServiceOrThrow(service.id, !discardUserEdits); }, staleTime: Infinity, }); diff --git a/src/modules/llms/vendors/openrouter/OpenRouterServiceSetup.tsx b/src/modules/llms/vendors/openrouter/OpenRouterServiceSetup.tsx index cf8613563..8d66c634e 100644 --- a/src/modules/llms/vendors/openrouter/OpenRouterServiceSetup.tsx +++ b/src/modules/llms/vendors/openrouter/OpenRouterServiceSetup.tsx @@ -36,7 +36,7 @@ export function OpenRouterServiceSetup(props: { serviceId: DModelsServiceId }) { // fetch models const { isFetching, refetch, isError, error } = - useLlmUpdateModels(!serviceHasLLMs && shallFetchSucceed, service, true); + useLlmUpdateModels(!serviceHasLLMs && shallFetchSucceed, service); const handleOpenRouterLogin = () => {