One of my agents got this error
InvalidArgument(‘Request payload size exceeds the limit: 20971520 bytes.’)
google.api_core.exceptions.InvalidArgument: 400 Request payload size exceeds the limit: 20971520 bytes.
But when i checked the file size it was only 32kb. Is this related to rate limits? Because the payload was nowhere near the limit.
whats the best way to monitor these api calls and get the data for each call?
this was my api config when i got the error
generation_config = {
“temperature”: 0.5,
“top_p”: 0.95,
“top_k”: 64,
“max_output_tokens”: 8192,
“response_mime_type”: “application/json”,
}
safety_settings = [
{
“category”: “HARM_CATEGORY_HARASSMENT”,
“threshold”: “BLOCK_NONE”,
},
{
“category”: “HARM_CATEGORY_HATE_SPEECH”,
“threshold”: “BLOCK_NONE”,
},
{
“category”: “HARM_CATEGORY_SEXUALLY_EXPLICIT”,
“threshold”: “BLOCK_NONE”,
},
{
“category”: “HARM_CATEGORY_DANGEROUS_CONTENT”,
“threshold”: “BLOCK_NONE”,
},
]
model = genai.GenerativeModel(
model_name="gemini-1.5-pro-latest",