mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 02:10:15 +01:00
🎪 refactor: Allow Last Model Spec Selection without Prioritizing (#10258)
* refactor: Default Model Spec Retrieval Logic, allowing last selected spec on new chat if last selection was a spec * chore: Replace hardcoded 'new' conversation ID with Constants.NEW_CONVO for consistency * chore: remove redundant condition for model spec preset selection in useNewConvo hook
This commit is contained in:
parent
cbbbde3681
commit
90e610ceda
3 changed files with 22 additions and 12 deletions
|
|
@ -252,18 +252,20 @@ const useNewConvo = (index = 0) => {
|
|||
};
|
||||
|
||||
let preset = _preset;
|
||||
const defaultModelSpec = getDefaultModelSpec(startupConfig);
|
||||
const result = getDefaultModelSpec(startupConfig);
|
||||
const defaultModelSpec = result?.default ?? result?.last;
|
||||
if (
|
||||
!preset &&
|
||||
startupConfig &&
|
||||
(startupConfig.modelSpecs?.prioritize === true ||
|
||||
(startupConfig.interface?.modelSelect ?? true) !== true) &&
|
||||
(startupConfig.interface?.modelSelect ?? true) !== true ||
|
||||
(result?.last != null && Object.keys(_template).length === 0)) &&
|
||||
defaultModelSpec
|
||||
) {
|
||||
preset = getModelSpecPreset(defaultModelSpec);
|
||||
}
|
||||
|
||||
if (conversation.conversationId === 'new' && !modelsData) {
|
||||
if (conversation.conversationId === Constants.NEW_CONVO && !modelsData) {
|
||||
const filesToDelete = Array.from(files.values())
|
||||
.filter(
|
||||
(file) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue