"""Initialize the AI Basics package."""

import os
import webbrowser
from typing import Dict

from hyfi import HyFI

from ._version import __version__

# Read the package path from the current directory
__package_path__ = os.path.dirname(__file__)

# Initialize the global HyFI object
HyFI.initialize_global_hyfi(
    package_path=__package_path__,
    version=__version__,
    plugins=[],
)

# Initialize the logger
HyFI.setLogger()


def get_version() -> str:
    """Get the package version."""
    return __version__


def open_homepage(**args: Dict) -> None:
    """
    Open the homepage in the browser.
    """
    HyFI.print_about(**args)
    if homepage := str(args.get("homepage", "")):
        webbrowser.open_new_tab(homepage)


__all__ = ["HyFI", "get_version", "open_homepage"]
