From 14d8e26fc0885af46213bf6860ec156468d2cef9 Mon Sep 17 00:00:00 2001 From: Nato Boram Date: Fri, 28 Jun 2024 16:31:02 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20TypeError:=20API.Completions=20i?= =?UTF-8?q?s=20not=20a=20constructor=20(#9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sentry v8.13.0 --- src/index.ts | 1 + src/openai.test.ts | 6 ++++++ src/openai.ts | 4 ++++ 3 files changed, 11 insertions(+) create mode 100644 src/openai.test.ts create mode 100644 src/openai.ts diff --git a/src/index.ts b/src/index.ts index 6762622..a749281 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,3 +2,4 @@ export * from "./app.js" export * from "./env.js" export * from "./load_env.js" export * from "./node_env.js" +export * from "./openai.js" diff --git a/src/openai.test.ts b/src/openai.test.ts new file mode 100644 index 0000000..0196439 --- /dev/null +++ b/src/openai.test.ts @@ -0,0 +1,6 @@ +import { test } from "vitest" +import { openai } from "./openai.js" + +test("openai", ({ expect }) => { + expect(openai).toBeDefined() +}) diff --git a/src/openai.ts b/src/openai.ts new file mode 100644 index 0000000..64af60e --- /dev/null +++ b/src/openai.ts @@ -0,0 +1,4 @@ +import OpenAI from "openai" +import { OPENAI_API_KEY } from "./env.js" + +export const openai: OpenAI = new OpenAI({ apiKey: OPENAI_API_KEY })