[Fix] Reformat /vertex_generate successful predictions (#33446)

Co-authored-by: Jimmy Shong <69131491+Jiminator@users.noreply.github.com>
This commit is contained in:
Dustin Luong
2026-08-07 00:00:48 +00:00
committed by GitHub
co-authored by Jimmy Shong
parent af7c62e337
commit 2c3ecf32f1
+4 -2
View File
@@ -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})