File tree Expand file tree Collapse file tree 3 files changed +5
-8
lines changed
Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change 5151# Set web=True if you intend to serve a web interface, False otherwise
5252SERVE_WEB_INTERFACE = True
5353
54- logging .getLogger ("opentelemetry" ).setLevel (logging .DEBUG )
55-
56-
5754# [START opentelemetry_adk_otel_setup]
5855def 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 ,
Original file line number Diff line number Diff line change 4040You should always check if database for current session exist before running sql queries by calling create_database_tool.
4141If 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
4545that has full access to an ephemeral SQLite database. The database is initially empty. It is
4646built with the the LangGraph prebuilt **ReAct Agent** and the **SQLDatabaseToolkit**. Here are some samples you can try:
4747
6464root_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)
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ def create_database_tool(tool_context: ToolContext):
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" )
You can’t perform that action at this time.
0 commit comments