style(voyage): format multimodal embedding transformation to satisfy ruff

The copy of transformation_multimodal.py on the base branch carries a few
lines that exceed the 88 char limit (the httpx.Request construction, a
comprehension and two error constructions). Wrap them so ruff format --check
passes on the merged result
This commit is contained in:
fzowl 2026-06-30 02:28:13 +02:00
parent 752ee2f6cc
commit 315ba0e613

View file

@ -27,7 +27,9 @@ class VoyageMultimodalEmbeddingError(BaseLLMException):
):
self.status_code = status_code
self.message = message
self.request = httpx.Request(method="POST", url="https://api.voyageai.com/v1/multimodalembeddings")
self.request = httpx.Request(
method="POST", url="https://api.voyageai.com/v1/multimodalembeddings"
)
self.response = httpx.Response(status_code=status_code, request=self.request)
super().__init__(
status_code=status_code,
@ -133,7 +135,10 @@ class VoyageMultimodalEmbeddingConfig(BaseEmbeddingConfig):
content = item.get("content") or []
return {
**item,
"content": [self._normalize_content_item(content_item) for content_item in content],
"content": [
self._normalize_content_item(content_item)
for content_item in content
],
}
return item
@ -165,7 +170,9 @@ class VoyageMultimodalEmbeddingConfig(BaseEmbeddingConfig):
try:
raw_response_json = raw_response.json()
except Exception:
raise VoyageMultimodalEmbeddingError(message=raw_response.text, status_code=raw_response.status_code)
raise VoyageMultimodalEmbeddingError(
message=raw_response.text, status_code=raw_response.status_code
)
model_response.model = raw_response_json.get("model")
model_response.data = raw_response_json.get("data")
@ -182,4 +189,6 @@ class VoyageMultimodalEmbeddingConfig(BaseEmbeddingConfig):
def get_error_class(
self, error_message: str, status_code: int, headers: Union[dict, httpx.Headers]
) -> BaseLLMException:
return VoyageMultimodalEmbeddingError(message=error_message, status_code=status_code, headers=headers)
return VoyageMultimodalEmbeddingError(
message=error_message, status_code=status_code, headers=headers
)