UNPKG

ai-patterns

Version:

Production-ready TypeScript patterns to build solid and robust AI applications. Retry logic, circuit breakers, rate limiting, human-in-the-loop escalation, prompt versioning, response validation, context window management, and more—all with complete type

42 lines 2.6 kB
/** * ai-patterns - Battle-tested TypeScript patterns for building robust AI workflows * @author Serge KOKOUA * @version 1.0.0 */ export * from "./types"; export { GlobalStorage, StorageNamespace, type GlobalStorageOptions, type StorageEntry, InMemoryStorage, InMemoryKeyValueStorage, } from "./common/storage"; /** * Reset global storage for testing */ export declare function resetGlobalStorage(): Promise<void>; export { retry, RetryPredicates } from "./resilience/retry"; export { timeout, createTimeoutSignal, combineSignals } from "./resilience/timeout"; export { CircuitBreaker, defineCircuitBreaker, circuitBreaker, // @deprecated - use defineCircuitBreaker CallableCircuitBreaker } from "./resilience/circuit-breaker"; export { RateLimiter, defineRateLimiter, rateLimiter, // @deprecated - use defineRateLimiter CallableRateLimiter } from "./rate-limiting/rate-limiter"; export { fanOut } from "./orchestration/fan-out"; export { Saga, executeSaga } from "./orchestration/saga"; export { HumanInTheLoop, humanInTheLoop, CommonEscalationRules } from "./ai/human-in-the-loop"; export { smartContextWindow, createAISummarizer } from "./ai/context-window"; export { ContextStrategy } from "./types/context-window"; export { reflectionLoop, InMemoryReflectionStorage } from "./ai/reflection-loop"; export { Idempotency, idempotent, Idempotent, resetGlobalIdempotencyStore, stopGlobalIdempotencyCleanup, startGlobalIdempotencyCleanup } from "./consistency/idempotency"; export { fallback } from "./resilience/fallback"; export { defineBulkhead, bulkhead } from "./resilience/bulkhead"; export { defineDebounce, debounce } from "./timing/debounce"; export { defineThrottle, throttle } from "./timing/throttle"; export { memoize } from "./caching/memoize"; export { deadLetterQueue } from "./queuing/dead-letter-queue"; export { conditionalBranch } from "./orchestration/conditional-branch"; export { compose } from "./composition/compose"; export type { Middleware, ComposeConfig } from "./composition/compose"; export * from "./composition/middleware"; export { abTest, InMemoryAssignmentStorage } from "./experimentation/ab-test"; export { VariantAssignmentStrategy } from "./types/ab-test"; export { costTracking, createCostTracker, InMemoryCostStorage } from "./monitoring/cost-tracking"; export { ModelCost } from "./types/cost-tracking"; export { versionedPrompt, InMemoryPromptVersionStorage } from "./experimentation/prompt-versioning"; export { validateResponse } from "./validation/response-validation"; export declare const VERSION = "1.0.0"; //# sourceMappingURL=index.d.ts.map