We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aac8b8f commit 4960ae0Copy full SHA for 4960ae0
src/guardrails/checks/text/moderation.py
@@ -165,13 +165,9 @@ async def moderation(
165
Returns:
166
GuardrailResult: Indicates if tripwire was triggered, and details of flagged categories.
167
"""
168
- client = None
169
- if ctx is not None:
170
- candidate = getattr(ctx, "guardrail_llm", None)
171
- if isinstance(candidate, AsyncOpenAI):
172
- client = candidate
173
-
174
# Try the context client first, fall back if moderation endpoint doesn't exist
+ client = getattr(ctx, "guardrail_llm", None) if ctx is not None else None
+
175
if client is not None:
176
try:
177
resp = await _call_moderation_api(client, data)
0 commit comments