SPB Git

spb/ai-atlas

Public
3.2 KB · 53 lines python
1import pytest23from aiatlas.connectors.labs.cohere import BLOG, DOCS, CohereConnector, blog_items4from aiatlas.sdk.facts import Target5from tests.conftest import claims_of, entity_names, extract_from_fixture, fixture_path678@pytest.fixture9def connector() -> CohereConnector:10    return CohereConnector()111213async def test_models(connector):14    facts = await extract_from_fixture(connector, Target(url=f"{DOCS}.md", doc_type="model_docs", key="models"), fixture_path("cohere", "models.md"), content_type="text/markdown")15    models = entity_names(facts, "model")16    assert len(models) >= 40 and {"command-a-plus-05-2026", "embed-v4.0", "rerank-v4.0-pro", "parse-v5.0", "cohere-transcribe-03-2026", "tiny-aya-global"} <= models17    a_plus = claims_of(facts, "command-a-plus-05-2026")18    assert a_plus["context_length"] == 128_000 and a_plus["max_output_tokens"] == 64_000 and a_plus["status"] == "active"19    assert a_plus["modalities"] == ["text", "image"] and a_plus["vision"] is True and a_plus["family"] == "Command" and a_plus["is_moe"] is True20    assert a_plus["foundry_model_id"] == "coherelabs-command-a-plus-05-2026-w4a4"21    r = claims_of(facts, "command-r-03-2024")22    assert r["status"] == "deprecated" and r["deprecation_date"] == "2025-09-15"23    embed = claims_of(facts, "embed-v4.0")24    assert embed["context_length"] == 128_000 and 1536 in embed["embedding_dimensions"] and embed["modalities_output"] == ["embedding"]25    north = claims_of(facts, "north-small-translate-1-0")26    assert north["parameter_count"] == 218_000_000_000 and north["active_parameter_count"] == 25_000_000_000 and north["is_moe"] is True27    assert claims_of(facts, "rerank-v3.5")["bedrock_model_id"] == "cohere.rerank-v3-5:0"28    assert claims_of(facts, "cohere-transcribe-03-2026")["openness"] == "open-source"29    assert claims_of(facts, "command-a-reasoning-08-2025")["reasoning"] is True30    # alias rows fold into the model they point at31    plus = next(e for e in facts.entities if e.name == "command-r-plus-04-2024")32    assert "command-r-plus" in plus.aliases and "command-r-plus" not in models33    assert plus.identifiers == {"cohere_model_id": "command-r-plus-04-2024"}34    assert sum(r.predicate == "available_through" for r in facts.relations) >= 30353637async def test_blog(connector):38    facts = await extract_from_fixture(connector, Target(url=BLOG, doc_type="listing", key="blog"), fixture_path("cohere", "blog.html"))39    events = {e.source_url: e for e in facts.events}40    assert len(events) >= 2041    north = events[f"{BLOG}/north-small-translate"]42    assert north.summary.startswith("Cohere: Introducing North Small Translate") and north.effective_at.date().isoformat() == "2026-09-10"43    assert north.category == "release" and north.meta["categories"] == ["Product Launch"]44    assert events[f"{BLOG}/command-a-plus"].effective_at.date().isoformat() == "2026-05-20"45    assert all(e.effective_at is not None for e in facts.events)46    assert any(t.needs_llm for t in facts.targets)474849def test_blog_items_direct():50    items = blog_items(fixture_path("cohere", "blog.html").read_bytes())51    assert items[0].url == f"{BLOG}/north-small-translate" and items[0].published_at is not None52    assert all(not it.url.startswith(f"{BLOG}/tag/") for it in items)53
Files · 988708f87b6de48ea615b846f7dee321b888038c
Menu

Theme