data is present in the database.
        The best way to guard against such negative outcomes is to (as appropriate)
        limit the permissions granted to the credentials used with this tool.
        See https://python.langchain.com/docs/security for more information.
    """
[docs]    def __init__(
        self,
        database: str,
        host: str = "localhost",
        port: int = 6379,
        username: Optional[str] = None,
        password: Optional[str] = None,
        ssl: bool = False,
    ) -> None:
        """Create a new FalkorDB graph wrapper instance."""
        try:
            import redis
            from redis.commands.graph import Graph
        except ImportError:
            raise ImportError(
                "Could not import redis python package. "
                "Please install it with `pip install redis`."
            )
        self._driver = redis.Redis(
            host=host, port=port, username=username, password=password, ssl=ssl
        )
        self._graph = Graph(self._driver, database)
        self.schema: str = ""
        self.structured_schema: Dict[str, Any] = {}
        try:
            self.refresh_schema()
        except Exception as e:
            raise ValueError(f"Could not refresh schema. Error: {e}")
    @property
    def get_schema(self) -> str:
        """Returns the schema of the FalkorDB database"""
        return self.schema
    @property
    def get_structured_schema(self) -> Dict[str, Any]:
        """Returns the structured schema of the Graph"""
        return self.structured_schema
[docs]    def refresh_schema(self) -> None:
        """Refreshes the schema of the FalkorDB database"""