mirror of
https://github.com/EvolutionAPI/adk-python.git
synced 2025-12-19 03:42:22 -06:00
fix: adapt oauth calendar agent and bigquery agent to new Google API toolset interface
PiperOrigin-RevId: 759298612
This commit is contained in:
committed by
Copybara-Service
parent
4c6820e78c
commit
fccd17df6f
@@ -16,7 +16,7 @@ import os
|
||||
|
||||
from dotenv import load_dotenv
|
||||
from google.adk import Agent
|
||||
from google.adk.tools.google_api_tool import bigquery_toolset
|
||||
from google.adk.tools.google_api_tool import BigQueryToolset
|
||||
|
||||
# Load environment variables from .env file
|
||||
load_dotenv()
|
||||
@@ -24,8 +24,6 @@ load_dotenv()
|
||||
# Access the variable
|
||||
oauth_client_id = os.getenv("OAUTH_CLIENT_ID")
|
||||
oauth_client_secret = os.getenv("OAUTH_CLIENT_SECRET")
|
||||
bigquery_toolset.configure_auth(oauth_client_id, oauth_client_secret)
|
||||
|
||||
tools_to_expose = [
|
||||
"bigquery_datasets_list",
|
||||
"bigquery_datasets_get",
|
||||
@@ -34,8 +32,10 @@ tools_to_expose = [
|
||||
"bigquery_tables_get",
|
||||
"bigquery_tables_insert",
|
||||
]
|
||||
bigquery_toolset.set_tool_filter(
|
||||
lambda tool, ctx=None: tool.name in tools_to_expose
|
||||
bigquery_toolset = BigQueryToolset(
|
||||
client_id=oauth_client_id,
|
||||
client_secret=oauth_client_secret,
|
||||
tool_filter=tools_to_expose,
|
||||
)
|
||||
|
||||
root_agent = Agent(
|
||||
|
||||
Reference in New Issue
Block a user