This page requires Python familiarity. It covers accessing conversation history from Python functions.
conv.history attribute contains a chronological list of UserInput and AgentResponse objects representing the conversation so far.
Filter events with
isinstance() rather than event.role — new event types may be added that don’t have a role attribute.UserInput
Represents a user turn in the conversation.
Properties
Methods
AgentResponse
Represents an agent turn in the conversation.
Properties
Methods
Example: format history for logging
Example: get last user message
Notes
- Empty
textvalues:UserInput.textcan be an empty string (e.g., when a user is silent or no speech is detected). Guard against this in your functions if downstream logic depends on non-empty input:
- Metric events: Metric data is not part of
conv.history. Custom metrics are written separately viaconv.write_metric.
See also
convobject – full list of conversation methods and attributes.

