TEXT_FIELD = "text"


OPENAI_MAX_TOKENS_PER_CHUNK = 8192
OPENAI_MAX_CHUNKS_PER_BATCH = 2048
OPENAI_MAX_TOKENS_PER_JOB = 3_000_000
OPENAI_TPM_LIMIT = 1_000_000
OPENAI_RPM_LIMIT = 5_000

# Batching constants
MAX_BATCH_TOKENS = OPENAI_MAX_TOKENS_PER_CHUNK  # 8192
MAX_BATCH_SIZE = OPENAI_MAX_CHUNKS_PER_BATCH    # 2048
CHUNK_QUEUE_SIZE = 5000
RESULTS_BUFFER_SIZE = 5000

# Concurrency
MAX_CONCURRENT_TASKS = 16
SLIDING_WINDOW = 50  # seconds to track for TPM