refactor: update LLMRouter lazy import — circuitforge_core.resources.client → circuitforge_orch.client
This commit is contained in:
parent
c1e825c06a
commit
090a86ce1b
2 changed files with 10 additions and 1 deletions
|
|
@ -123,7 +123,7 @@ class LLMRouter:
|
||||||
if not orch_url:
|
if not orch_url:
|
||||||
return None
|
return None
|
||||||
try:
|
try:
|
||||||
from circuitforge_core.resources.client import CFOrchClient
|
from circuitforge_orch.client import CFOrchClient
|
||||||
client = CFOrchClient(orch_url)
|
client = CFOrchClient(orch_url)
|
||||||
service = orch_cfg.get("service", "vllm")
|
service = orch_cfg.get("service", "vllm")
|
||||||
candidates = orch_cfg.get("model_candidates", [])
|
candidates = orch_cfg.get("model_candidates", [])
|
||||||
|
|
|
||||||
|
|
@ -77,3 +77,12 @@ def test_complete_raises_when_all_backends_exhausted():
|
||||||
with patch.object(router, "_is_reachable", return_value=False):
|
with patch.object(router, "_is_reachable", return_value=False):
|
||||||
with pytest.raises(RuntimeError, match="exhausted"):
|
with pytest.raises(RuntimeError, match="exhausted"):
|
||||||
router.complete("test")
|
router.complete("test")
|
||||||
|
|
||||||
|
|
||||||
|
def test_try_cf_orch_alloc_import_path():
|
||||||
|
"""Verify lazy import points to circuitforge_orch, not circuitforge_core.resources."""
|
||||||
|
import inspect
|
||||||
|
from circuitforge_core.llm import router as router_module
|
||||||
|
src = inspect.getsource(router_module.LLMRouter._try_cf_orch_alloc)
|
||||||
|
assert "circuitforge_orch.client" in src
|
||||||
|
assert "circuitforge_core.resources.client" not in src
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue