mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-19 00:01:29 +00:00
fix(guardrails): import ModelResponse lazily to avoid cyclic import alert
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
c65ace9164
commit
c1d0d29d01
1 changed files with 2 additions and 1 deletions
|
|
@ -31,7 +31,6 @@ from litellm.types.utils import (
|
|||
GuardrailStatus,
|
||||
GuardrailTracingDetail,
|
||||
LLMResponseTypes,
|
||||
ModelResponse,
|
||||
StandardLoggingGuardrailInformation,
|
||||
)
|
||||
|
||||
|
|
@ -907,6 +906,8 @@ class CustomGuardrail(CustomLogger):
|
|||
response: Final = (
|
||||
kwargs.get("async_complete_streaming_response") or kwargs.get("complete_streaming_response") or result
|
||||
)
|
||||
from litellm.types.utils import ModelResponse
|
||||
|
||||
output_translation: Final = (
|
||||
get_guardrail_translation_mapping(CallTypes.acompletion)()
|
||||
if isinstance(response, ModelResponse)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue