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
main.py
from deepeval.tracing import observe, update_current_trace
from openai import OpenAI
client = OpenAI()
@observe(type="agent")
def llm_app(query: str):
update_current_trace(tags=["Causal Chit-Chat"])
return client.chat.completions.create(
model="gpt-4o",
messages=[
{"role": "user", "content": query}
]
).choices[0].message.content
llm_app("Write me a poem.")
Last updated on