mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-13 17:52:38 +02:00
parent
c96be7d9e1
commit
d9e6947fbd
18 changed files with 19 additions and 506 deletions
|
|
@ -8,7 +8,6 @@ import type {
|
|||
UpdateNewLLMConfigRequest,
|
||||
UpdateNewLLMConfigResponse,
|
||||
} from "@/contracts/types/new-llm-config.types";
|
||||
import { trackLLMConfigCreated } from "@/lib/analytics";
|
||||
import { newLLMConfigApiService } from "@/lib/apis/new-llm-config-api.service";
|
||||
import { cacheKeys } from "@/lib/query-client/cache-keys";
|
||||
import { queryClient } from "@/lib/query-client/client";
|
||||
|
|
@ -26,16 +25,7 @@ export const createNewLLMConfigMutationAtom = atomWithMutation((get) => {
|
|||
mutationFn: async (request: CreateNewLLMConfigRequest) => {
|
||||
return newLLMConfigApiService.createConfig(request);
|
||||
},
|
||||
onSuccess: (_, request: CreateNewLLMConfigRequest) => {
|
||||
// Track LLM config creation
|
||||
if (searchSpaceId) {
|
||||
trackLLMConfigCreated({
|
||||
search_space_id: Number(searchSpaceId),
|
||||
provider: request.provider,
|
||||
model_name: request.model_name,
|
||||
});
|
||||
}
|
||||
|
||||
onSuccess: () => {
|
||||
toast.success("Configuration created successfully");
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: cacheKeys.newLLMConfigs.all(Number(searchSpaceId)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue