Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

762 B
Raw Blame
import { getWebSearchInterceptionSettings, type WebSearchInterceptionSettingsResponse } from "@/components/networking";
import { useQuery } from "@tanstack/react-query";
import { createQueryKeys } from "../common/queryKeysFactory";
import useAuthorized from "../useAuthorized";

const webSearchInterceptionSettingsKeys = createQueryKeys("webSearchInterceptionSettings");

export const useWebSearchInterceptionSettings = () => {
  const { accessToken } = useAuthorized();
  return useQuery<WebSearchInterceptionSettingsResponse>({
    queryKey: webSearchInterceptionSettingsKeys.list({}),
    queryFn: async () => await getWebSearchInterceptionSettings(accessToken),
    enabled: !!accessToken,
    staleTime: 60 * 60 * 1000,
    gcTime: 60 * 60 * 1000,
  });
};