add model picker to create provider wizard

This commit is contained in:
miloschwartz
2026-08-13 15:08:10 -04:00
parent d9a9ae14fd
commit 9b10292e02
10 changed files with 341 additions and 81 deletions
+20
View File
@@ -75,6 +75,7 @@ import type {
ListAiProvidersResponse,
ListCatalogModelsResponse
} from "@server/routers/aiProvider/types";
import type { AiProviderType } from "@app/lib/aiProviderDefaults";
import type { ListAiBudgetsByScopeResponse } from "@server/routers/aiBudget/types";
import {
getAiBudgetScopeListPath,
@@ -1495,6 +1496,25 @@ export const aiProviderQueries = {
return res.data.data.models;
}
}),
catalogModelsByType: ({
orgId,
type
}: {
orgId: string;
type: AiProviderType;
}) =>
queryOptions({
queryKey: ["AI_PROVIDERS", orgId, "CATALOG_MODELS", type] as const,
queryFn: async ({ signal, meta }) => {
const res = await meta!.api.get<
AxiosResponse<ListCatalogModelsResponse>
>(`/org/${orgId}/ai-catalog-models`, {
params: { type },
signal
});
return res.data.data.models;
}
}),
orgProviders: ({ orgId, query }: { orgId: string; query?: string }) =>
queryOptions({
queryKey: ["AI_PROVIDERS", orgId, "LIST", query ?? ""] as const,