From cb8e4ab1b71c24c87d9fd728de88697e3f3ff4d1 Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Tue, 9 Dec 2025 09:04:29 +0000 Subject: [PATCH] feat: add llm-config API service with getGlobalLLMConfigs endpoint --- .../lib/apis/llm-config-api.service.ts | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 surfsense_web/lib/apis/llm-config-api.service.ts diff --git a/surfsense_web/lib/apis/llm-config-api.service.ts b/surfsense_web/lib/apis/llm-config-api.service.ts new file mode 100644 index 000000000..b3653ec7b --- /dev/null +++ b/surfsense_web/lib/apis/llm-config-api.service.ts @@ -0,0 +1,38 @@ +import { + type CreateLLMConfigRequest, + createLLMConfigRequest, + createLLMConfigResponse, + type DeleteLLMConfigRequest, + deleteLLMConfigRequest, + deleteLLMConfigResponse, + type GetGlobalLLMConfigsResponse, + type GetLLMConfigRequest, + type GetLLMConfigsRequest, + type GetLLMPreferencesRequest, + getGlobalLLMConfigsResponse, + getLLMConfigRequest, + getLLMConfigResponse, + getLLMConfigsRequest, + getLLMConfigsResponse, + getLLMPreferencesRequest, + getLLMPreferencesResponse, + type UpdateLLMConfigRequest, + type UpdateLLMPreferencesRequest, + updateLLMConfigRequest, + updateLLMConfigResponse, + updateLLMPreferencesRequest, + updateLLMPreferencesResponse, +} from "@/contracts/types/llm-config.types"; +import { ValidationError } from "../error"; +import { baseApiService } from "./base-api.service"; + +class LLMConfigApiService { + /** + * Get all global LLM configurations available to all users + */ + getGlobalLLMConfigs = async () => { + return baseApiService.get(`/api/v1/global-llm-configs`, getGlobalLLMConfigsResponse); + }; +} + +export const llmConfigApiService = new LLMConfigApiService();