HTML 77.2%
TypeScript 10.5%
Python 9.6%
JavaScript 2.5%
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"] == ["image", "text"] and a_plus["vision"] is True and a_plus["family"] == "Command" and a_plus["is_moe"] is True # canonical, sorted20 a_plus_ref = next(e for e in facts.entities if e.name == "command-a-plus-05-2026")21 assert a_plus_ref.family is not None and a_plus_ref.family.entity_type == "model_family" and a_plus_ref.family.name == "Command"22 assert a_plus["foundry_model_id"] == "coherelabs-command-a-plus-05-2026-w4a4"23 r = claims_of(facts, "command-r-03-2024")24 assert r["status"] == "deprecated" and r["deprecation_date"] == "2025-09-15"25 embed = claims_of(facts, "embed-v4.0")26 assert embed["context_length"] == 128_000 and 1536 in embed["embedding_dimensions"] and embed["modalities_output"] == ["embedding"]27 north = claims_of(facts, "north-small-translate-1-0")28 assert north["parameter_count"] == 218_000_000_000 and north["active_parameter_count"] == 25_000_000_000 and north["is_moe"] is True29 assert claims_of(facts, "rerank-v3.5")["bedrock_model_id"] == "cohere.rerank-v3-5:0"30 transcribe = claims_of(facts, "cohere-transcribe-03-2026")31 assert transcribe["openness"] == "open-weights" and transcribe["openness_raw"] == "open-source" and transcribe["weights_available"] is True # prose "open source" → canonical category32 assert claims_of(facts, "command-a-reasoning-08-2025")["reasoning"] is True33 # alias rows fold into the model they point at34 plus = next(e for e in facts.entities if e.name == "command-r-plus-04-2024")35 assert "command-r-plus" in plus.aliases and "command-r-plus" not in models36 assert plus.identifiers == {"cohere_model_id": "command-r-plus-04-2024"}37 plus_claims = claims_of(facts, "command-r-plus-04-2024")38 assert plus_claims["api_aliases"] == ["command-r-plus"] and plus_claims["api_alias"] == "command-r-plus" # always a list + first for compat39 assert sum(r.predicate == "available_through" for r in facts.relations) >= 30404142async def test_blog(connector):43 facts = await extract_from_fixture(connector, Target(url=BLOG, doc_type="listing", key="blog"), fixture_path("cohere", "blog.html"))44 events = {e.source_url: e for e in facts.events}45 assert len(events) >= 2046 north = events[f"{BLOG}/north-small-translate"]47 assert north.summary.startswith("Cohere: Introducing North Small Translate") and north.effective_at.date().isoformat() == "2026-09-10"48 assert north.category == "release" and north.meta["categories"] == ["Product Launch"]49 assert events[f"{BLOG}/command-a-plus"].effective_at.date().isoformat() == "2026-05-20"50 assert all(e.effective_at is not None for e in facts.events)51 assert any(t.needs_llm for t in facts.targets)525354def test_blog_items_direct():55 items = blog_items(fixture_path("cohere", "blog.html").read_bytes())56 assert items[0].url == f"{BLOG}/north-small-translate" and items[0].published_at is not None57 assert all(not it.url.startswith(f"{BLOG}/tag/") for it in items)58