mirror of
https://github.com/hanzoai/insights.git
synced 2026-11-03 00:52:32 +00:00
The residue the subscriptions port left behind, and the file the rebase onto
main reintroduced:
- ee.billing.quota_limiting had no counterpart, so quota lives natively now in
products/insights_ai/backend/quota.py, next to the AI surface that meters.
- The AI subscription report pipeline reached into ee.hogai for its query
executor, LLM and tool errors; repointed at products/insights_ai/backend,
this fork's home for that surface — the same move 1fe5cc3 made for MaxTool.
- test_presentation_api.py is back on the native APIBaseTest. This fork
licenses nothing, so nothing was license-gated and all 9,579 lines stay.
grep for an ee import across insights, products and common now returns nothing,
and the gate that would catch a new one is green.
19 lines
895 B
Python
19 lines
895 B
Python
"""Insights AI credit quota.
|
|
|
|
AI credits were metered by the billing service, which this fork does not carry, so no team is ever
|
|
over budget. Kept as the single seam callers ask, so the answer lives in one place.
|
|
|
|
The spend half is real and stays: `insights.tasks.usage_report.get_teams_with_ai_credits_used_in_period`
|
|
totals what each team spent on `$ai_billable` generations. What left with the billing service is the
|
|
budget to compare that total against — it came with the plan, and
|
|
`Organization.available_product_features` records why nothing here sells one.
|
|
|
|
Callers gate on this before spending tokens and already fail open on a lookup error, so a False here
|
|
reads to them exactly as "asked, and the team is under budget".
|
|
"""
|
|
|
|
|
|
def is_team_over_ai_credit_budget(team_api_token: str) -> bool:
|
|
"""Whether a team has spent past its AI credit budget. Always False."""
|
|
return False
|