# __init__.py
"""
LayBot LingTeach AI · Python SDK
"""
from .chat import Chat
from .doc import Doc
from .embed import Embed
from .batch import Batch
from .fine_tune import FineTune
from .file import File
from .portal import Portal
from .cache import Caches

__all__ = [
    "Chat", "Doc", "Embed", "Batch",
    "FineTune", "File", "Portal",
    "Caches",
    "via_gateway",
]

def via_gateway(base: str, *, token: str, header: str = "X-Jump-Auth", **kwargs):
    """
    语法糖：快速注入“跳板/网关鉴权头”并覆盖 base。
    - 不改变 SDK 的 vendor/协议语义，只是提供便利配置。
    - 对所有请求生效（包括 cachedContents）。
    """
    headers = dict(kwargs.get("headers") or {})
    headers.setdefault(header, token)   # 不覆盖用户显式传入
    kwargs["headers"] = headers
    kwargs["base"] = base
    return kwargs

__version__ = "1.0.0"
