feat(model-connections): enhance model discovery with OpenAI and LiteLLM support

This commit is contained in:
Anish Sarkar 2026-06-11 17:29:55 +05:30
parent 50c816c81c
commit 3f01642199
2 changed files with 80 additions and 21 deletions

View file

@ -90,8 +90,12 @@ export const discoverConnectionModelsMutationAtom = atomWithMutation((get) => {
return {
mutationKey: ["model-connections", "discover"],
mutationFn: (id: number) => modelConnectionsApiService.discoverModels(id),
onSuccess: () => {
toast.success("Models discovered");
onSuccess: (models) => {
toast.success(
models.length
? `${models.length} models discovered`
: "No models found for this connection"
);
invalidateModelConnections(searchSpaceId);
},
onError: (error: Error) => toast.error(error.message || "Failed to discover models"),