Tags
Unlike metadata
, which can contain complex structured data, tags are simple string labels that make it easy to group related traces together, and cannot be applied to spans.
Tags provide a simple way to categorize and filter your traces in Confident’s observatory.
Add Tags to Traces
Tags are applied at the trace level, making them visible for all spans within that trace.
Python
from deepeval.tracing import observe, update_current_trace
import openai
@observe(type="agent")
def llm_app(query: str):
update_current_trace(tags=["Causal Chit-Chat"])
return openai.ChatCompletion.create(
model="gpt-4o",
messages=[
{"role": "user", "content": query}
]
).choices[0].message["content"]
llm_app("Write me a poem.")
Last updated on