mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-20 23:21:06 +02:00
refactor(onboarding): remove client-side onboarding helper
This commit is contained in:
parent
6f34bdf6b5
commit
aca243ba43
1 changed files with 0 additions and 28 deletions
|
|
@ -1,28 +0,0 @@
|
|||
import type { ConnectionRead } from "@/contracts/types/model-connections.types";
|
||||
|
||||
export function hasEnabledChatModel(connections: ConnectionRead[]): boolean {
|
||||
return connections.some(
|
||||
(connection) =>
|
||||
connection.enabled &&
|
||||
connection.models.some((model) => model.enabled && Boolean(model.supports_chat))
|
||||
);
|
||||
}
|
||||
|
||||
export function isLlmOnboardingComplete(
|
||||
chatModelId: number | null | undefined,
|
||||
globalConnections: ConnectionRead[],
|
||||
workspaceConnections: ConnectionRead[]
|
||||
): boolean {
|
||||
const connections = [...globalConnections, ...workspaceConnections];
|
||||
const resolvedChatModelId = chatModelId ?? 0;
|
||||
|
||||
if (resolvedChatModelId === 0) {
|
||||
return hasEnabledChatModel(connections);
|
||||
}
|
||||
|
||||
return connections.some((connection) =>
|
||||
connection.models.some(
|
||||
(model) => model.id === resolvedChatModelId && model.enabled && Boolean(model.supports_chat)
|
||||
)
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue