| """
|
| Utils Layer - Helper functions and utilities.
|
|
|
| This module provides:
|
| - Text preprocessing utilities
|
| - Input validation helpers
|
| - Metrics and monitoring
|
| - Logging configuration
|
| - Groq API client with rate limiting
|
| - GUVI hackathon integration callbacks
|
| """
|
|
|
| from app.utils.preprocessing import (
|
| clean_text,
|
| normalize_text,
|
| convert_devanagari_digits,
|
| )
|
| from app.utils.validation import (
|
| validate_message,
|
| validate_session_id,
|
| validate_language,
|
| )
|
| from app.utils.metrics import (
|
| track_detection,
|
| track_extraction,
|
| track_response_time,
|
| )
|
| from app.utils.logger import get_logger, setup_logging
|
| from app.utils.groq_client import (
|
| RateLimiter,
|
| RateLimitError,
|
| GroqAPIError,
|
| GroqClient,
|
| call_groq_with_retry,
|
| get_groq_client,
|
| reset_groq_client,
|
| reset_rate_limiter,
|
| get_rate_limit_status,
|
| exponential_backoff,
|
| is_retryable_error,
|
| retry_with_backoff,
|
| )
|
| from app.utils.guvi_callback import (
|
| send_final_result_to_guvi,
|
| should_send_callback,
|
| extract_suspicious_keywords,
|
| generate_agent_notes,
|
| )
|
|
|
| __all__ = [
|
|
|
| "clean_text",
|
| "normalize_text",
|
| "convert_devanagari_digits",
|
|
|
| "validate_message",
|
| "validate_session_id",
|
| "validate_language",
|
|
|
| "track_detection",
|
| "track_extraction",
|
| "track_response_time",
|
|
|
| "get_logger",
|
| "setup_logging",
|
|
|
| "RateLimiter",
|
| "RateLimitError",
|
| "GroqAPIError",
|
| "GroqClient",
|
| "call_groq_with_retry",
|
| "get_groq_client",
|
| "reset_groq_client",
|
| "reset_rate_limiter",
|
| "get_rate_limit_status",
|
| "exponential_backoff",
|
| "is_retryable_error",
|
| "retry_with_backoff",
|
|
|
| "send_final_result_to_guvi",
|
| "should_send_callback",
|
| "extract_suspicious_keywords",
|
| "generate_agent_notes",
|
| ]
|
|
|