From c4beca01ff5042704d522518b506af1499c773a7 Mon Sep 17 00:00:00 2001 From: A Vertex SDK engineer Date: Tue, 24 Mar 2026 11:45:05 -0700 Subject: [PATCH] chore: GenAI Client(evals): Update agent scraping parallelism and update time sleep function in async function PiperOrigin-RevId: 888778958 --- vertexai/_genai/_evals_common.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vertexai/_genai/_evals_common.py b/vertexai/_genai/_evals_common.py index 2c12de0193..2c77e2e692 100644 --- a/vertexai/_genai/_evals_common.py +++ b/vertexai/_genai/_evals_common.py @@ -84,7 +84,7 @@ _thread_local_data = threading.local() MAX_WORKERS = 100 -AGENT_MAX_WORKERS = 10 +AGENT_MAX_WORKERS = 20 CONTENT = _evals_constant.CONTENT PARTS = _evals_constant.PARTS USER_AUTHOR = _evals_constant.USER_AUTHOR @@ -2036,7 +2036,7 @@ async def _execute_local_agent_run_with_retry_async( ) if attempt == max_retries - 1: return {"error": f"Resource exhausted after retries: {e}"} - time.sleep(2**attempt) + await asyncio.sleep(2**attempt) except Exception as e: # pylint: disable=broad-exception-caught logger.error( "Unexpected error during generate_content on attempt %d/%d: %s", @@ -2047,7 +2047,7 @@ async def _execute_local_agent_run_with_retry_async( if attempt == max_retries - 1: return {"error": f"Failed after retries: {e}"} - time.sleep(1) + await asyncio.sleep(1) return {"error": f"Failed to get agent run results after {max_retries} retries"}