Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerHYang committed Nov 1, 2024
1 parent 9859cc8 commit f18c45f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ def instrumentation_dependencies(self) -> Collection[str]:
return _instruments

def _instrument(self, **kwargs: Any) -> None:
import guardrails as gd

version = Version(metadata.version("guardrails-ai"))
global GUARDRAILS_VERSION
GUARDRAILS_VERSION = (version.major, version.minor, version.micro)
Expand All @@ -60,6 +58,8 @@ def _instrument(self, **kwargs: Any) -> None:
logger.info("Guardrails version >= 0.5.2 detected, skipping instrumentation")
return

import guardrails as gd

if not (tracer_provider := kwargs.get("tracer_provider")):
tracer_provider = trace_api.get_tracer_provider()
if not (config := kwargs.get("config")):
Expand Down

0 comments on commit f18c45f

Please sign in to comment.