mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-16 09:19:47 +02:00
add model picker to create provider wizard
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user