-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
28 lines (20 loc) · 939 Bytes
/
main.py
File metadata and controls
28 lines (20 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""Entry point for the BigQuery SQL Agent."""
import os
import warnings
import logging
# Suppress Google ADK experimental feature warnings
warnings.filterwarnings("ignore", message=r".*EXPERIMENTAL.*feature.*", category=UserWarning)
warnings.filterwarnings("ignore", message=r".*non-text parts.*", category=UserWarning)
warnings.filterwarnings("ignore", message=r".*GOOGLE_API_KEY.*GEMINI_API_KEY.*", category=UserWarning)
# Suppress Google SDK info/warning logs
logging.getLogger("google.genai").setLevel(logging.ERROR)
logging.getLogger("google.adk").setLevel(logging.ERROR)
from dotenv import load_dotenv
# Load environment variables from .env file
load_dotenv()
# Remove GEMINI_API_KEY if GOOGLE_API_KEY is set to avoid duplicate key warning
if os.environ.get("GOOGLE_API_KEY") and os.environ.get("GEMINI_API_KEY"):
del os.environ["GEMINI_API_KEY"]
from bigquery_agent.cli import main
if __name__ == "__main__":
main()