Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
219 changes: 189 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"form-data": "^4.0.0",
"ioredis": "^5.3.2",
"joi": "^17.6.0",
"openai": "^3.3.0",
"openai": "^4.80.0",
"passport": "^0.6.0",
"passport-google-oauth20": "^2.0.0",
"passport-jwt": "^4.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/categories/category.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,8 @@ Present your reply options in JSON format below.
const response = await this.openaiService.createChatCompletion({
model: 'o1-mini',
question,
temperature: 0,
responseType: 'json',
temperature: 1,
// responseType: { type: 'json_object' },
});

const categoryStr = response.choices[0].message?.content;
Expand Down
2 changes: 1 addition & 1 deletion src/common/interceptors/timeout.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { catchError, timeout } from 'rxjs/operators';
export class TimeoutInterceptor implements NestInterceptor {
intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
return next.handle().pipe(
timeout(7000), // TODO 크롤링 시 응답이 오래 걸릴 수 있으므로, API 별 인터셉터 오버라이딩 필요
timeout(10000), // TODO 크롤링 시 응답이 오래 걸릴 수 있으므로, API 별 인터셉터 오버라이딩 필요
catchError((err) => {
if (err instanceof TimeoutError) {
console.log(err);
Expand Down
11 changes: 9 additions & 2 deletions src/openai/dto/create-completion.dto.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import { ResponseType } from 'axios';
import {
ResponseFormatText,
ResponseFormatJSONObject,
ResponseFormatJSONSchema,
} from 'openai/resources';

export class CreateCompletionBodyDto {
question!: string;
model?: string;
temperature?: number;
responseType?: ResponseType;
responseType?:
| ResponseFormatText
| ResponseFormatJSONObject
| ResponseFormatJSONSchema;
}
Loading
Loading