2 parents e027773 + d1b346e commit 1b10f4fCopy full SHA for 1b10f4f
1 file changed
apps/api/src/ai/ai.service.ts
@@ -13,7 +13,10 @@ export class AiService {
13
private readonly client: OpenAI;
14
15
constructor(@Inject(DRIZZLE) private db: DrizzleDB) {
16
- const rawClient = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
+ const rawClient = new OpenAI({
17
+ apiKey: process.env.OPENAI_API_KEY,
18
+ fetch: globalThis.fetch as any,
19
+ });
20
if (process.env.LANGFUSE_PUBLIC_KEY && process.env.LANGFUSE_SECRET_KEY) {
21
this.logger.log('Wrapping OpenAI client with Langfuse observer.');
22
this.client = observeOpenAI(rawClient);
0 commit comments