File size: 426 Bytes
246d201
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { useQuery } from "@tanstack/react-query";
import OpenHands from "#/api/open-hands";

const fetchAiConfigOptions = async () => ({
  models: await OpenHands.getModels(),
  agents: await OpenHands.getAgents(),
  securityAnalyzers: await OpenHands.getSecurityAnalyzers(),
});

export const useAIConfigOptions = () =>
  useQuery({
    queryKey: ["ai-config-options"],
    queryFn: fetchAiConfigOptions,
  });