Source code for langchain_core.utils.interactive_env

"""Utilities for working with interactive environments."""

import sys


[docs] def is_interactive_env() -> bool: """Determine if running within IPython or Jupyter. Returns: True if running in an interactive environment, False otherwise. """ return hasattr(sys, "ps2")