mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-24 21:38:09 +02:00
feat(model-connections): enhance model discovery with OpenAI and LiteLLM support
This commit is contained in:
parent
50c816c81c
commit
3f01642199
2 changed files with 80 additions and 21 deletions
|
|
@ -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"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue