Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions scripts/check_funasr_website_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class StaticAssetContract:
),
f"{BASE_URL}/ecosystem.html": PageContract(
required=(
"35K+",
"36K+",
"/donors.html",
"LiteLLM",
"custom_openai",
Expand All @@ -67,12 +67,18 @@ class StaticAssetContract:
("FunASR 官方插件 0.1.1", r"FunASR 官方插件 0\.1\.1(?![\w.+-])"),
("最大 25 MB 音频上传", r"最大 (?<!\d)25 MB 音频上传"),
),
required_links=("https://marketplace.dify.ai/plugin/langgenius/funasr",),
required_links=(
"https://marketplace.dify.ai/plugin/langgenius/funasr",
"https://github.com/modelscope/FunClip/releases/tag/v2.1.1",
"https://github.com/0xShug0/audio.cpp",
"https://github.com/0xShug0/audio.cpp/pull/155",
"https://github.com/0xShug0/audio.cpp/blob/1778b23a5f6a4951c788e4bb0e7baa04f20012a2/docs/models/fun_asr_nano.md",
),
forbidden=("16K+",),
),
f"{BASE_URL}/en/ecosystem.html": PageContract(
required=(
"35K+",
"36K+",
"/en/donors.html",
"LiteLLM",
"custom_openai",
Expand All @@ -82,7 +88,13 @@ class StaticAssetContract:
("FunASR plugin 0.1.1", r"FunASR plugin 0\.1\.1(?![\w.+-])"),
("25 MB uploads", r"(?<!\d)25 MB uploads"),
),
required_links=("https://marketplace.dify.ai/plugin/langgenius/funasr",),
required_links=(
"https://marketplace.dify.ai/plugin/langgenius/funasr",
"https://github.com/modelscope/FunClip/releases/tag/v2.1.1",
"https://github.com/0xShug0/audio.cpp",
"https://github.com/0xShug0/audio.cpp/pull/155",
"https://github.com/0xShug0/audio.cpp/blob/1778b23a5f6a4951c788e4bb0e7baa04f20012a2/docs/models/fun_asr_nano.md",
),
forbidden=("16K+",),
),
f"{BASE_URL}/donors.html": PageContract(
Expand Down
38 changes: 34 additions & 4 deletions tests/test_check_funasr_website_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,13 @@ def test_website_contract_accepts_current_public_copy():
vLLM Acceleration
""",
"https://www.funasr.com/ecosystem.html": """
<div class="stat-num">35K+</div>
<div class="stat-num">36K+</div>
<a href="/donors.html">功德榜</a>
<a href="https://github.com/BerriAI/litellm">LiteLLM</a>
<a href="https://github.com/modelscope/FunClip/releases/tag/v2.1.1">FunClip v2.1.1</a>
<a href="https://github.com/0xShug0/audio.cpp">audio.cpp</a>
<a href="https://github.com/0xShug0/audio.cpp/pull/155">merged PR</a>
<a href="https://github.com/0xShug0/audio.cpp/blob/1778b23a5f6a4951c788e4bb0e7baa04f20012a2/docs/models/fun_asr_nano.md">pinned guide</a>
<div>custom_openai</div>
<div>54.3K stars</div>
<a href="https://marketplace.dify.ai/plugin/langgenius/funasr">
Expand All @@ -61,9 +65,13 @@ def test_website_contract_accepts_current_public_copy():
<div>支持最大 25 MB 音频上传</div>
""",
"https://www.funasr.com/en/ecosystem.html": """
<div class="stat-num">35K+</div>
<div class="stat-num">36K+</div>
<a href="/en/donors.html">Thanks</a>
<a href="https://github.com/BerriAI/litellm">LiteLLM</a>
<a href="https://github.com/modelscope/FunClip/releases/tag/v2.1.1">FunClip v2.1.1</a>
<a href="https://github.com/0xShug0/audio.cpp">audio.cpp</a>
<a href="https://github.com/0xShug0/audio.cpp/pull/155">merged PR</a>
<a href="https://github.com/0xShug0/audio.cpp/blob/1778b23a5f6a4951c788e4bb0e7baa04f20012a2/docs/models/fun_asr_nano.md">pinned guide</a>
<div>custom_openai</div>
<div>54.3K stars</div>
<a href="https://marketplace.dify.ai/plugin/langgenius/funasr">
Expand Down Expand Up @@ -276,13 +284,31 @@ def test_website_contract_includes_homepage_entrypoints():
assert "https://www.funasr.com/en/llama-cpp.html" in checker.PAGE_CONTRACTS


def test_ecosystem_contract_requires_current_release_and_native_runtime():
checker = _load_module()
evidence_links = {
"https://github.com/modelscope/FunClip/releases/tag/v2.1.1",
"https://github.com/0xShug0/audio.cpp",
"https://github.com/0xShug0/audio.cpp/pull/155",
"https://github.com/0xShug0/audio.cpp/blob/1778b23a5f6a4951c788e4bb0e7baa04f20012a2/docs/models/fun_asr_nano.md",
}

for url in (
"https://www.funasr.com/ecosystem.html",
"https://www.funasr.com/en/ecosystem.html",
):
contract = checker.PAGE_CONTRACTS[url]
assert "36K+" in contract.required
assert evidence_links <= set(contract.required_links)


def test_ecosystem_contract_requires_live_dify_marketplace():
checker = _load_module()
url = "https://www.funasr.com/en/ecosystem.html"
pages = {
url: """
<body>
<div class="stat-num">35K+</div>
<div class="stat-num">36K+</div>
<a href="/en/donors.html">Thanks</a>
<a href="https://github.com/BerriAI/litellm">LiteLLM</a>
<div>custom_openai</div>
Expand Down Expand Up @@ -313,9 +339,13 @@ def test_ecosystem_contract_requires_live_dify_marketplace():
def _valid_english_ecosystem_html():
return """
<body>
<div class="stat-num">35K+</div>
<div class="stat-num">36K+</div>
<a href="/en/donors.html">Thanks</a>
<a href="https://github.com/BerriAI/litellm">LiteLLM</a>
<a href="https://github.com/modelscope/FunClip/releases/tag/v2.1.1">FunClip v2.1.1</a>
<a href="https://github.com/0xShug0/audio.cpp">audio.cpp</a>
<a href="https://github.com/0xShug0/audio.cpp/pull/155">merged PR</a>
<a href="https://github.com/0xShug0/audio.cpp/blob/1778b23a5f6a4951c788e4bb0e7baa04f20012a2/docs/models/fun_asr_nano.md">pinned guide</a>
<div>custom_openai</div>
<div>54.3K stars</div>
<a href="https://marketplace.dify.ai/plugin/langgenius/funasr">
Expand Down