17 lines
435 B
Python
17 lines
435 B
Python
from typing import Optional
|
|
from volcenginesdkarkruntime import AsyncArk
|
|
|
|
_ark_client: Optional[AsyncArk] = None
|
|
|
|
def set_ark_client(client: AsyncArk):
|
|
global _ark_client
|
|
_ark_client = client
|
|
|
|
def get_ark_client() -> Optional[AsyncArk]:
|
|
return _ark_client
|
|
|
|
def cleanup_ark_client():
|
|
global _ark_client
|
|
if _ark_client:
|
|
# AsyncArk 无显式 close,但可设为 None
|
|
_ark_client = None |