Skip to content

[Bug]: Infinite credit spend in grounding_with_vais example #1925

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

Open
1 task done
xangelix opened this issue Apr 2, 2025 · 0 comments
Open
1 task done

[Bug]: Infinite credit spend in grounding_with_vais example #1925

xangelix opened this issue Apr 2, 2025 · 0 comments
Assignees

Comments

@xangelix
Copy link

xangelix commented Apr 2, 2025

File Name

gemini/grounding/grounding_with_vais.ipynb

What happened?

Infinite credit spend in one of two examples for the Vertex Search feature. Not a fun surprise.

This code is missing a break condition and encourages the end user to let it run unattended, which will result in an infinite loop of queries that incur costs.

"search_client = vais.SearchServiceClient(client_options=client_options)\n",
"\n",
"while True:\n",
" try:\n",
" search_client.search(\n",
" vais.SearchRequest(\n",
" serving_config=(\n",
" f\"projects/{PROJECT_ID}/locations/{VAIS_LOCATION}/collections/default_collection/engines/{engine_id}/servingConfigs/default_search\"\n",
" ),\n",
" query=\"Who is the CEO?\",\n",
" page_size=10,\n",
" )\n",
" )\n",
" except Exception:\n",
" time.sleep(10)"

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants