This commit is contained in:
gcoinstash-cmd 2026-09-30 23:51:32 -04:00 • committed by GitHub
commit 31df6f9f5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,16 @@
import pytest
def normalize_model_name(name: str) -> str:
if not name:
return ""
return name.strip().lower().replace("openai/", "").replace("anthropic/", "")
def test_empty_and_whitespace_model_normalization():
assert normalize_model_name("") == ""
assert normalize_model_name(" ") == ""
assert normalize_model_name("openai/gpt-4o") == "gpt-4o"
assert normalize_model_name("Anthropic/claude-3-5-sonnet-20241022") == "claude-3-5-sonnet-20241022"
def test_model_name_casing_invariance():
assert normalize_model_name("GPT-4-TURBO") == "gpt-4-turbo"
assert normalize_model_name("text-embedding-3-small") == "text-embedding-3-small"