Add messages limitation
5480e8d
raw
history blame
434 Bytes
import os
from apis.LangSmith import LangSmithAPI
from dotenv import load_dotenv
load_dotenv()
langsmith = LangSmithAPI()
count = langsmith.getDailyMessages()
# Convert DAILY_LIMIT to int with a default value of 5
DAILY_LIMIT = int(os.getenv("DAILY_MESSAGES_LIMIT", "5"))
def is_usage_limit_reached():
return count >= DAILY_LIMIT
def get_usages():
return {
"count": count,
"daily_limit": DAILY_LIMIT
}