mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-07 07:58:09 +00:00
fix(guardrails/alice_wonderfence): narrow self.guardrail_name to str for mypy
Base CustomGuardrail declares guardrail_name as Optional[str]. Our __init__ requires a non-empty value (factory rejects empty), so override the attribute type after super().__init__() to satisfy mypy on dict-key indexing in _stash_resolved. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
2ade1208bc
commit
8092a22ddc
1 changed files with 3 additions and 0 deletions
|
|
@ -158,6 +158,9 @@ class WonderFenceGuardrail(CustomGuardrail):
|
|||
supported_event_hooks=supported_event_hooks,
|
||||
**kwargs,
|
||||
)
|
||||
# Narrow attribute type: base class declares Optional[str], but our
|
||||
# __init__ requires a non-empty string and the factory rejects empty.
|
||||
self.guardrail_name: str = guardrail_name
|
||||
|
||||
key_suffix = f"***{self.api_key[-4:]}" if self.api_key else "<unset>"
|
||||
logger.debug(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue