TraceHelper
Utility helpers for building Langfuse-compatible trace event JSON objects.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
TraceHelper.type
Members list
Value members
Concrete methods
Creates a Langfuse-compatible trace event JSON object for a single conversation message.
Creates a Langfuse-compatible trace event JSON object for a single conversation message.
Value parameters
- contextMessages
-
preceding messages in the conversation, used to resolve tool-call names
- idx
-
sequential index of the event within the trace
- message
-
the conversation message to record (user, system, assistant, or tool)
- modelName
-
name of the LLM model used for generation events
- now
-
ISO-8601 timestamp string representing the event time
- traceId
-
identifier of the parent trace this event belongs to
- uuid
-
unique identifier for the event envelope
Attributes
- Returns
-
a
ujson.Objrepresenting the typed trace event for the given message
Builds a generic trace-event JSON wrapper object, optionally including an output field.
Builds a generic trace-event JSON wrapper object, optionally including an output field.
Value parameters
- eventType
-
Langfuse event type string (e.g.
"event-create","span-create") - idx
-
sequential index of the event within the trace
- input
-
JSON object describing the event input payload
- meta
-
JSON object carrying metadata for the event body
- now
-
ISO-8601 timestamp string representing the event time
- output
-
optional JSON object describing the event output; omitted from body when
None - traceId
-
identifier of the parent trace this event belongs to
- uuid
-
unique identifier for the envelope event
Attributes
- Returns
-
a
ujson.Objrepresenting the complete trace event envelope