Package-level declarations

AI plumbing lives here: request safety, resilience, and provider orchestration. Think of this package as the reliability layer behind smart NPC features.

Types

Link copied to clipboard
class AiRateLimiter(val name: String, maxRequests: Int = DEFAULT_MAX_REQUESTS, windowMs: Long = DEFAULT_WINDOW_MS, clock: () -> Long = System::currentTimeMillis)

Thread-safe sliding-window rate limiter for AI API calls.

Link copied to clipboard
class CircuitBreaker(val name: String, failureThreshold: Int = DEFAULT_FAILURE_THRESHOLD, windowMs: Long = DEFAULT_WINDOW_MS, cooldownMs: Long = DEFAULT_COOLDOWN_MS, clock: () -> Long = System::currentTimeMillis)

Thread-safe circuit breaker that automatically disables calls after repeated failures.

Link copied to clipboard

General-purpose service for interacting with the OpenAI API.