Data Upload
track_messages
Functions for tracking LLM message interactions
The track_messages
functions allow you to track message interactions with language models. They must be used within methods decorated with trace_event
decorators.
They come in two variants:
track_messages_sync
for synchronous operationstrack_messages_async
for asynchronous operations
Requirements
- Must be used within methods decorated with
trace_event
- The containing class must define:
system_name
: A string identifying the type of agent (e.g., “Math_Agent”, “Translation_Agent”)system_instance_id
: A UUID string identifying a specific instance of the agent
Parameters
input_messages
(List[Dict], required): List of input messages in the conversationoutput_messages
(List[Dict], required): List of output/response messages from the modelmodel_name
(str, required): Name of the language model usedmodel_params
(Dict, optional): Parameters used for the model call (e.g., temperature, max_tokens)
Usage Example
Here’s an example showing the required usage with trace_event
: