mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
fix(voyage): drop voyage-4-nano and the contextual tests upstream already covers
voyage-4-nano is not served on the Voyage API, so it does not belong in the model map. The contextual input tests duplicate tests/test_litellm/llms/voyage/test_voyage_contextual_embedding.py, which landed upstream with the auto-chunking fix this branch was carrying.
This commit is contained in:
parent
c86af7d8e4
commit
f10625ab70
3 changed files with 0 additions and 108 deletions
|
|
@ -60293,16 +60293,6 @@
|
|||
"output_vector_size": 1024,
|
||||
"source": "https://docs.voyageai.com/docs/pricing"
|
||||
},
|
||||
"voyage/voyage-4-nano": {
|
||||
"input_cost_per_token": 0.0,
|
||||
"litellm_provider": "voyage",
|
||||
"max_input_tokens": 32000,
|
||||
"max_tokens": 32000,
|
||||
"mode": "embedding",
|
||||
"output_cost_per_token": 0.0,
|
||||
"output_vector_size": 1024,
|
||||
"source": "https://docs.voyageai.com/docs/embeddings"
|
||||
},
|
||||
"voyage/voyage-code-4": {
|
||||
"input_cost_per_token": 1.2e-07,
|
||||
"litellm_provider": "voyage",
|
||||
|
|
|
|||
|
|
@ -60293,16 +60293,6 @@
|
|||
"output_vector_size": 1024,
|
||||
"source": "https://docs.voyageai.com/docs/pricing"
|
||||
},
|
||||
"voyage/voyage-4-nano": {
|
||||
"input_cost_per_token": 0.0,
|
||||
"litellm_provider": "voyage",
|
||||
"max_input_tokens": 32000,
|
||||
"max_tokens": 32000,
|
||||
"mode": "embedding",
|
||||
"output_cost_per_token": 0.0,
|
||||
"output_vector_size": 1024,
|
||||
"source": "https://docs.voyageai.com/docs/embeddings"
|
||||
},
|
||||
"voyage/voyage-code-4": {
|
||||
"input_cost_per_token": 1.2e-07,
|
||||
"litellm_provider": "voyage",
|
||||
|
|
|
|||
|
|
@ -196,94 +196,6 @@ class TestVoyageContextualEmbeddings:
|
|||
assert transformed["model"] == "voyage-context-3"
|
||||
assert transformed["encoding_format"] == "float"
|
||||
|
||||
def test_contextual_embedding_flat_list_defaults_to_document_auto_chunk(self):
|
||||
"""A flat list[str] with no input_type is documents, so it needs auto-chunking + input_type=document"""
|
||||
from litellm.llms.voyage.embedding.transformation_contextual import (
|
||||
VoyageContextualEmbeddingConfig,
|
||||
)
|
||||
|
||||
config = VoyageContextualEmbeddingConfig()
|
||||
flat_input = ["chunk one", "chunk two"]
|
||||
|
||||
transformed = config.transform_embedding_request(
|
||||
"voyage-context-4", flat_input, {}, {}
|
||||
)
|
||||
|
||||
assert transformed["inputs"] == flat_input
|
||||
assert transformed["model"] == "voyage-context-4"
|
||||
assert transformed["input_type"] == "document"
|
||||
assert transformed["enable_auto_chunking"] is True
|
||||
|
||||
def test_contextual_embedding_flat_list_query_stays_flat_without_auto_chunk(self):
|
||||
"""A flat list[str] of queries is valid as-is, so no auto-chunking must be forced on"""
|
||||
from litellm.llms.voyage.embedding.transformation_contextual import (
|
||||
VoyageContextualEmbeddingConfig,
|
||||
)
|
||||
|
||||
config = VoyageContextualEmbeddingConfig()
|
||||
flat_input = ["what is voyage", "who owns voyage"]
|
||||
|
||||
transformed = config.transform_embedding_request(
|
||||
"voyage-context-4", flat_input, {"input_type": "query"}, {}
|
||||
)
|
||||
|
||||
assert transformed["inputs"] == flat_input
|
||||
assert transformed["input_type"] == "query"
|
||||
assert "enable_auto_chunking" not in transformed
|
||||
|
||||
def test_contextual_embedding_nested_list_input_passes_through(self):
|
||||
"""A nested list[list[str]] is pre-chunked documents, valid unchanged with no extra params"""
|
||||
from litellm.llms.voyage.embedding.transformation_contextual import (
|
||||
VoyageContextualEmbeddingConfig,
|
||||
)
|
||||
|
||||
config = VoyageContextualEmbeddingConfig()
|
||||
nested_input = [["doc a chunk 1", "doc a chunk 2"], ["doc b chunk 1"]]
|
||||
|
||||
transformed = config.transform_embedding_request(
|
||||
"voyage-context-4", nested_input, {}, {}
|
||||
)
|
||||
|
||||
assert transformed["inputs"] == nested_input
|
||||
assert "enable_auto_chunking" not in transformed
|
||||
assert "input_type" not in transformed
|
||||
|
||||
def test_contextual_embedding_str_input_wrapped_with_auto_chunk(self):
|
||||
"""A bare str is wrapped to a one-element sequence and, as documents, gets auto-chunking + input_type=document"""
|
||||
from litellm.llms.voyage.embedding.transformation_contextual import (
|
||||
VoyageContextualEmbeddingConfig,
|
||||
)
|
||||
|
||||
config = VoyageContextualEmbeddingConfig()
|
||||
|
||||
transformed = config.transform_embedding_request(
|
||||
"voyage-context-4", "just one chunk", {}, {}
|
||||
)
|
||||
|
||||
assert list(transformed["inputs"]) == ["just one chunk"]
|
||||
assert transformed["input_type"] == "document"
|
||||
assert transformed["enable_auto_chunking"] is True
|
||||
|
||||
def test_contextual_embedding_caller_params_win(self):
|
||||
"""Caller-set input_type=document with explicit auto-chunking off must be respected, not overridden"""
|
||||
from litellm.llms.voyage.embedding.transformation_contextual import (
|
||||
VoyageContextualEmbeddingConfig,
|
||||
)
|
||||
|
||||
config = VoyageContextualEmbeddingConfig()
|
||||
flat_input = ["chunk a", "chunk b"]
|
||||
|
||||
transformed = config.transform_embedding_request(
|
||||
"voyage-context-4",
|
||||
flat_input,
|
||||
{"input_type": "document", "enable_auto_chunking": False},
|
||||
{},
|
||||
)
|
||||
|
||||
assert transformed["inputs"] == flat_input
|
||||
assert transformed["input_type"] == "document"
|
||||
assert transformed["enable_auto_chunking"] is False
|
||||
|
||||
def test_contextual_embedding_response_transformation(self):
|
||||
"""Test response transformation for contextual embeddings"""
|
||||
from litellm.llms.voyage.embedding.transformation_contextual import (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue