mirror of
https://github.com/open-jarvis/OpenJarvis.git
synced 2026-07-30 10:52:15 +00:00
Complete implementation across six development phases (v0.1 through v1.0): - Core: Registry system, config, event bus, types (Phase 0) - Intelligence + Inference: Model routing, Ollama/vLLM/llama.cpp/Cloud engines (Phase 1) - Memory: SQLite/FAISS/ColBERT/BM25/Hybrid backends, document ingest, context injection (Phase 2) - Agents: Simple/Orchestrator/Custom/OpenClaw agents, tool system (Phase 3) - Learning: HeuristicRouter, reward functions, GRPO stub, telemetry aggregation (Phase 4) - SDK: Jarvis class, OpenClaw protocol/transport, benchmarks, Docker deployment (Phase 5) 520 tests passing, 8 skipped (optional deps). Ruff lint clean. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
35 lines
988 B
Python
35 lines
988 B
Python
"""Tests for learning ABC stubs."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from openjarvis.learning._stubs import RoutingContext
|
|
|
|
|
|
class TestRoutingContext:
|
|
def test_defaults(self) -> None:
|
|
ctx = RoutingContext()
|
|
assert ctx.query == ""
|
|
assert ctx.query_length == 0
|
|
assert ctx.has_code is False
|
|
assert ctx.has_math is False
|
|
assert ctx.language == "en"
|
|
assert ctx.urgency == 0.5
|
|
assert ctx.metadata == {}
|
|
|
|
def test_custom_values(self) -> None:
|
|
ctx = RoutingContext(
|
|
query="def foo():",
|
|
query_length=10,
|
|
has_code=True,
|
|
has_math=False,
|
|
language="py",
|
|
urgency=0.9,
|
|
metadata={"key": "val"},
|
|
)
|
|
assert ctx.query == "def foo():"
|
|
assert ctx.query_length == 10
|
|
assert ctx.has_code is True
|
|
assert ctx.language == "py"
|
|
assert ctx.urgency == 0.9
|
|
assert ctx.metadata == {"key": "val"}
|