mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-11 08:38:24 +00:00
style(voyage): reformat multimodal embedding transformation at 120 width
The previous formatting pass collapsed the file at the old 88-column width, but CI now runs ruff format at 120 columns, so the format check kept failing. Reformat the file so call expressions and comprehensions stay on a single line where they fit.
This commit is contained in:
parent
315ba0e613
commit
0250c8fe6a
1 changed files with 4 additions and 13 deletions
|
|
@ -27,9 +27,7 @@ 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,
|
||||
|
|
@ -135,10 +133,7 @@ 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
|
||||
|
||||
|
|
@ -170,9 +165,7 @@ 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")
|
||||
|
|
@ -189,6 +182,4 @@ 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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue