Add basic typescript lib
This commit is contained in:
@@ -8,6 +8,7 @@ import { evaluationsRouter } from "./routers/evaluations.router";
|
||||
import { worldChampsRouter } from "./routers/worldChamps.router";
|
||||
import { datasetsRouter } from "./routers/datasets.router";
|
||||
import { datasetEntries } from "./routers/datasetEntries.router";
|
||||
import { externalApiRouter } from "./routers/externalApi.router";
|
||||
|
||||
/**
|
||||
* This is the primary router for your server.
|
||||
@@ -24,6 +25,7 @@ export const appRouter = createTRPCRouter({
|
||||
worldChamps: worldChampsRouter,
|
||||
datasets: datasetsRouter,
|
||||
datasetEntries: datasetEntries,
|
||||
externalApi: externalApiRouter,
|
||||
});
|
||||
|
||||
// export type definition of API
|
||||
|
||||
@@ -64,7 +64,7 @@ export const createTRPCContext = async (opts: CreateNextContextOptions) => {
|
||||
// Get the session from the server using the getServerSession wrapper function
|
||||
const session = await getServerAuthSession({ req, res });
|
||||
|
||||
const apiKey = req.headers["x-openpipe-api-key"] as string | null;
|
||||
const apiKey = req.headers["X-Openpipe-Api-Key"] as string | null;
|
||||
|
||||
console.log('api key is', apiKey)
|
||||
|
||||
|
||||
@@ -34,3 +34,5 @@ execSync(
|
||||
);
|
||||
|
||||
console.log("Done!");
|
||||
|
||||
process.exit(0);
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { env } from "~/env.mjs";
|
||||
|
||||
import OpenAI from "openai";
|
||||
// import OpenAI from "openai";
|
||||
|
||||
// import { OpenPipe } from "../../../../client-libs/js/openai/index";
|
||||
|
||||
import { OpenAI } from "openpipe";
|
||||
|
||||
// Set a dummy key so it doesn't fail at build time
|
||||
export const openai = new OpenAI({ apiKey: env.OPENAI_API_KEY ?? "dummy-key" });
|
||||
export const openai = new OpenAI.OpenPipe({ apiKey: env.OPENAI_API_KEY ?? "dummy-key" });
|
||||
|
||||
Reference in New Issue
Block a user