File tree Expand file tree Collapse file tree 3 files changed +3
-6
lines changed
Expand file tree Collapse file tree 3 files changed +3
-6
lines changed Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- import logging
1615import google .auth
1716import google .auth .transport .requests
1817import grpc
@@ -97,6 +96,7 @@ def setup_opentelemetry() -> None:
9796
9897 # Load instrumentors
9998 SQLite3Instrumentor ().instrument ()
99+ # ADK uses Vertex AI and Google Gen AI SDKs.
100100 VertexAIInstrumentor ().instrument ()
101101 GoogleGenAiSdkInstrumentor ().instrument ()
102102
Original file line number Diff line number Diff line change 1717
1818import sqlite3
1919
20- from opentelemetry import trace
21-
22- # from utils import ask_prompt, console, print_markdown, render_messages
23-
24-
2520SYSTEM_PROMPT = f"""\
2621 You are a helpful AI assistant with a mastery of database design and querying. You have access
2722to an ephemeral sqlite3 database that you can query and modify through some tools. Help answer
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ class SqlRunResult(TypedDict):
3333 rows : NotRequired [list [tuple [str , ...]]]
3434 """The rows returned by the SQL query"""
3535
36+ # [START opentelemetry_adk_agent_span]
3637@tracer .start_as_current_span ("create_database" )
3738def create_database_tool (tool_context : ToolContext ) -> dict [str , Any ]:
3839 """Creates a temporary file in the /tmp directory to hold an ephemeral
@@ -46,6 +47,7 @@ def create_database_tool(tool_context: ToolContext) -> dict[str, Any]:
4647 tool_context .state [SESSION_DB_KEY ] = path
4748 return {"resp" : "Created an ephemeral database" }
4849 return {"resp" : f"Skipping database creation, { tool_context .state [SESSION_DB_KEY ]} already exists" }
50+ # [END opentelemetry_adk_agent_span]
4951
5052@tracer .start_as_current_span ("run_sql" )
5153def run_sql_tool (sql_query : str , tool_context : ToolContext ) -> dict [str , Any ]:
You can’t perform that action at this time.
0 commit comments