Add moonshotai/kimi-k3 as OpenRouter basemodel default after live smoke, USD→EUR cost conversion, append-only usage ledger, and CLI run/cost/spend week commands with token and euro reporting.
81 lines
2 KiB
Python
81 lines
2 KiB
Python
"""
|
|
Tests for the public llm_connect package surface.
|
|
"""
|
|
|
|
import llm_connect
|
|
|
|
|
|
def test_wp_0004_primitives_are_exported_from_package_root():
|
|
expected_names = [
|
|
"AdaptiveRoutingPolicy",
|
|
"BaselineGrader",
|
|
"EmbeddingSimilarityJudge",
|
|
"ExactMatchJudge",
|
|
"GradingResult",
|
|
"Judge",
|
|
"LLMJudge",
|
|
"PairedGrader",
|
|
"QualityLedger",
|
|
"QualityObservation",
|
|
"ShadowingAdapter",
|
|
"is_stale",
|
|
]
|
|
|
|
for name in expected_names:
|
|
assert hasattr(llm_connect, name)
|
|
assert name in llm_connect.__all__
|
|
|
|
|
|
def test_wp_0005_primitives_are_exported_from_package_root():
|
|
expected_names = [
|
|
"ModelRate",
|
|
"ModelRateRegistry",
|
|
"CostEstimate",
|
|
"CostModel",
|
|
"estimate_cost",
|
|
"TokenEstimate",
|
|
"Observation",
|
|
"ProblemClass",
|
|
"ProblemClassRegistry",
|
|
"default_problem_class_registry",
|
|
"ChunkSummarizationProblemClass",
|
|
"EntityExtractionProblemClass",
|
|
"RelationExtractionProblemClass",
|
|
"JudgeEvalProblemClass",
|
|
"ReportSynthesisProblemClass",
|
|
]
|
|
|
|
for name in expected_names:
|
|
assert hasattr(llm_connect, name)
|
|
assert name in llm_connect.__all__
|
|
|
|
|
|
def test_wp_0006_profile_primitives_are_exported_from_package_root():
|
|
expected_names = [
|
|
"CUSTODIAN_TRIAGE_BALANCED",
|
|
"RuntimeProfile",
|
|
"ProfiledLLMAdapter",
|
|
"default_runtime_profiles",
|
|
]
|
|
|
|
for name in expected_names:
|
|
assert hasattr(llm_connect, name)
|
|
assert name in llm_connect.__all__
|
|
|
|
|
|
def test_wp_0007_spend_primitives_are_exported_from_package_root():
|
|
expected_names = [
|
|
"FxRate",
|
|
"resolve_fx_rate",
|
|
"UsageEvent",
|
|
"UsageLedger",
|
|
"UsageSummary",
|
|
"default_usage_ledger_path",
|
|
"event_from_response",
|
|
"maybe_record_usage",
|
|
"week_window",
|
|
]
|
|
|
|
for name in expected_names:
|
|
assert hasattr(llm_connect, name)
|
|
assert name in llm_connect.__all__
|