Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

AI Data Agent with Gemini API

I copied the code from this project
https://github.com/GoogleCloudPlatform/generative-ai/blob/main/gemini/function-calling/sql-talk-app


And everything worked fine

When I tried to create my own dataset and tables (in the same BigQuery) suddenly the chat doesn't know how to answer.
This is what he answers me:
I'm sorry, I can't answer this question. The available tool code does not provide access to database schemas or names.

Anyone have an idea?

0 1 362
1 REPLY 1

Hi @moshe28,

Welcome to Google Cloud Community!

It seems like you're facing an issue where the chatbot you're working with is unable to access your custom BigQuery dataset and tables after creating them. The error message, "I can't answer this question. The available tool code does not provide access to database schemas or names," suggests that the function or code responsible for querying the BigQuery database is unable to discover or access the new tables or datasets.

Here are a few things you can check or try to resolve this issue:

  1. Permissions: Ensure the service account or user has the necessary BigQuery permissions (roles/bigquery.dataViewer or roles/bigquery.user) for the new datasets.
  2. Schema Discovery: Verify the code can access the new dataset and tables. Ensure they are included in any hardcoded or dynamically fetched schema lists.
  3. Visibility: Check that the new dataset is in the same project/environment as the original tables and is visible to the chatbot.
  4. SQL Queries: Ensure that the queries or functions in the code dynamically reference the new tables and schemas.
  5. Logs: Look at logs for detailed error messages to pinpoint where the failure occurs.
  6. BigQuery Client Configuration: Make sure the BigQuery client is configured to access the correct project and dataset.

Here are some additional resources that might be helpful:

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.