Introduction
User feedback is a crucial part of understanding user experience and intent. It helps you identify areas for improvement and make informed decisions to enhance your application’s performance and user satisfaction.Prerequisites
You have already set tracing for your code as described in our quickstart guide.Setting
You can set on both the trace level or the span level. If the applies to the entire trace, then set it on the trace level. If the applies to a specific span, then set it on the span level. For more details, refer to the enrich traces documentation.In Python, you can use the
enrich_session
function to set on the trace level.To pass to HoneyHive, pass it to the param in the enrich_session
function. This function is used to enrich the session with additional information. Remember that enrich_session
will update, not overwrite, the existing object on the trace.Read more about the enrich_session
function in the Python SDK reference.Here’s an example of how to set on the trace level in Python:Python
When collecting user feedback in applications with separate frontend and backend components, you must propagate the sessionId to ensure feedback is associated with the correct trace:
- In your frontend service, obtain the sessionId using
HoneyHiveTracer.session_id
- Pass this sessionId to your backend service when submitting feedback (via headers or request body)
- In your backend service, use
HoneyHiveTracer.init(session_id = <session-id>)
with the received sessionId - Then call
enrich_session()
orenrich_span()
with your feedback data
Concepts
What is User Feedback?
Any feedback that the end-user provides about their experience is considereduser feedback
. This can be of two types:
- Explicit Feedback: Any feedback provided by the user explicitly in your app. Examples include 👍/👎, ratings (1-n), etc.
- Implicit Feedback: Any actions within your app’s UI by your user that may indicate user experience and intent. Examples include clicking
Copy
,Regenerate
, etc.
User Feedback vs Human Evaluator: User feedback field is used to track feedback provided by your end-users. Feedback from domain experts or other internal team members is considered a human evaluator in HoneyHive and is tracked on the
metrics
field.Return Types
We accept all primary return types as user feedback. This includes:Return Type | Available Measurements | Notes |
---|---|---|
Boolean | True/False | |
Number | Percentage, Sum, Avg, Median, Min, Max, P95, P98, P99 | |
String | Any string value | Used for filters and group by |
feedback.step1.retry
as a boolean field or feedback.edits.0.value
as a string field.
Nesting Limitations: For complex data types like objects and arrays, we allow max 5 levels of nested objects and max 2 levels of nested arrays.
Reserved Fields
The following fields are reserved for user feedback:ground_truth
- The ground truth value for the output of a trace or span. This is used to compare the actual output with the expected output. It is rendered differently in the UI.
Learn More
SDK Reference
Read more about theenrich_session
function in the Python SDK reference.