"""
ArielAI — Build chatbots in minutes using open-source models and Gradio.

Quick start::

    from arielai import Chatbot

    bot = Chatbot("microsoft/DialoGPT-medium")
    bot.launch()

Using presets::

    bot = Chatbot.from_preset("zephyr")
    bot.launch()

One-liner::

    import arielai
    arielai.launch("microsoft/DialoGPT-medium")
"""

from .chatbot import Chatbot
from .ui import ChatUI, ACCENT_COLORS
from .models import list_presets, get_preset, ModelPreset, PRESETS
from .backends import (
    BaseBackend,
    TransformersBackend,
    OllamaBackend,
    HFInferenceBackend,
    create_backend,
)

__version__ = "0.1.2"
__author__ = "ArielAI Contributors"
__all__ = [
    "Chatbot",
    "ChatUI",
    "launch",
    "list_presets",
    "get_preset",
    "ModelPreset",
    "PRESETS",
    "ACCENT_COLORS",
    "BaseBackend",
    "TransformersBackend",
    "OllamaBackend",
    "HFInferenceBackend",
    "create_backend",
]


def launch(
    model: str = "microsoft/DialoGPT-medium",
    *,
    backend: str = "transformers",
    title: str = "ArielAI Chatbot",
    system_prompt: str = "",
    share: bool = False,
    **kwargs,
) -> None:
    """
    One-liner helper to launch a chatbot immediately.

    Args:
        model: HuggingFace model ID, Ollama model name, or preset name.
        backend: Backend to use ("transformers", "ollama", or "inference").
        title: Chatbot window title.
        system_prompt: Optional system/instruction prompt.
        share: Create a public Gradio share link.
        **kwargs: Any other Chatbot() constructor arguments.

    Example::

        import arielai
        arielai.launch("microsoft/DialoGPT-medium")
    """
    bot = Chatbot(
        model=model,
        backend=backend,
        title=title,
        system_prompt=system_prompt,
        **kwargs,
    )
    bot.launch(share=share)
