From 9c7b36dc69a726735d36ea83584077d76d5ad6d0 Mon Sep 17 00:00:00 2001 From: Debanjum Date: Fri, 1 Nov 2024 16:15:09 -0700 Subject: [PATCH] Use standard per minute rate limits across user types --- src/khoj/routers/api_chat.py | 4 ++-- src/khoj/routers/research.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/khoj/routers/api_chat.py b/src/khoj/routers/api_chat.py index 6f44854c..f4a75114 100644 --- a/src/khoj/routers/api_chat.py +++ b/src/khoj/routers/api_chat.py @@ -167,7 +167,7 @@ async def text_to_speech( common: CommonQueryParams, text: str, rate_limiter_per_minute=Depends( - ApiUserRateLimiter(requests=10, subscribed_requests=60, window=60, slug="chat_minute") + ApiUserRateLimiter(requests=30, subscribed_requests=30, window=60, slug="chat_minute") ), rate_limiter_per_day=Depends( ApiUserRateLimiter(requests=100, subscribed_requests=600, window=60 * 60 * 24, slug="chat_day") @@ -555,7 +555,7 @@ async def chat( common: CommonQueryParams, body: ChatRequestBody, rate_limiter_per_minute=Depends( - ApiUserRateLimiter(requests=5, subscribed_requests=20, window=60, slug="chat_minute") + ApiUserRateLimiter(requests=20, subscribed_requests=20, window=60, slug="chat_minute") ), rate_limiter_per_day=Depends( ApiUserRateLimiter(requests=100, subscribed_requests=600, window=60 * 60 * 24, slug="chat_day") diff --git a/src/khoj/routers/research.py b/src/khoj/routers/research.py index 0a37eb48..4f9c6b4e 100644 --- a/src/khoj/routers/research.py +++ b/src/khoj/routers/research.py @@ -1,12 +1,11 @@ import json import logging from datetime import datetime -from typing import Any, Callable, Dict, List, Optional +from typing import Callable, Dict, List, Optional import yaml from fastapi import Request -from khoj.database.adapters import ConversationAdapters, EntryAdapters from khoj.database.models import Agent, KhojUser from khoj.processor.conversation import prompts from khoj.processor.conversation.utils import (