forked from trpc-group/trpc-agent-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtools.py
More file actions
22 lines (18 loc) · 780 Bytes
/
Copy pathtools.py
File metadata and controls
22 lines (18 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Tencent is pleased to support the open source community by making tRPC-Agent-Python available.
#
# Copyright (C) 2026 Tencent. All rights reserved.
#
# tRPC-Agent-Python is licensed under Apache-2.0.
""" Tools for the agent. """
from langchain_core.tools import tool
from trpc_agent_sdk.agents import langgraph_tool_node
@tool
@langgraph_tool_node
def execute_database_operation(operation: str, database: str, details: dict) -> str:
"""Execute a database operation that requires approval.
Args:
operation: The type of operation ('delete', 'update', 'create')
database: The database name
details: Additional operation details
"""
return f"Database operation '{operation}' on '{database}' executed successfully with details: {details}"