feat: openai to require
This commit is contained in:
parent
dc2d4845a1
commit
ab61ae2bce
|
|
@ -1,5 +1,5 @@
|
|||
// import { initializeSentry } from '@gitroom/nestjs-libraries/sentry/initialize.sentry';
|
||||
// initializeSentry('cron');
|
||||
import { initializeSentry } from '@gitroom/nestjs-libraries/sentry/initialize.sentry';
|
||||
initializeSentry('cron');
|
||||
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { CronModule } from './cron.module';
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
"allowSyntheticDefaultImports": true,
|
||||
"noLib": false,
|
||||
"target": "ES2021",
|
||||
"sourceMap": true
|
||||
"sourceMap": true,
|
||||
"esModuleInterop": true,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
// import { initializeSentry } from '@gitroom/nestjs-libraries/sentry/initialize.sentry';
|
||||
// initializeSentry('workers');
|
||||
import { initializeSentry } from '@gitroom/nestjs-libraries/sentry/initialize.sentry';
|
||||
initializeSentry('workers');
|
||||
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
|
||||
import { AppModule } from './app/app.module';
|
||||
import { MicroserviceOptions } from '@nestjs/microservices';
|
||||
import { BullMqServer } from '@gitroom/nestjs-libraries/bull-mq-transport-new/strategy';
|
||||
|
||||
import { AppModule } from './app/app.module';
|
||||
|
||||
async function bootstrap() {
|
||||
process.env.IS_WORKER = 'true';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { Injectable } from '@nestjs/common';
|
||||
import OpenAI from 'openai';
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const OpenAI = require('openai').default;
|
||||
import { shuffle } from 'lodash';
|
||||
import { zodResponseFormat } from 'openai/helpers/zod';
|
||||
import { z } from 'zod';
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ export const initializeSentry = (appName: string, allowLogs = false) => {
|
|||
tracesSampleRate: process.env.NODE_ENV === 'development' ? 1.0 : 0.3,
|
||||
enableLogs: allowLogs,
|
||||
});
|
||||
} catch (err) {}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue