File size: 273 Bytes
4fb0ce9
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
import { useContext } from "react";
import { LLMContext, type LLMContextValue } from "./LLMContext";

export function useLLM(): LLMContextValue {
  const ctx = useContext(LLMContext);
  if (!ctx) throw new Error("useLLM must be used within <LLMProvider>");
  return ctx;
}