[Fix] Reformat /vertex_generate successful predictions (#33446)
Co-authored-by: Jimmy Shong <69131491+Jiminator@users.noreply.github.com>
This commit is contained in:
co-authored by
Jimmy Shong
parent
af7c62e337
commit
2c3ecf32f1
@@ -2041,8 +2041,10 @@ async def vertex_generate(
|
||||
**(vertex_req.parameters or {}),
|
||||
)
|
||||
ret = await generate_request(req, raw_request)
|
||||
if isinstance(ret, Response):
|
||||
return ret
|
||||
if isinstance(ret, Response) and ret.status_code == 200 and hasattr(ret, "body"):
|
||||
return ORJSONResponse({"predictions": orjson.loads(ret.body)})
|
||||
return ret
|
||||
|
||||
return ORJSONResponse({"predictions": ret})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user