mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
Beam: remove fallbackLlmId
This commit is contained in:
@@ -178,7 +178,7 @@ export const createScatterSlice: StateCreator<RootStoreSlice & ScatterStoreSlice
|
||||
|
||||
|
||||
setRayCount: (count: number) => {
|
||||
const { rays, fallbackLlmId, _syncRaysStateToScatter } = _get();
|
||||
const { rays, _syncRaysStateToScatter } = _get();
|
||||
if (count < rays.length) {
|
||||
// Terminate exceeding rays
|
||||
rays.slice(count).forEach(rayScatterStop);
|
||||
@@ -189,7 +189,7 @@ export const createScatterSlice: StateCreator<RootStoreSlice & ScatterStoreSlice
|
||||
_set({
|
||||
rays: [...rays, ...Array(count - rays.length).fill(null)
|
||||
// Create missing rays, copying the llmId of the former Ray, or using the fallback
|
||||
.map(() => createBRay(rays[rays.length - 1]?.rayLlmId || fallbackLlmId)),
|
||||
.map(() => createBRay(rays[rays.length - 1]?.rayLlmId || null)),
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@ const initRootStateSlice = (): RootStateSlice => ({
|
||||
|
||||
isOpen: false,
|
||||
isMaximized: false,
|
||||
fallbackLlmId: null,
|
||||
inputHistory: null,
|
||||
inputIssues: null,
|
||||
inputReady: false,
|
||||
@@ -68,7 +67,7 @@ const createRootSlice: StateCreator<BeamStore, [], [], RootStoreSlice> = (_set,
|
||||
...initRootStateSlice(),
|
||||
|
||||
|
||||
open: (chatHistory: Readonly<DMessage[]>, fallbackLlmId: DLLMId | null, callback: BeamSuccessCallback) => {
|
||||
open: (chatHistory: Readonly<DMessage[]>, initialChatLlmId: DLLMId | null, callback: BeamSuccessCallback) => {
|
||||
const { isOpen: wasAlreadyOpen, terminateKeepingSettings, setRayLlmIds } = _get();
|
||||
|
||||
// reset pending operations
|
||||
@@ -82,7 +81,6 @@ const createRootSlice: StateCreator<BeamStore, [], [], RootStoreSlice> = (_set,
|
||||
_set({
|
||||
// input
|
||||
isOpen: true,
|
||||
fallbackLlmId: fallbackLlmId,
|
||||
inputHistory: isValidHistory ? history : null,
|
||||
inputIssues: isValidHistory ? null : 'Invalid history',
|
||||
inputReady: isValidHistory,
|
||||
@@ -91,8 +89,8 @@ const createRootSlice: StateCreator<BeamStore, [], [], RootStoreSlice> = (_set,
|
||||
// rays already reset
|
||||
|
||||
// update the model only if the dialog was not already open
|
||||
...(!wasAlreadyOpen && fallbackLlmId && {
|
||||
currentGatherLlmId: fallbackLlmId,
|
||||
...(!wasAlreadyOpen && initialChatLlmId && {
|
||||
currentGatherLlmId: initialChatLlmId,
|
||||
} satisfies Partial<GatherStoreSlice>),
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user