Skip to content

Commit 1d57d90

Browse files
committed
Address feedback comments
1 parent e8ee448 commit 1d57d90

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

samples/adk-sql-agent/main.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@
5151
# Set web=True if you intend to serve a web interface, False otherwise
5252
SERVE_WEB_INTERFACE = True
5353

54-
logging.getLogger("opentelemetry").setLevel(logging.DEBUG)
55-
56-
5754
# [START opentelemetry_adk_otel_setup]
5855
def setup_opentelemetry() -> None:
5956
credentials, project_id = google.auth.default()
@@ -121,7 +118,7 @@ def main() -> None:
121118
# For this example this would be the current directory containing main.py.
122119
# Note: Calling this method attempts to set the global tracer provider, which has already been
123120
# set by the setup_opentelemetry() function.
124-
app: FastAPI = get_fast_api_app(
121+
app = get_fast_api_app(
125122
agents_dir=AGENT_DIR,
126123
session_service_uri=SESSION_DB_URL,
127124
allow_origins=ALLOWED_ORIGINS,

samples/adk-sql-agent/sql_agent/agent.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
You should always check if database for current session exist before running sql queries by calling create_database_tool.
4141
If you make a mistake, try to recover."""
4242

43-
INTRO_TEXT = """\
44-
Starting agent using ephemeral SQLite DB {dbpath}. This demo allows you to chat with an Agent
43+
DESCRIPTION = """\
44+
Starting agent using ephemeral SQLite DB. This demo allows you to chat with an Agent
4545
that has full access to an ephemeral SQLite database. The database is initially empty. It is
4646
built with the the LangGraph prebuilt **ReAct Agent** and the **SQLDatabaseToolkit**. Here are some samples you can try:
4747
@@ -64,7 +64,7 @@
6464
root_agent = Agent(
6565
name="weather_time_agent",
6666
model="gemini-2.0-flash",
67-
description=INTRO_TEXT,
67+
description=DESCRIPTION,
6868
instruction=SYSTEM_PROMPT,
6969
tools=[run_sql_tool, create_database_tool],
7070
)

samples/adk-sql-agent/sql_agent/tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ class SqlRunResult(TypedDict):
3434
"""The rows returned by the SQL query"""
3535

3636
@tracer.start_as_current_span("create_database")
37-
def create_database_tool(tool_context: ToolContext):
37+
def create_database_tool(tool_context: ToolContext) -> None:
3838
"""Creates a temporary file in the /tmp directory to hold an ephemeral
3939
sqlite3 database if a database is not found for the current session.
4040
"""
4141
if not SESSION_DB_KEY in tool_context.state:
4242
_, path = tempfile.mkstemp(suffix=".db")
4343
# No scope prefix in the state data indicates that it will be persisted for
4444
# current session.
45-
# See https://deepwiki.com/google/adk-python/3.4-state-management.
45+
# See https://google.github.io/adk-docs/sessions/state/.
4646
tool_context.state[SESSION_DB_KEY] = path
4747

4848
@tracer.start_as_current_span("run_sql")

0 commit comments

Comments
 (0)