create basic public inference resource

This commit is contained in:
miloschwartz
2026-08-04 17:26:57 -04:00
parent 1696fc37a8
commit 149eb17b27
11 changed files with 558 additions and 145 deletions
+20
View File
@@ -1300,6 +1300,26 @@ export const resourceQueries = {
return res.data.data.providers;
}
}),
resourceAiProviders: ({ resourceId }: { resourceId: number }) =>
queryOptions({
queryKey: ["RESOURCES", resourceId, "AI_PROVIDERS"] as const,
queryFn: async ({ signal, meta }) => {
const res = await meta!.api.get<
AxiosResponse<{
providers: Array<{
providerId: number;
modelAccessMode: "catalog" | "allowlist";
name: string;
type: string;
enabled: boolean;
}>;
}>
>(`/resource/${resourceId}/ai-providers`, {
signal
});
return res.data.data.providers;
}
}),
resourceTargets: ({ resourceId }: { resourceId: number }) =>
queryOptions({
queryKey: ["RESOURCES", resourceId, "TARGETS"] as const,