mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-16 23:41:43 +00:00
refactor(vertex): drop unused resolved_files from embed response parsing
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
e26a4970dd
commit
0c91d9157c
3 changed files with 1 additions and 16 deletions
|
|
@ -268,7 +268,6 @@ class GoogleBatchEmbeddings(VertexLLM):
|
|||
model_response=model_response,
|
||||
model=model,
|
||||
response_json=_json_response,
|
||||
resolved_files=resolved_files,
|
||||
)
|
||||
else:
|
||||
_predictions: Final = VertexAIBatchEmbeddingsResponseObject(**_json_response)
|
||||
|
|
@ -372,7 +371,6 @@ class GoogleBatchEmbeddings(VertexLLM):
|
|||
model_response=model_response,
|
||||
model=model,
|
||||
response_json=_json_response,
|
||||
resolved_files=resolved_files,
|
||||
)
|
||||
else:
|
||||
_predictions: Final = VertexAIBatchEmbeddingsResponseObject(**_json_response)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ Transformation logic from OpenAI /v1/embeddings format to Google AI Studio /batc
|
|||
Why separate file? Make it easy to see how transformation works
|
||||
"""
|
||||
|
||||
from collections.abc import Mapping, Sequence
|
||||
from collections.abc import Sequence
|
||||
from typing import Final
|
||||
|
||||
from pydantic import TypeAdapter, ValidationError
|
||||
|
|
@ -356,7 +356,6 @@ def process_embed_content_response(
|
|||
model_response: EmbeddingResponse,
|
||||
model: str,
|
||||
response_json: dict,
|
||||
resolved_files: Mapping[str, Mapping[str, str]] | None = None,
|
||||
) -> EmbeddingResponse:
|
||||
"""
|
||||
Process Gemini embedContent response (single embedding for multimodal input).
|
||||
|
|
|
|||
|
|
@ -411,12 +411,6 @@ class TestProcessEmbedContentResponseUsage:
|
|||
model_response=EmbeddingResponse(),
|
||||
model=self.MODEL,
|
||||
response_json=response_json,
|
||||
resolved_files={
|
||||
"files/img123": {
|
||||
"mime_type": "image/png",
|
||||
"uri": "https://example.com/img123",
|
||||
}
|
||||
},
|
||||
)
|
||||
assert result.usage.prompt_tokens_details.image_tokens == 258
|
||||
assert result.usage.prompt_tokens_details.text_tokens == 0
|
||||
|
|
@ -443,12 +437,6 @@ class TestProcessEmbedContentResponseUsage:
|
|||
model_response=EmbeddingResponse(),
|
||||
model=self.MODEL,
|
||||
response_json=response_json,
|
||||
resolved_files={
|
||||
"files/clip1": {
|
||||
"mime_type": "audio/mpeg",
|
||||
"uri": "https://example.com/clip1",
|
||||
}
|
||||
},
|
||||
)
|
||||
assert result.usage.prompt_tokens_details.audio_tokens == 64
|
||||
assert result.usage.prompt_tokens_details.image_tokens == 0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue