adds search support with exa
This commit is contained in:
14
server/src/search/exa.ts
Normal file
14
server/src/search/exa.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user