Skip to content

Commit 507424a

Browse files
lipinskixuanyang15
authored andcommitted
feat: Add location for table in agent events in plugin BigQueryAgentAnalytics
Merge #3784 Co-authored-by: Xuan Yang <xygoogle@google.com> COPYBARA_INTEGRATE_REVIEW=#3784 from lipinski:fix/add-location-to-bigqueryagentanalytics 8d88b2c PiperOrigin-RevId: 839980070
1 parent 92821b8 commit 507424a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/google/adk/plugins/bigquery_agent_analytics_plugin.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ def __init__(
321321
dataset_id: str,
322322
table_id: str = "agent_events",
323323
config: Optional[BigQueryLoggerConfig] = None,
324+
location: str = "US",
324325
**kwargs,
325326
):
326327
"""Initializes the BigQueryAgentAnalyticsPlugin.
@@ -338,6 +339,7 @@ def __init__(
338339
dataset_id,
339340
table_id,
340341
)
342+
self._location = location
341343
self._config = config if config else BigQueryLoggerConfig()
342344
self._bq_client: bigquery.Client | None = None
343345
self._write_client: BigQueryWriteAsyncClient | None = None
@@ -458,7 +460,10 @@ async def _ensure_init(self):
458460
user_agent=f"google-adk-bq-logger/{version.__version__}"
459461
)
460462
self._bq_client = bigquery.Client(
461-
project=self._project_id, credentials=creds, client_info=client_info
463+
project=self._project_id,
464+
credentials=creds,
465+
client_info=client_info,
466+
location=self._location,
462467
)
463468

464469
# Ensure table exists (sync call in thread)

0 commit comments

Comments
 (0)