mirror of
https://github.com/open-jarvis/OpenJarvis.git
synced 2026-07-30 19:02:16 +00:00
- Eval config: TOML-based suite configs defining models x benchmarks matrix, loaded via --config flag. Includes load_eval_config(), expand_suite(), 7 config dataclasses, 3 example configs, and 61 new tests. - Pillar-aligned config: generation params in IntelligenceConfig, nested engine/learning configs, agent objective/system_prompt/context_from_memory, structured learning sub-policies, TOML migration layer. - Documentation: evaluations user guide, evals API reference, updated mkdocs.yml navigation, updated architecture docs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
47 lines
1.3 KiB
Python
47 lines
1.3 KiB
Python
"""Backward-compat: verify router is still importable from intelligence.
|
|
|
|
The canonical tests live in tests/learning/test_router.py. This file
|
|
verifies the backward-compat shim in intelligence/router.py works.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from openjarvis.core.registry import ModelRegistry
|
|
from openjarvis.core.types import ModelSpec
|
|
from openjarvis.intelligence.router import (
|
|
HeuristicRouter,
|
|
build_routing_context,
|
|
)
|
|
from openjarvis.learning._stubs import RoutingContext
|
|
|
|
|
|
def _register_models() -> None:
|
|
ModelRegistry.register_value(
|
|
"small",
|
|
ModelSpec(
|
|
model_id="small", name="Small",
|
|
parameter_count_b=3.0, context_length=4096,
|
|
),
|
|
)
|
|
ModelRegistry.register_value(
|
|
"large",
|
|
ModelSpec(
|
|
model_id="large", name="Large",
|
|
parameter_count_b=70.0, context_length=131072,
|
|
),
|
|
)
|
|
|
|
|
|
class TestShimImports:
|
|
def test_build_routing_context(self) -> None:
|
|
ctx = build_routing_context("def hello():\n pass")
|
|
assert ctx.has_code is True
|
|
|
|
def test_heuristic_router(self) -> None:
|
|
_register_models()
|
|
router = HeuristicRouter(
|
|
available_models=["small", "large"],
|
|
)
|
|
ctx = RoutingContext(query="Hi", query_length=2)
|
|
assert router.select_model(ctx) == "small"
|