feat: Add Bigquery detect_anomalies tool

This change introduces a new `detect_anomalies` tool in `query_tool.py` which uses BigQuery ML's `CREATE MODEL` with `ARIMA_PLUS` type and `ML.DETECT_ANOMALIES` to detect anomalies. The new function is also added to the `bigquery_toolset`.

PiperOrigin-RevId: 825181489
This commit is contained in:
Google Team Member
2025-10-28 13:30:04 -07:00
committed by Copybara-Service
parent 74d8361a7e
commit 9851340ad1
5 changed files with 350 additions and 1 deletions
@@ -41,7 +41,7 @@ async def test_bigquery_toolset_tools_default():
tools = await toolset.get_tools()
assert tools is not None
assert len(tools) == 8
assert len(tools) == 9
assert all([isinstance(tool, GoogleTool) for tool in tools])
expected_tool_names = set([
@@ -53,6 +53,7 @@ async def test_bigquery_toolset_tools_default():
"ask_data_insights",
"forecast",
"analyze_contribution",
"detect_anomalies",
])
actual_tool_names = set([tool.name for tool in tools])
assert actual_tool_names == expected_tool_names