Skip to navigation

nemoguardrails.patch_asyncio

View as MarkdownOpen in Claude

Module Contents

Functions

NameDescription
applyApply the optional nested-loop patch when explicitly enabled.
check_sync_call_from_async_loopHelper to check if a sync call is made from an async loop.

Data

nest_asyncio_patch_applied

API

nemoguardrails.patch_asyncio.apply()

Apply the optional nested-loop patch when explicitly enabled.

Raises:

  • ImportError: If patching is enabled without the optional dependency.

[<griffe._internal.docstrings.models.DocstringWarn object at 0xffffacab5eb0>]

nemoguardrails.patch_asyncio.check_sync_call_from_async_loop()

Helper to check if a sync call is made from an async loop.

Returns True if a sync call is made from an async loop.

nemoguardrails.patch_asyncio.nest_asyncio_patch_applied = False