Skip to content

Util

time_iso

time_iso() -> str

Returns the current time in ISO 8601 format.

Source code in src/agents/tracing/util.py
5
6
7
def time_iso() -> str:
    """Returns the current time in ISO 8601 format."""
    return datetime.now(timezone.utc).isoformat()

gen_trace_id

gen_trace_id() -> str

Generates a new trace ID.

Source code in src/agents/tracing/util.py
def gen_trace_id() -> str:
    """Generates a new trace ID."""
    return f"trace_{uuid.uuid4().hex}"

gen_span_id

gen_span_id() -> str

Generates a new span ID.

Source code in src/agents/tracing/util.py
def gen_span_id() -> str:
    """Generates a new span ID."""
    return f"span_{uuid.uuid4().hex[:24]}"