Improved Licensing

This commit is contained in:
2026-02-18 00:00:32 +01:00
parent a062383af0
commit af2c9e7fd8
17 changed files with 831 additions and 250 deletions

View File

@@ -75,6 +75,14 @@ class BaseAgent(ABC):
except Exception as e:
logger.warning(f"Failed to log usage to DB: {e}")
# Increment company token quota
if self._company_id:
try:
from uuid import UUID
await db.increment_company_tokens(UUID(self._company_id), total_tokens)
except Exception as e:
logger.warning(f"Failed to increment company tokens: {e}")
async def call_openai(
self,
system_prompt: str,