Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7d3be849d9 |
@@ -33,6 +33,9 @@ log = logging.getLogger(__file__)
|
|||||||
async def generate_client_response(
|
async def generate_client_response(
|
||||||
client_request: web.Request, model_response: ClientResponse
|
client_request: web.Request, model_response: ClientResponse
|
||||||
) -> Union[web.Response, web.StreamResponse]:
|
) -> Union[web.Response, web.StreamResponse]:
|
||||||
|
match model_response.status:
|
||||||
|
case 200:
|
||||||
|
log.debug("SUCCESS")
|
||||||
# Check if the response is actually streaming based on response headers/content-type
|
# Check if the response is actually streaming based on response headers/content-type
|
||||||
is_streaming_response = (
|
is_streaming_response = (
|
||||||
model_response.content_type == "text/event-stream"
|
model_response.content_type == "text/event-stream"
|
||||||
@@ -59,6 +62,9 @@ async def generate_client_response(
|
|||||||
status=model_response.status,
|
status=model_response.status,
|
||||||
content_type=model_response.content_type
|
content_type=model_response.content_type
|
||||||
)
|
)
|
||||||
|
case code:
|
||||||
|
log.debug(f"Model responded with error {code}")
|
||||||
|
return web.Response(status=code)
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass
|
@dataclasses.dataclass
|
||||||
|
|||||||
Reference in New Issue
Block a user