Skip to content

Commit b06d473

Browse files
slilichenkokoverholtjoefernandez
authored
Fix the code sample of using BigQuery with the application default credentails (#825)
* Fix the code sample of using BigQuery with the application default credentails * Update bigquery.py --------- Co-authored-by: Kristopher Overholt <[email protected]> Co-authored-by: Joe Fernandez <[email protected]>
1 parent 8d46b7e commit b06d473

File tree

1 file changed

+3
-6
lines changed
  • examples/python/snippets/tools/built-in-tools

1 file changed

+3
-6
lines changed

examples/python/snippets/tools/built-in-tools/bigquery.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,10 @@
3434
# Define a tool configuration to block any write operations
3535
tool_config = BigQueryToolConfig(write_mode=WriteMode.BLOCKED)
3636

37-
# Define a credentials config - in this example we are using application default
38-
# credentials
37+
# Uses externally-managed Application Default Credentials (ADC) by default.
38+
# This decouples authentication from the agent / tool lifecycle.
3939
# https://cloud.google.com/docs/authentication/provide-credentials-adc
40-
application_default_credentials, _ = google.auth.default()
41-
credentials_config = BigQueryCredentialsConfig(
42-
credentials=application_default_credentials
43-
)
40+
credentials_config = BigQueryCredentialsConfig()
4441

4542
# Instantiate a BigQuery toolset
4643
bigquery_toolset = BigQueryToolset(

0 commit comments

Comments
 (0)