nemoguardrails.guardrails.base_engine

View as Markdown

Base class for IORails HTTP engines with aiohttp retry client lifecycle.

Module Contents

Classes

NameDescription
BaseEngineHTTP engine base with aiohttp RetryClient lifecycle.

API

class nemoguardrails.guardrails.base_engine.BaseEngine(
timeout_total: float = DEFAULT_TIMEOUT_TOTAL,
timeout_connect: float = DEFAULT_TIMEOUT_CONNECT,
max_attempts: int = DEFAULT_MAX_ATTEMPTS
)

HTTP engine base with aiohttp RetryClient lifecycle.

Manages a single RetryClient with configurable timeout and retry settings. Subclasses add endpoint-specific call logic.

_client
Optional[RetryClient] = None
_lock
= asyncio.Lock()
_retry_options
_timeout
nemoguardrails.guardrails.base_engine.BaseEngine.__aenter__()
async
nemoguardrails.guardrails.base_engine.BaseEngine.__aexit__(
exc_type,
exc_val,
exc_tb
)
async
nemoguardrails.guardrails.base_engine.BaseEngine.start() -> None
async

Create this engine’s RetryClient. Call during service startup.

nemoguardrails.guardrails.base_engine.BaseEngine.stop() -> None
async

Close this engine’s RetryClient. Call during service shutdown.