CTM Business case update
This commit is contained in:
@@ -108,6 +108,50 @@ def test_consumption_tokens_rounded_up_monthly():
|
||||
assert df.iloc[0]["annual_cost"] == pytest.approx(3 * 12 * 1.0)
|
||||
|
||||
|
||||
def test_predictive_routing_consumption():
|
||||
"""1,700 calls/mo ÷ 17 per token = 100 tokens/mo → $1,200/yr (year 2, no ramp)."""
|
||||
site = SiteInput(
|
||||
"Tiny", "US", agents=5, supervisors=0,
|
||||
voice_volume_monthly=1_700, email_volume_monthly=0,
|
||||
chat_volume_monthly=0, sms_volume_monthly=0,
|
||||
voice_aht_seconds=300, email_aht_seconds=600,
|
||||
chat_aht_seconds=480, voice_acw_seconds=60,
|
||||
fully_loaded_agent_cost_annual=65_000,
|
||||
fully_loaded_supervisor_cost_annual=95_000,
|
||||
)
|
||||
df = calculate_consumption_ai_cost(
|
||||
[site], FeatureScope("Predictive Routing", ["Tiny"]),
|
||||
DEFAULT_METERS["Predictive Routing"], "realistic", DEFAULT_PRICING, year=2,
|
||||
)
|
||||
assert df.iloc[0]["tokens_monthly"] == 100
|
||||
assert df.iloc[0]["annual_cost"] == pytest.approx(1_200)
|
||||
|
||||
|
||||
def test_predictive_routing_eligibility_and_total_cost():
|
||||
"""eligibility_pct halves the routed volume; total_cost handles the scope."""
|
||||
site = SiteInput(
|
||||
"Tiny", "US", agents=5, supervisors=0,
|
||||
voice_volume_monthly=1_700, email_volume_monthly=0,
|
||||
chat_volume_monthly=0, sms_volume_monthly=0,
|
||||
voice_aht_seconds=300, email_aht_seconds=600,
|
||||
chat_aht_seconds=480, voice_acw_seconds=60,
|
||||
fully_loaded_agent_cost_annual=65_000,
|
||||
fully_loaded_supervisor_cost_annual=95_000,
|
||||
)
|
||||
scope = FeatureScope("Predictive Routing", ["Tiny"], eligibility_pct=0.5)
|
||||
df = calculate_consumption_ai_cost(
|
||||
[site], scope, DEFAULT_METERS["Predictive Routing"], "realistic",
|
||||
DEFAULT_PRICING, year=2,
|
||||
)
|
||||
assert df.iloc[0]["tokens_monthly"] == 50
|
||||
total = calculate_total_cost(
|
||||
[site], [scope], DEFAULT_METERS, DEFAULT_PRICING, "realistic", 2,
|
||||
include_platform=False,
|
||||
)
|
||||
pr_row = total[total["cost_line"] == "Predictive Routing"].iloc[0]
|
||||
assert pr_row["annual_cost"] == pytest.approx(50 * 12 * 1.0)
|
||||
|
||||
|
||||
def test_regional_pricing_not_hardcoded():
|
||||
pricing = dict(DEFAULT_PRICING)
|
||||
from tokencalc.meters import TokenPricing
|
||||
|
||||
Reference in New Issue
Block a user