Improved Licensing
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user