Closed ryanmio closed 10 months ago
Name | Link |
---|---|
Latest commit | 237461361e87d464759f50d63f56b1961046f7d4 |
Latest deploy log | https://app.netlify.com/sites/decode-me/deploys/6592e02ba5b90800089b2d15 |
Deploy Preview | https://deploy-preview-34--decode-me.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
This PR implements a usage cap for GPT API calls. Here are the main changes:
gptCalls
andgptTokens
fields to the user document in Firestore to track the number of API calls and tokens used by each user.gptCalls
andgptTokens
fields are updated.resetUsageData
) that resets thegptCalls
andgptTokens
counters daily.gptCalls
andgptTokens
fields.gptCallsCap
andgptTokensCap
fields to the user document, and implemented a function (checkUsageData
) that updates thecapExceeded
field when a user exceeds their cap.These changes ensure that users cannot exceed a specified limit of GPT API usage, helping to control costs and prevent abuse.