Files
OpenViking/openviking/client.py
T
Jiahui Zhou 02f06488f3 feat: extract standalone python http sdk (#2736)
* feat: extract standalone python http sdk

* fix(python-sdk): restore ovcli.conf compatibility

fix(python-sdk): restore compatibility and lazy-load sdk

fix(python-sdk): restore legacy http client compatibility

docs(python-sdk): add chinese readme
2026-06-22 14:03:05 +08:00

39 lines
1.1 KiB
Python

# Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0
"""
OpenViking client.
This module provides both synchronous and asynchronous clients.
"""
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from openviking.async_client import AsyncOpenViking
from openviking.sync_client import SyncOpenViking
from openviking_cli.client.http import AsyncHTTPClient
from openviking_cli.client.sync_http import SyncHTTPClient
__all__ = ["SyncOpenViking", "AsyncOpenViking", "SyncHTTPClient", "AsyncHTTPClient"]
def __getattr__(name: str):
if name == "AsyncOpenViking":
from openviking.async_client import AsyncOpenViking
return AsyncOpenViking
if name == "SyncOpenViking":
from openviking.sync_client import SyncOpenViking
return SyncOpenViking
if name == "AsyncHTTPClient":
from openviking_cli.client.http import AsyncHTTPClient
return AsyncHTTPClient
if name == "SyncHTTPClient":
from openviking_cli.client.sync_http import SyncHTTPClient
return SyncHTTPClient
raise AttributeError(name)