fix: correct class-psa-search.php blob (was truncated in chunked upload)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
peptiderepo
2026-04-08 17:44:57 +07:00
commit 8fe543b726
18 changed files with 2605 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
<?php
/**
* Configuration constants for Peptide Search AI.
* Centralizes all magic numbers and configuration values.
*
* @package PeptideSearchAI
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class PSA_Config {
// Search query validation
const MIN_QUERY_LENGTH = 2;
const MAX_QUERY_LENGTH = 100;
// Rate limiting (requests per hour)
const REST_RATE_LIMIT = 20;
const AJAX_RATE_LIMIT = 10;
// Generation timing
const PENDING_TIMEOUT = 300; // seconds (5 minutes)
const MAX_GENERATION_RETRIES = 3;
// AI token limits
const VALIDATION_MAX_TOKENS = 300;
const GENERATION_MAX_TOKENS = 4096;
// Cache TTL
const VALIDATION_CACHE_TTL = null; // Set to DAY_IN_SECONDS at runtime
const PUBCHEM_CACHE_TTL = null; // Set to 7 * DAY_IN_SECONDS at runtime
// API retry settings
const API_RETRY_MAX = 3;
const API_RETRY_BASE_DELAY = 5; // seconds
}