mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-16 16:24:49 +00:00
fix: replace assert with RuntimeError and fix return type annotation
- a2a_protocol/main.py: replace bare assert with descriptive RuntimeError in _execute_a2a_send_with_retry so retry exhaustion gives a clear message - fine_tuning/main.py: fix _resolve_fine_tuning_timeout return type from float to Union[float, httpx.Timeout] to accurately reflect the passthrough path Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
b3bbcd3955
commit
0133d11eb2
@@ -198,7 +198,10 @@ async def _execute_a2a_send_with_retry(
|
||||
continue
|
||||
except Exception:
|
||||
raise
|
||||
assert a2a_response is not None
|
||||
if a2a_response is None:
|
||||
raise RuntimeError(
|
||||
"A2A send_message failed: no response received after retry attempts."
|
||||
)
|
||||
return a2a_response
|
||||
|
||||
|
||||
|
||||
@@ -129,13 +129,13 @@ async def acreate_fine_tuning_job(
|
||||
def _resolve_fine_tuning_timeout(
|
||||
timeout: Any,
|
||||
custom_llm_provider: str,
|
||||
) -> float:
|
||||
) -> Union[float, httpx.Timeout]:
|
||||
"""Normalise a raw timeout value to a float (seconds) for fine-tuning calls."""
|
||||
timeout = timeout or 600.0
|
||||
if isinstance(timeout, httpx.Timeout):
|
||||
if not supports_httpx_timeout(custom_llm_provider):
|
||||
return float(timeout.read or 600)
|
||||
return timeout # type: ignore[return-value]
|
||||
return timeout
|
||||
return float(timeout)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user