mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-06-19 03:05:45 +08:00
## 🔍 Overview
This update alters our LLM credit system to apply credits and resets on
a daily schedule rather than monthly.
22 lines
527 B
Ruby
Vendored
22 lines
527 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
class LlmCreditAllocationSerializer < ApplicationSerializer
|
|
attributes :id,
|
|
:daily_credits,
|
|
:daily_used,
|
|
:credits_remaining,
|
|
:percentage_used,
|
|
:percentage_remaining,
|
|
:next_reset_at,
|
|
:soft_limit_percentage,
|
|
:soft_limit_reached,
|
|
:hard_limit_reached
|
|
|
|
def soft_limit_reached
|
|
object.soft_limit_reached?
|
|
end
|
|
|
|
def hard_limit_reached
|
|
object.hard_limit_reached?
|
|
end
|
|
end
|