mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
[Fix] Use type:ignore instead of Union return type for realtime endpoint
The Union[RealtimeClientSecretResponse, Response] annotation breaks FastAPI's response model generation. Revert to the original annotation and suppress mypy on the error-path return instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
57397e0d26
commit
a6ab172db0
1 changed files with 3 additions and 3 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import json
|
||||
import time
|
||||
from typing import Any, Dict, Optional, Union
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
from fastapi import APIRouter, Depends, HTTPException, Request, Response
|
||||
|
|
@ -89,7 +89,7 @@ async def create_realtime_client_secret(
|
|||
request: Request,
|
||||
fastapi_response: Response,
|
||||
user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
|
||||
) -> Union[RealtimeClientSecretResponse, Response]:
|
||||
) -> RealtimeClientSecretResponse:
|
||||
from litellm.proxy.proxy_server import (
|
||||
add_litellm_data_to_request,
|
||||
general_settings,
|
||||
|
|
@ -181,7 +181,7 @@ async def create_realtime_client_secret(
|
|||
upstream_resp.status_code,
|
||||
upstream_resp.text,
|
||||
)
|
||||
return Response(
|
||||
return Response( # type: ignore[return-value]
|
||||
content=upstream_resp.content,
|
||||
status_code=upstream_resp.status_code,
|
||||
media_type="application/json",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue