diff --git a/src/khoj/routers/api_chat.py b/src/khoj/routers/api_chat.py index 0e7dd448..b5561a82 100644 --- a/src/khoj/routers/api_chat.py +++ b/src/khoj/routers/api_chat.py @@ -76,7 +76,7 @@ from khoj.utils.rawconfig import FileFilterRequest, FilesFilterRequest, Location # Initialize Router logger = logging.getLogger(__name__) conversation_command_rate_limiter = ConversationCommandRateLimiter( - trial_rate_limit=100, subscribed_rate_limit=6000, slug="command" + trial_rate_limit=20, subscribed_rate_limit=75, slug="command" ) @@ -555,10 +555,10 @@ async def chat( common: CommonQueryParams, body: ChatRequestBody, rate_limiter_per_minute=Depends( - ApiUserRateLimiter(requests=60, subscribed_requests=200, window=60, slug="chat_minute") + ApiUserRateLimiter(requests=5, subscribed_requests=20, window=60, slug="chat_minute") ), rate_limiter_per_day=Depends( - ApiUserRateLimiter(requests=600, subscribed_requests=6000, window=60 * 60 * 24, slug="chat_day") + ApiUserRateLimiter(requests=100, subscribed_requests=600, window=60 * 60 * 24, slug="chat_day") ), image_rate_limiter=Depends(ApiImageRateLimiter(max_images=10, max_combined_size_mb=20)), ): diff --git a/src/khoj/routers/helpers.py b/src/khoj/routers/helpers.py index f1b8fe2b..239e646f 100644 --- a/src/khoj/routers/helpers.py +++ b/src/khoj/routers/helpers.py @@ -1372,7 +1372,7 @@ class ConversationCommandRateLimiter: self.slug = slug self.trial_rate_limit = trial_rate_limit self.subscribed_rate_limit = subscribed_rate_limit - self.restricted_commands = [ConversationCommand.Online, ConversationCommand.Image] + self.restricted_commands = [ConversationCommand.Research] async def update_and_check_if_valid(self, request: Request, conversation_command: ConversationCommand): if state.billing_enabled is False: