Properly return error response in vertex_generate HTTP endpoint (#5956)

This commit is contained in:
KCFindstr
2025-05-01 11:48:58 -07:00
committed by GitHub
parent 6fc175968c
commit d33955d28a
2 changed files with 12 additions and 0 deletions

View File

@@ -675,6 +675,8 @@ async def vertex_generate(vertex_req: VertexGenerateReqInput, raw_request: Reque
**(vertex_req.parameters or {}),
)
ret = await generate_request(req, raw_request)
if isinstance(ret, Response):
return ret
return ORJSONResponse({"predictions": ret})