Skip to content

Commit 5b48111

Browse files
authored
Merge pull request #383 from Quickchive/develop
develop to master
2 parents 4817887 + 3812810 commit 5b48111

File tree

6 files changed

+223
-61
lines changed

6 files changed

+223
-61
lines changed

package-lock.json

Lines changed: 189 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"form-data": "^4.0.0",
5959
"ioredis": "^5.3.2",
6060
"joi": "^17.6.0",
61-
"openai": "^3.3.0",
61+
"openai": "^4.80.0",
6262
"passport": "^0.6.0",
6363
"passport-google-oauth20": "^2.0.0",
6464
"passport-jwt": "^4.0.0",

src/categories/category.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,8 @@ Present your reply options in JSON format below.
551551
const response = await this.openaiService.createChatCompletion({
552552
model: 'o1-mini',
553553
question,
554-
temperature: 0,
555-
responseType: 'json',
554+
temperature: 1,
555+
// responseType: { type: 'json_object' },
556556
});
557557

558558
const categoryStr = response.choices[0].message?.content;

src/common/interceptors/timeout.interceptor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { catchError, timeout } from 'rxjs/operators';
1212
export class TimeoutInterceptor implements NestInterceptor {
1313
intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
1414
return next.handle().pipe(
15-
timeout(7000), // TODO 크롤링 시 응답이 오래 걸릴 수 있으므로, API 별 인터셉터 오버라이딩 필요
15+
timeout(10000), // TODO 크롤링 시 응답이 오래 걸릴 수 있으므로, API 별 인터셉터 오버라이딩 필요
1616
catchError((err) => {
1717
if (err instanceof TimeoutError) {
1818
console.log(err);
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
import { ResponseType } from 'axios';
1+
import {
2+
ResponseFormatText,
3+
ResponseFormatJSONObject,
4+
ResponseFormatJSONSchema,
5+
} from 'openai/resources';
26

37
export class CreateCompletionBodyDto {
48
question!: string;
59
model?: string;
610
temperature?: number;
7-
responseType?: ResponseType;
11+
responseType?:
12+
| ResponseFormatText
13+
| ResponseFormatJSONObject
14+
| ResponseFormatJSONSchema;
815
}

0 commit comments

Comments
 (0)