-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BatchPrediction 400: Invalid JSON payload received. Unknown name \"type_\" at 'generation_config.response_schema #4333
Comments
@jaycee-li Can you check whether the schema proto is correctly serialized to JSON via Or could this be caused by bugs in the code that handles proto fields renamed by the GAPIC generator? |
Hi @orenmiaraswish, It seems like the issue lies in the format of your Bigquery input. Bigquery expects requests in JSON format, whereas your input is currently a raw proto message. The key difference is that To resolve your issue, you'll need to modify your Bigquery input by changing |
@jaycee-li thanks for your replay. The BigQuery Input is actually a JSON, though it was originated from Original Code:...
@staticmethod
def raw_to_json(request_id, prompt, instructions, generation_config):
if isinstance(generation_config, GenerationConfig):
generation_config = generation_config.to_dict()
request = {
"contents": [{"role": "user", "parts": {"text": prompt}}],
"system_instruction": {"parts": [{"text": f"{instructions}"}]},
"safety_settings": batch_request_safety_settings,
"generation_config": generation_config,
}
return {"id": request_id, "request": json.dumps(request)}
... |
I think we are getting a variant of the same response when using the Python SDK. Using the Vertex AI Studio with The However after correcting the proffered code our
This produces the following error:
|
Following up on our previous comment above We were able to run this successfully by replacing all references to This
|
Hi @ItsOkayItsOfficial , thanks for raising this issue! This is a bug and I'm fixing it. Both |
Problem:
400 Error message With Vertex BatchPrediction API with gemini-1.5-flash-001 and gemini-1.5-pro-001
I am getting similar issues using Batch Prediction with gemini-1.5-flash-001 and gemini-1.5-pro-001.
When not using Vertex BatchPrediction API the code at the (Expected output) works.
followed the documentation here:
Environment details
Steps to reproduce:
Code example
Stack trace: (BigQuery - Output)
Expected Results Example:
BigQuery Output table Response column filled with the adequate JSON output.
The text was updated successfully, but these errors were encountered: