← Về thư mục
openai4s/storage/governance.py
- create_governance_schema · function · L104-L106 — def create_governance_schema(conn: sqlite3.Connection) -> None
- invite_digest · function · L109-L110 — def invite_digest(token: str) -> str
- QuotaExceeded · class · L113-L122 — class QuotaExceeded(Exception)
- init · method · L118-L122 — def init(self, message: str, *, scope: str, kind: str, window: str)
- GovernanceRepository · class · L125-L524 — class GovernanceRepository
- init · method · L128-L137 — def init( self, connection: sqlite3.Connection, lock: Any, *, clock_ms: Callable[[], int], ) -> None
- set_member · method · L141-L151 — def set_member(self, project_id: str, user_id: str, role: str = "member") -> None
- remove_member · method · L153-L160 — def remove_member(self, project_id: str, user_id: str) -> bool
- list_members · method · L162-L169 — def list_members(self, project_id: str) -> list[dict]
- member_role · method · L171-L179 — def member_role(self, project_id: str | None, user_id: str) -> str | None
- projects_of · method · L181-L188 — def projects_of(self, user_id: str) -> list[dict]
- project_is_claimed · method · L190-L214 — def project_is_claimed(self, project_id: str | None) -> bool
- is_project_participant · method · L216-L234 — def is_project_participant(self, project_id: str | None, user_id: str) -> bool
- participant_project_ids · method · L236-L248 — def participant_project_ids(self, user_id: str) -> set[str]
- create_invite · method · L252-L265 — def create_invite( self, project_id: str, created_by: str, *, ttl_s: int = INVITE_TTL_S ) -> str
- redeem_invite · method · L267-L289 — def redeem_invite(self, token: str) -> dict | None
- invite_is_live · method · L291-L310 — def invite_is_live(self, token: str) -> bool
- reinstate_invite · method · L312-L329 — def reinstate_invite(self, token: str) -> bool
- list_invites · method · L331-L356 — def list_invites(self, *, project_id: str | None = None) -> list[dict]
- revoke_invite · method · L358-L376 — def revoke_invite(self, token_prefix: str) -> bool
- record_usage · method · L380-L397 — def record_usage( self, *, user_id: str, kind: str, amount: float, project_id: str | None = None, ref: str | None = None, ) -> None
- usage_summary · method · L399-L435 — def usage_summary( self, *, since_ms: int | None = None, user_id: str | None = None, project_id: str | None = None, ) -> list[dict]
- set_quota · method · L439-L465 — def set_quota( self, *, scope: str, scope_id: str, kind: str, limit_amount: float, window: str, ) -> None
- delete_quota · method · L467-L477 — def delete_quota( self, *, scope: str, scope_id: str, kind: str, window: str ) -> bool
- list_quotas · method · L479-L488 — def list_quotas(self) -> list[dict]
- check_quota · method · L490-L524 — def check_quota(self, *, user_id: str, project_id: str | None, kind: str) -> None
- record_session_llm_usage · function · L541-L582 — def record_session_llm_usage(store: Any, root_frame_id: str, usage: Any) -> None