Skip to content

Commit f95e3fc

Browse files
authored
fix(agfs): import AGFSBindingClient error不阻塞http client使用 (#324)
1 parent 048c201 commit f95e3fc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

openviking/utils/agfs_utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
import os
88
from typing import Any
99

10-
from pyagfs import AGFSBindingClient, AGFSClient
11-
1210
from openviking_cli.utils.logger import get_logger
1311

1412
logger = get_logger(__name__)
@@ -31,6 +29,8 @@ def create_agfs_client(agfs_config: Any) -> Any:
3129

3230
if mode == "binding-client":
3331
# Setup library path if needed
32+
from pyagfs import AGFSBindingClient
33+
3434
lib_path = getattr(agfs_config, "lib_path", None)
3535
if lib_path and lib_path not in ["1", "default"]:
3636
os.environ["AGFS_LIB_PATH"] = lib_path
@@ -44,6 +44,8 @@ def create_agfs_client(agfs_config: Any) -> Any:
4444
return client
4545
else:
4646
# Default to http-client
47+
from pyagfs import AGFSClient
48+
4749
url = getattr(agfs_config, "url", "http://localhost:8080")
4850
timeout = getattr(agfs_config, "timeout", 10)
4951
client = AGFSClient(api_base_url=url, timeout=timeout)

0 commit comments

Comments
 (0)