mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
fix transform_retrieve_file_response
This commit is contained in:
parent
05552b5194
commit
08271a8b28
2 changed files with 7 additions and 4 deletions
|
|
@ -238,11 +238,13 @@ class GoogleAIStudioFilesHandler(GeminiModelInfo, BaseFilesConfig):
|
|||
|
||||
# Map Gemini state to OpenAI status
|
||||
gemini_state = response_json.get("state", "STATE_UNSPECIFIED")
|
||||
status: Literal["uploaded", "processed", "error"] = "uploaded" # Default
|
||||
# Explicitly type status as the Literal union
|
||||
if gemini_state == "ACTIVE":
|
||||
status = "processed"
|
||||
status: Literal["uploaded", "processed", "error"] = "processed"
|
||||
elif gemini_state == "FAILED":
|
||||
status = "error"
|
||||
else:
|
||||
status = "uploaded"
|
||||
|
||||
return OpenAIFileObject(
|
||||
id=response_json.get("uri", ""),
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class EventDrivenCacheCoordinator:
|
|||
verbose_proxy_logger.debug(
|
||||
"%s Signal received, reading from cache", self._log_prefix
|
||||
)
|
||||
value = await cache.async_get_cache(key=cache_key)
|
||||
value: Optional[T] = await cache.async_get_cache(key=cache_key)
|
||||
if value is not None and self._log_prefix:
|
||||
verbose_proxy_logger.debug(
|
||||
"%s Cache filled by other request, value: %s",
|
||||
|
|
@ -186,6 +186,7 @@ class EventDrivenCacheCoordinator:
|
|||
)
|
||||
|
||||
try:
|
||||
return await self._load_and_cache(cache_key, cache, load_fn)
|
||||
result = await self._load_and_cache(cache_key, cache, load_fn)
|
||||
return result
|
||||
finally:
|
||||
await self._signal_done()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue