Repository navigation
Description
For some reason suddenly stops with:
Raw response:
{"candidates":[{"content":{},"finish_message":"Malformed function call: query = \"\"\"\nSELECT column_name\nFROM `wr_dataset.INFORMATION_SCHEMA.COLUMNS`\nWHERE table_name = 'order_items'\n\"\"\"\nresults = run_bigquery_query(query)\nprint(results)\n","finish_reason":"MALFORMED_FUNCTION_CALL"}],"create_time":"2025-04-09T21:36:06.627984Z","response_id":"Ruj2Z5CqJuGCqsMPxdPYoAY","model_version":"gemini-2.0-flash-exp","usage_metadata":{"prompt_token_count":4250,"prompt_tokens_details":[{"modality":"TEXT","token_count":4250}],"total_token_count":4250,"traffic_type":"ON_DEMAND"},"automatic_function_calling_history":[]}
the query is okay, but for some reason doesn't call the tool
even the log doesn't list the tool it failed
tools=[get_bigquery_table_ddl, run_bigquery_query, get_bigquery_view_ddl],
def get_bigquery_table_ddl(dataset_id: str, table_id: str) -> dict:
"""Retrieves the create table statement of a specified BigQuery table.
Args:
dataset_id: The ID of the BigQuery dataset.
table_id: The ID of the BigQuery table.
tool_context: ToolContext,
Returns:
A dictionary containing the DDL statement for the table, or an error message if the table is not found. The dictionary will have a "ddl" key if successful or an "error" key if not.
"""
try:
from google.cloud import bigquery
client = bigquery.Client()
ddl_query = f"""
SELECT ddl
FROM `{client.project}.{dataset_id}.INFORMATION_SCHEMA.TABLES`
WHERE table_name = '{table_id}'
"""
print(ddl_query)
ddl_result = client.query(ddl_query).result()
ddl_rows = list(ddl_result)
if ddl_rows:
ddl = ddl_rows[0].ddl
return {"ddl": ddl}
else:
return {"error": f"Table '{table_id}' not found in dataset '{dataset_id}'."}
except Exception as e:
return {"error": f"Error fetching table DDL: {str(e)}"}
Activity
hangfei commentedon Apr 9, 2025
Do you have an minimal example we can use to reproduce the error? It should include the models, instruction you use etc.
pentium10 commentedon Apr 10, 2025
I am monitoring this issue, today it went smooth. Maybe it was something with yesterday model's shifting behind aliases.
hangfei commentedon Apr 11, 2025
Glad it works now. Feel free to re-open if you still see the issue.
aicam commentedon Jun 3, 2025
I have the issue, @pentium10 any symptom or solution you found?
Merge pull request google#9 from Px8Studio:dev
demo(ca-governance): exact-shape acceptance gate for live-authored plans
docs(ca-governance): adopt the human-compiled-vs-model-authored punch…