fix(archivar): sync __init__.py barrel imports + test_router.py to v3 class names
- __init__.py: MessageClassifier→IntentClassifier, MessageRouter→BidirectionalRouter, CONFIDENCE_THRESHOLD→CONFIDENCE_THRESHOLDS, added ROOM_MAP_PATH, ARCHIVAR_STATE_PATH, ArchivarState - config.py: added missing ROOM_MAP_PATH constant (imported by router.py) - test_router.py: updated imports + BidirectionalRouter(state=ArchivarState()) constructor Root cause: Miguel's v3 refactoring renamed classes but didn't update the barrel file. Gateway failed with 'No adapter available for rocketchat' because archivar/__init__.py imported non-existent names.
This commit is contained in:
@@ -20,9 +20,10 @@ import pytest
|
||||
import sys
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[3]))
|
||||
|
||||
from plugin.archivar.router import MessageRouter
|
||||
from plugin.archivar.router import BidirectionalRouter
|
||||
from plugin.archivar.room_map import RoomMap
|
||||
from plugin.archivar.classifier import MessageClassifier, EmbeddingClient
|
||||
from plugin.archivar.classifier import IntentClassifier, EmbeddingClient
|
||||
from plugin.archivar.archivar_state import ArchivarState
|
||||
|
||||
|
||||
# ── Mocks ──────────────────────────────────────────────────────────────────
|
||||
@@ -73,7 +74,7 @@ class TestRouterIntegration:
|
||||
"""MessageRouter integration tests."""
|
||||
|
||||
@pytest.fixture
|
||||
def router(self) -> MessageRouter:
|
||||
def router(self) -> BidirectionalRouter:
|
||||
# Create a room map for testing
|
||||
json_str = _make_map_json(
|
||||
rooms=[
|
||||
@@ -88,8 +89,9 @@ class TestRouterIntegration:
|
||||
room_map = RoomMap.load(path)
|
||||
# Create a mock classifier
|
||||
mock_client = MockEmbeddingClient()
|
||||
classifier = MessageClassifier(embedding_client=mock_client)
|
||||
router = MessageRouter(room_map, classifier)
|
||||
classifier = IntentClassifier(embedding_client=mock_client)
|
||||
state = ArchivarState()
|
||||
router = BidirectionalRouter(room_map, classifier, state)
|
||||
return router
|
||||
finally:
|
||||
path.unlink(missing_ok=True)
|
||||
|
||||
Reference in New Issue
Block a user