Skip to content

Commit

Permalink
DLLMs: keep user edits by default
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Dec 23, 2024
1 parent 6e85171 commit a5f0527
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/common/app.release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},

Expand Down
2 changes: 1 addition & 1 deletion src/common/stores/llms/store-llms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const useModelsStore = create<LlmsState & LlmsActions>()(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 } } : {}),
};
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/modules/llms/llm.client.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { llmsUpdateModelsForServiceOrThrow } from './llm.client';
export function useLlmUpdateModels<TServiceSettings extends object>(
enabled: boolean,
service: DModelsService<TServiceSettings> | null,
keepUserEdits?: boolean,
discardUserEdits?: boolean,
): {
isFetching: boolean,
refetch: () => void,
Expand All @@ -27,7 +27,7 @@ export function useLlmUpdateModels<TServiceSettings extends object>(
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,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down

0 comments on commit a5f0527

Please sign in to comment.