The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix(voyage): ruff format + add missing query-string test coverage
fzowle8ae29f135d3
diff --git a/litellm/llms/voyage/embedding/transformation_contextual.py b/litellm/llms/voyage/embedding/transformation_contextual.pyindex c4eb6f34283..4d8bcc7ff80 100644--- a/litellm/llms/voyage/embedding/transformation_contextual.py+++ b/litellm/llms/voyage/embedding/transformation_contextual.py@@ -2,6 +2,7 @@This module is used to transform the request and response for the Voyage contextualized embeddings API.This would be used for all the contextualized embeddings models in Voyage."""+from typing import Any, Dict, List, Optional, Tuple, Unionimport httpxdiff --git a/tests/llm_translation/test_voyage_ai.py b/tests/llm_translation/test_voyage_ai.pyindex a0d291bc02f..e6c73240a0e 100644--- a/tests/llm_translation/test_voyage_ai.py+++ b/tests/llm_translation/test_voyage_ai.py@@ -300,6 +300,22 @@ class TestVoyageContextualEmbeddings:assert transformed["chunk_size"] == 32000assert transformed["input_type"] == "document"+ def test_contextual_single_string_query_no_auto_chunk(self):+ """A single string with input_type='query' is not auto-chunked."""+ from litellm.llms.voyage.embedding.transformation_contextual import (+ VoyageContextualEmbeddingConfig,+ )++ config = VoyageContextualEmbeddingConfig()++ transformed = config.transform_embedding_request(+ "voyage-context-4", "Hello", {"input_type": "query"}, {}+ )++ assert transformed["inputs"] == ["Hello"]+ assert transformed["input_type"] == "query"+ assert "enable_auto_chunking" not in transformed+def test_contextual_nested_input_passthrough(self):"""Already-nested list[list[str]] input is passed through unchanged."""from litellm.llms.voyage.embedding.transformation_contextual import (