Files
Sybil-2/server/src/search/exa.ts

15 lines
279 B
TypeScript

import { Exa } from "exa-js";
import { env } from "../env.js";
let client: Exa | null = null;
export function exaClient() {
if (!env.EXA_API_KEY) {
throw new Error("EXA_API_KEY not set");
}
if (!client) {
client = new Exa(env.EXA_API_KEY);
}
return client;
}