For most parts, gemini 2.5 flash 04-17 and 05-20 works great.
However, I noticed that it keeps tripping on certain requests (500 error). I have a retry mechanism that retries for 20 times with up to 10 mins backoff in between, but the request still returns a 500 error..
When I try this request hours later, it works. Maybe the error is being cached?
Here’s the config and contents passed to generateContent:
"function_kwargs": {
"config": {
"tool_config": {
"function_calling_config": {
"mode": "ANY"
}
},
"system_instruction": "You are a helpful research assistant.\nYour job is to help the user research the likely model(s) of a product that a redditor mentioned, and return comprehensive details about the model(s), if applicable.\n<tool_use_guidelines>\n- If initial search results are insufficient, reformulate queries and use the search_web tool again to obtain new and better results.\n- Complex search queries should be broken down into simpler queries for better results.\n- Where appropriate, cross check information across multiple sources to make sure your answer is accurate (giving more weight to official / authoritative sources).\n- If you have problems getting product information from official brand pages, try getting information from amazon, walmart, bestbuy, homedepot, lowes instead.\n- Use the complete_task tool when you think enough evidence and information has been gathered to the best of your abilities to answer the user accurately.\n</tool_use_guidelines>\n",
"temperature": 0,
"tools": [
{
"function_declarations": [
{
"description": "Visit a website from the search results to get more information.",
"name": "read_website",
"parameters": {
"type": "OBJECT",
"properties": {
"url": {
"type": "STRING",
"description": "The url of the website to visit"
},
"goal": {
"description": "The goal of visting the website. Give detailed instructions of what to look for.Be specific and clear.",
"type": "STRING"
}
},
"required": [
"url",
"goal"
]
}
},
{
"description": "Search the web for information",
"name": "search_web",
"parameters": {
"required": [
"search_query"
],
"properties": {
"search_query": {
"type": "STRING",
"description": "The query to search the web for"
}
},
"type": "OBJECT"
}
},
{
"name": "complete_task",
"parameters": {
"required": [
"reflections",
"knowledge_gaps",
"is_research_complete",
"is_product_type_mismatch",
"is_model_info_cannot_be_found"
],
"type": "OBJECT",
"properties": {
"product_models": {
"items": {
"type": "OBJECT",
"properties": {
"summary": {
"type": "STRING",
"description": "1 paragraph description of the product model. Include product model codes if available. If there are multiple codes, list them and trail off with an 'etc' (e.g. '123A, 456B, etc.'). State only factual, concrete specs & features without any vague or subjective words or phrases (e.g. high performance). Highlight how the model is different from other models (especially if names are similar) from the same brand."
},
"key_features": {
"items": {
"type": "STRING"
},
"description": "A list of key features of the product model. State only factual, concrete features without any vague or subjective words or phrases (e.g. high performance). Exclude details that may not be specific to the model (e.g. warranty, shipping etc).",
"type": "ARRAY"
},
"key_specs": {
"description": "A list of key specs of the product model. State only factual, concrete specs without any vague or subjective words or phrases (e.g. high performance). Exclude details that may not be specific to the model (e.g. warranty, shipping etc).",
"type": "ARRAY",
"items": {
"type": "STRING"
}
},
"urls": {
"description": "A list of product page / shop listing urls of the product model.",
"items": {
"type": "STRING"
},
"type": "ARRAY"
},
"name": {
"type": "STRING",
"description": "The name of the product model. Do not include the brand here. If model codes are available and are an integral part of the model name, include them here."
},
"brand": {
"description": "The brand of the product model. If there are multiple brands for the same model, return 'Multiple Brands - Brand 1, Brand 2, etc.'",
"type": "STRING"
}
},
"required": [
"name",
"brand",
"summary",
"key_features",
"key_specs",
"urls"
]
},
"type": "ARRAY",
"description": "The list of product model(s) matching the one provided by the user, if the research is complete and comprehensive product information of product model(s) matching the user provided product model has been found."
},
"reflections": {
"description": "Reflections on the research and findings so far. Deeply think through what has been attempted and what has been found to determine if the research is complete enough to end the research loop.",
"type": "STRING"
},
"knowledge_gaps": {
"description": "Up to 3 knowledge gaps that need to be addressed in sequence in order to continue with research - these should be relevant to the original query. If no knowledge gaps are identified, return an empty string.",
"type": "STRING"
},
"is_product_type_mismatch": {
"type": "BOOLEAN",
"description": "True if the user provided product model does not belong to the specified product type. False otherwise."
},
"is_model_info_cannot_be_found": {
"type": "BOOLEAN",
"description": "True if you've tried multiple ways to find the comprehensive information about the user provided product model but the information is unavailable. False otherwise."
},
"is_research_complete": {
"type": "BOOLEAN",
"description": "True if the research and findings are complete enough to end the research loop. False if research is incomplete, or if the product type is mismatched, or if comprehensive product model info cannot be found."
}
}
},
"description": "Determines if the research is complete enough to end the research loop."
}
]
}
]
},
"contents": [
{
"parts": [
{
"text": "A redditor referred to a Ultrawide monitor (21:9 or wider) as \"hp x34 ultrawide monitor\".\nResearch and identify the Ultrawide monitor (21:9 or wider) model(s) that the redditor was most likely referring to.\n\nFor each likely model, get the following information:\n- Name\n- Brand\n- Summary\n- Key features\n- Key specs\n- Product page / shop listing urls\n\n<important_notes>\n- Only return models if comprehensive information about their features and specs could be found.\n- Return no more than 3 models. If there are more than 3 possible models, return the 3 most likely ones. If all are equally likely, return the 3 with the most information.\n- You MUST ensure that returned models are distinct. Minor variants should not be returned as distinct models. See the ensuring_distinct_models section below for more details.\n- If redditor is most likely not referring to a Ultrawide monitor (21:9 or wider) but some other product type, use the complete_task tool to report so.\n- If you cannot find any Ultrawide monitor (21:9 or wider) models that is likely to be the one that the redditor was referring to, use the complete_task tool to report so.\n- If you have already tried very hard to find comprehensive information about the Ultrawide monitor (21:9 or wider) model(s) but the information is unavailable, use the complete_task tool to report so.\n</important_notes>\n\n<ensuring_distinct_models>\n- Compare the model name, code (if available), core features and key specs to determine if they are essentially the same core model.\n- Minor variants should not be returned as distinct models. (e.g. color, bundles, geographic variants, minor differences between generations likely inconsequential to a buyer's decision, etc.)\n- If there are conflicts in key attributes (e.g. capacity, wireless vs wired, etc.), consider them to be distinct models.\n- Consider that sometimes the model code for the same core model can be different due to geographic or other trivial differences such as color or bundles.\n- If you are unsure, try searching the web for a comparison.\n</ensuring_distinct_models>\n"
}
],
"role": "user"
},
{
"parts": [
{
"function_call": {
"args": {
"search_query": "HP x34 ultrawide monitor"
},
"name": "search_web"
}
}
],
"role": "model"
},
{
"role": "user",
"parts": [
{
"function_response": {
"name": "search_web",
"response": {
"result": "<search_results query='HP x34 ultrawide monitor'>\nRank: 1\nTitle: HP X34 UWQHD Gaming Monitor | HP® Support\nURL: https://support.hp.com/us-en/product/details/hp-x34-uwqhd-gaming-monitor/2100695852\nSnippet: Find support and troubleshooting info including software, drivers, specs, and manuals for your HP X34 UWQHD Gaming Monitor.\n\nRank: 2\nTitle: HP 34-inch QHD Ultra Wide 1440p IPS 165Hz ... - Amazon.com\nURL: https://www.amazon.com/HP-34-inch-Monitor-Eyesafe-X34/dp/B098YZ161P\nSnippet: HP 34-inch QHD Ultra Wide 1440p IPS 165Hz UWQHD HDR Gaming Monitor, Eyesafe (X34, black) · 27”. $159.00$159.00. Only 5 left in stock - order soon. · 27” Curved ...\n\nRank: 3\nTitle: Hp x34. Heard it's good for gaming, but is it good for anything else ...\nURL: https://www.reddit.com/r/ultrawidemasterrace/comments/w8cadv/hp_x34_heard_its_good_for_gaming_but_is_it_good/\nSnippet: Jul 26, 2022 ... Absolutely brilliant monitor. Great colours and hdr is serviceable (not mind-blowing or even good but it does add some improvement) and my only ...\n\nRank: 4\nTitle: HP X34 Review 2025: Affordable IPS UltraWide Gaming Monitor\nURL: https://www.displayninja.com/hp-x34-review/\nSnippet: May 20, 2024 ... The HP X34 is an excellent 34′′ 3440×1440 165Hz IPS ultrawide monitor for gaming, work and everyday use.\n\nRank: 5\nTitle: [MONITOR] HP X34 34\" 3440x1440 IPS 165Hz HDR Gaming ...\nURL: https://www.reddit.com/r/buildapcsales/comments/yredoy/monitor_hp_x34_34_3440x1440_ips_165hz_hdr_gaming/\nSnippet: Nov 10, 2022 ... [MONITOR] HP X34 34\" 3440x1440 IPS 165Hz HDR Gaming Monitor (FLAT PANEL) - $349.99 ($459.99 - $110.00) ... Archived post. New comments cannot be ...\n\n</search_results>"
}
}
}
]
},
{
"parts": [
{
"function_call": {
"args": {
"goal": "Gather comprehensive specifications, features, and a summary for the HP X34 UWQHD Gaming Monitor.",
"url": "https://support.hp.com/us-en/product/details/hp-x34-uwqhd-gaming-monitor/2100695852"
},
"name": "read_website"
}
}
],
"role": "model"
},
{
"parts": [
{
"function_response": {
"response": {
"result": "This page is the official HP support page for the HP X34 UWQHD Gaming Monitor. It provides access to support and troubleshooting information, including software, drivers, specifications, and manuals. Key information available includes:\n\nProduct Name: HP X34 UWQHD Gaming Monitor\n\nSupport Categories:\n- Troubleshooting\n- Security & Viruses\n- Software & Drivers\n- Setup & User Guides\n- Product Specifications\n- Account & Registration\n- Warranty & Repair\n- Tools & Diagnostics\n- Promotions & deals\n\nPartial Product Specifications listed on the page:\n- Display size (diagonal): 34\"\n- Aspect ratio: 21:9\n- Resolution (native): UWQHD (3440 x 1440)\n- Resolutions supported: 640 x 480; 720 x 400; 800 x 600; 1024 x 768; 1280 x 720; 1280 x 800; 1280 x 1024; 1440 x 900; 1600 x 900; 1680 x 1050; 1920 x 1080; 2560 x 1440; 3440 x 1440\n- Pixel pitch: 0.233 mm\n- Brightness: 400 nits\n\nOther features mentioned:\n- Option to enter serial/product number to check warranty status.\n- Bulletins and Alerts section (states \"No alerts present\").\n- Support options: Contact us, Communities.\n- Promotions & deals section showing related products/services.\n\nTo get more comprehensive specifications, features, and details, you should visit the links provided for the specific support categories, particularly the 'Product Specifications' link: https://support.hp.com/us-en/product/product-specs/hp-x34-uwqhd-gaming-monitor/2100695852. Other relevant links include Software & Drivers (https://support.hp.com/us-en/drivers/hp-x34-uwqhd-gaming-monitor/2100695852) and Setup & User Guides (https://support.hp.com/us-en/product/setup-user-guides/hp-x34-uwqhd-gaming-monitor/2100695852)."
},
"name": "read_website"
}
}
],
"role": "user"
},
{
"role": "model",
"parts": [
{
"function_call": {
"args": {
"goal": "Gather comprehensive specifications and features for the HP X34 UWQHD Gaming Monitor from the official HP product specifications page.",
"url": "https://support.hp.com/us-en/product/product-specs/hp-x34-uwqhd-gaming-monitor/2100695852"
},
"name": "read_website"
}
}
]
},
{
"parts": [
{
"function_response": {
"name": "read_website",
"response": {
"result": "The page provides specifications for the HP X34 UWQHD Gaming Monitor. Listed specifications include:\n- Display size (diagonal): 34\"\n- Aspect ratio: 21:9\n- Resolution (native): UWQHD (3440 x 1440)\n- Resolutions supported: 640 x 480; 720 x 400; 800 x 600; 1024 x 768; 1280 x 720; 1280 x 800; 1280 x 1024; 1440 x 900; 1600 x 900; 1680 x 1050; 1920 x 1080; 2560 x 1440; 3440 x 1440\n- Pixel pitch: 0.233 mm\n- Brightness: 400 nits\n\nThe page also links to related documents and videos, including sections for \"Compatibility & Availability (7)\" and \"Product information (5)\", which likely contain more comprehensive details. A link to \"View full specifications\" is also present."
}
}
}
],
"role": "user"
}
],
"model": "gemini-2.5-flash-preview-04-17"
},