mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-13 03:59:12 +00:00
fix(ui): look decision models up again each time the Decisions playground opens
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
00cb4d0f01
commit
c852de84ba
2 changed files with 20 additions and 0 deletions
|
|
@ -551,6 +551,25 @@ describe("SystemOneUI integration", () => {
|
|||
expect(JSON.parse(mockFetch.mock.calls[0]?.[1]?.body as string).model).toBe("pplx-decider");
|
||||
});
|
||||
|
||||
it("looks the decision models up again when the playground is reopened within the cache window", async () => {
|
||||
mockModelLookup.mockResolvedValueOnce(modelInfoResponse([{ model_name: "gpt-5.5", mode: "chat" }]));
|
||||
const queryClient = new QueryClient({ defaultOptions: { mutations: { retry: false } } });
|
||||
const page = (
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<SystemOneUI accessToken="session-key" />
|
||||
</QueryClientProvider>
|
||||
);
|
||||
const first = rtlRender(page);
|
||||
expect(await screen.findByRole("link", { name: "Add a decision model" })).toBeInTheDocument();
|
||||
first.unmount();
|
||||
|
||||
mockModelLookup.mockResolvedValueOnce(modelInfoResponse(DECISION_AND_CHAT_MODELS));
|
||||
rtlRender(page);
|
||||
const picker = await screen.findByRole("combobox", { name: "Decision model" });
|
||||
await waitFor(() => expect(picker).toHaveValue("jev-latest"));
|
||||
expect(mockModelLookup).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
|
||||
it("routes a configured TypeSafe model through the same proxy endpoint", async () => {
|
||||
const user = userEvent.setup();
|
||||
mockModelLookup.mockResolvedValue(modelInfoResponse([{ model_name: "typesafe/jev-latest", mode: "evaluation" }]));
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ export function useDecisionModels(
|
|||
enabled: lookupApiKey !== "",
|
||||
retry: false,
|
||||
staleTime: 60 * 1000,
|
||||
refetchOnMount: "always" as const,
|
||||
};
|
||||
const query = useQuery(queryOptions);
|
||||
return { decisionModels: query.data ?? NO_DECISION_MODELS, isLoaded: query.isSuccess };
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue