Skip to content

Commit db75e1e

Browse files
committed
fix outi bug
1 parent c6b3bf9 commit db75e1e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/server/routes/openai.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ openaiRouter.post('/stream', upload.single('file'), async (r, res) => {
9898
(tokenCount / DEFAULT_TOKEN_LIMIT) * 100
9999
)
100100

101-
if (tokenCount > 0.1 * DEFAULT_TOKEN_LIMIT && !userConsent) {
101+
if (
102+
model !== FREE_MODEL &&
103+
tokenCount > 0.1 * DEFAULT_TOKEN_LIMIT &&
104+
!userConsent
105+
) {
102106
return res.status(201).json({
103107
tokenConsumtionWarning: true,
104108
message: `You are about to use ${tokenUsagePercentage}% of your monthly CurreChat usage`,
@@ -132,7 +136,7 @@ openaiRouter.post('/stream', upload.single('file'), async (r, res) => {
132136

133137
if (courseId) {
134138
await incrementCourseUsage(userToCharge, courseId, tokenCount)
135-
} else if (model === 'gpt-4') {
139+
} else if (model !== FREE_MODEL) {
136140
await incrementUsage(userToCharge, tokenCount)
137141
}
138142

0 commit comments

Comments
 (0)