Skip to content

Commit aa82162

Browse files
committed
apidocs
1 parent 989e0be commit aa82162

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

sentry_sdk/tracing.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,20 +1401,25 @@ def trace(
14011401
import sentry_sdk
14021402
from sentry_sdk.consts import OP, SPANTEMPLATE
14031403
1404-
# Simple usage with default template
1404+
# Simple usage with default values
14051405
@sentry_sdk.trace
14061406
def process_data():
14071407
# Function implementation
14081408
pass
14091409
14101410
# With custom parameters
14111411
@sentry_sdk.trace(
1412-
template=SPANTEMPLATE.AI_CHAT,
1413-
op=OP.GEN_AI_CHAT,
1414-
name="user_chat_completion",
1415-
attributes={"model": "gpt-4", "temperature": 0.7}
1412+
op=OP.DB_QUERY,
1413+
name="Get user data",
1414+
attributes={"postgres": True}
14161415
)
1417-
def generate_response(prompt):
1416+
def make_db_query(sql):
1417+
# Function implementation
1418+
pass
1419+
1420+
# With a custom template
1421+
@sentry_sdk.trace(template=SPANTEMPLATE.AI_TOOL)
1422+
def calculate_interest_rate(amount, rate, years):
14181423
# Function implementation
14191424
pass
14201425
"""

0 commit comments

Comments
 (0)