Skip to content

Commit c4beca0

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
chore: GenAI Client(evals): Update agent scraping parallelism and update time sleep function in async function
PiperOrigin-RevId: 888778958
1 parent bc61708 commit c4beca0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vertexai/_genai/_evals_common.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
_thread_local_data = threading.local()
8585

8686
MAX_WORKERS = 100
87-
AGENT_MAX_WORKERS = 10
87+
AGENT_MAX_WORKERS = 20
8888
CONTENT = _evals_constant.CONTENT
8989
PARTS = _evals_constant.PARTS
9090
USER_AUTHOR = _evals_constant.USER_AUTHOR
@@ -2036,7 +2036,7 @@ async def _execute_local_agent_run_with_retry_async(
20362036
)
20372037
if attempt == max_retries - 1:
20382038
return {"error": f"Resource exhausted after retries: {e}"}
2039-
time.sleep(2**attempt)
2039+
await asyncio.sleep(2**attempt)
20402040
except Exception as e: # pylint: disable=broad-exception-caught
20412041
logger.error(
20422042
"Unexpected error during generate_content on attempt %d/%d: %s",
@@ -2047,7 +2047,7 @@ async def _execute_local_agent_run_with_retry_async(
20472047

20482048
if attempt == max_retries - 1:
20492049
return {"error": f"Failed after retries: {e}"}
2050-
time.sleep(1)
2050+
await asyncio.sleep(1)
20512051
return {"error": f"Failed to get agent run results after {max_retries} retries"}
20522052

20532053

0 commit comments

Comments
 (0)