refactor(api): remove AI worker, add ai api route, add usage tiers
- Remove separate AI worker service - Added generation limits: FREE: 1000/month (For the beta version) PRO: 500/month ENTERPRISE: 1000/month - Integrate AI functionality into main API routes - Added monthly generations reset and usage tier upgrade API routes - Upgrade tier page to be added along with profile page section
This commit is contained in:
19
frontend/lib/tiers.ts
Normal file
19
frontend/lib/tiers.ts
Normal file
@ -0,0 +1,19 @@
|
||||
export const TIERS = {
|
||||
FREE: {
|
||||
// generations: 100,
|
||||
// maxTokens: 1024,
|
||||
generations: 1000,
|
||||
maxTokens: 4096,
|
||||
model: "claude-3-5-sonnet-20240620",
|
||||
},
|
||||
PRO: {
|
||||
generations: 500,
|
||||
maxTokens: 2048,
|
||||
model: "claude-3-5-sonnet-20240620",
|
||||
},
|
||||
ENTERPRISE: {
|
||||
generations: 1000,
|
||||
maxTokens: 4096,
|
||||
model: "claude-3-5-sonnet-20240620",
|
||||
},
|
||||
}
|
@ -10,6 +10,9 @@ export type User = {
|
||||
generations: number
|
||||
sandbox: Sandbox[]
|
||||
usersToSandboxes: UsersToSandboxes[]
|
||||
tier: "FREE" | "PRO" | "ENTERPRISE"
|
||||
tierExpiresAt: Date
|
||||
lastResetDate?: number
|
||||
}
|
||||
|
||||
export type Sandbox = {
|
||||
|
Reference in New Issue
Block a user