mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-20 23:21:06 +02:00
feat(model-connections): add setupStatus cache key and api fetcher
This commit is contained in:
parent
be626dff05
commit
ad28bd912c
2 changed files with 10 additions and 0 deletions
|
|
@ -8,6 +8,8 @@ import {
|
|||
connectionUpdateRequest,
|
||||
type GlobalLlmConfigStatus,
|
||||
globalLlmConfigStatus,
|
||||
type LlmSetupStatus,
|
||||
llmSetupStatus,
|
||||
type ModelCreateRequest,
|
||||
type ModelPreviewRead,
|
||||
type ModelProviderRead,
|
||||
|
|
@ -40,6 +42,13 @@ class ModelConnectionsApiService {
|
|||
return baseApiService.get(`/api/v1/global-llm-config-status`, globalLlmConfigStatus);
|
||||
};
|
||||
|
||||
getLlmSetupStatus = async (workspaceId: number): Promise<LlmSetupStatus> => {
|
||||
return baseApiService.get(
|
||||
`/api/v1/workspaces/${workspaceId}/llm-setup-status`,
|
||||
llmSetupStatus
|
||||
);
|
||||
};
|
||||
|
||||
getModelProviders = async (): Promise<ModelProviderRead[]> => {
|
||||
return baseApiService.get(`/api/v1/model-providers`, modelProviderListResponse);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ export const cacheKeys = {
|
|||
globalConfigStatus: () => ["model-connections", "global-config-status"] as const,
|
||||
providers: () => ["model-connections", "providers"] as const,
|
||||
roles: (workspaceId: number) => ["model-roles", workspaceId] as const,
|
||||
setupStatus: (workspaceId: number) => ["llm-setup-status", workspaceId] as const,
|
||||
},
|
||||
auth: {
|
||||
user: ["auth", "user"] as const,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue