mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #18697 from overleaf/dp-ai-rate-limit
Add a rate limiter for the AI Error Assistant GitOrigin-RevId: d23abc4b3477d13b1bfd4d69db168458ac8c2e51
This commit is contained in:
parent
7722c44414
commit
c16c806002
1 changed files with 20 additions and 0 deletions
20
services/web/app/src/models/UserFeatureUsage.js
Normal file
20
services/web/app/src/models/UserFeatureUsage.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
const mongoose = require('../infrastructure/Mongoose')
|
||||
const { Schema } = mongoose
|
||||
|
||||
const Usage = new Schema({
|
||||
usage: { type: Number },
|
||||
periodStart: { type: Date },
|
||||
})
|
||||
|
||||
const UserFeatureUsageSchema = new Schema({
|
||||
features: {
|
||||
aiErrorAssistant: Usage,
|
||||
},
|
||||
})
|
||||
|
||||
exports.UserFeatureUsage = mongoose.model(
|
||||
'UserFeatureUsage',
|
||||
UserFeatureUsageSchema
|
||||
)
|
||||
|
||||
exports.UserFeatureUsageSchema = UserFeatureUsageSchema
|
Loading…
Reference in a new issue