mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
unit tests for VertexGeminiConfig
This commit is contained in:
parent
8eaf4c55c0
commit
72f08bc6ea
1 changed files with 38 additions and 0 deletions
|
|
@ -31,3 +31,41 @@ def test_top_logprobs():
|
|||
)
|
||||
assert v["responseLogprobs"] is non_default_params["logprobs"]
|
||||
assert v["logprobs"] is non_default_params["top_logprobs"]
|
||||
|
||||
|
||||
def test_get_model_for_vertex_ai_url():
|
||||
# Test case 1: Regular model name
|
||||
model = "gemini-pro"
|
||||
result = VertexGeminiConfig.get_model_for_vertex_ai_url(model)
|
||||
assert result == "gemini-pro"
|
||||
|
||||
# Test case 2: Gemini spec model with UUID
|
||||
model = "gemini/ft-uuid-123"
|
||||
result = VertexGeminiConfig.get_model_for_vertex_ai_url(model)
|
||||
assert result == "ft-uuid-123"
|
||||
|
||||
|
||||
def test_is_model_gemini_gemini_spec_model():
|
||||
# Test case 1: None input
|
||||
assert VertexGeminiConfig._is_model_gemini_gemini_spec_model(None) == False
|
||||
|
||||
# Test case 2: Regular model name
|
||||
assert VertexGeminiConfig._is_model_gemini_gemini_spec_model("gemini-pro") == False
|
||||
|
||||
# Test case 3: Gemini spec model
|
||||
assert (
|
||||
VertexGeminiConfig._is_model_gemini_gemini_spec_model("gemini/custom-model")
|
||||
== True
|
||||
)
|
||||
|
||||
|
||||
def test_get_model_name_from_gemini_spec_model():
|
||||
# Test case 1: Regular model name
|
||||
model = "gemini-pro"
|
||||
result = VertexGeminiConfig._get_model_name_from_gemini_spec_model(model)
|
||||
assert result == "gemini-pro"
|
||||
|
||||
# Test case 2: Gemini spec model
|
||||
model = "gemini/ft-uuid-123"
|
||||
result = VertexGeminiConfig._get_model_name_from_gemini_spec_model(model)
|
||||
assert result == "ft-uuid-123"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue