Pass User Feedback
The Langtrace SDK gives you the ability to pass user feedback from your application as scores for measuring accuracy.
Understanding User Feedback
User feedback is crucial for improving the performance and accuracy of your LLM applications. It provides direct insights into user satisfaction and helps identify areas for improvement.
Types of Feedback
- Binary feedback (thumbs up/down)
- Numeric ratings (e.g., 1-5 stars)
- Textual feedback
How to Pass User Feedback
When you are using Langtrace, you can pass both user id and user feedback using the Langtrace.withLangTraceRootSpan
function for typescript or with_langtrace_root_span
decorator in python.
This helps with understanding usage patterns and measure the accuracy of your application from your user’s perspective.
Installation
Install and initialize Langtrace SDK. Refer to the installation guide for more information.
Implementing User Feedback
Use the Langtrace.withLangTraceRootSpan
function to trace interaction which provides spanId
and traceId
for the interaction.
Example user score
Collect the userScore
and userId
from your application and pass it to Langtrace.sendUserFeedback({userScore, userId, traceId, spanId})
function along with traceId
and spanId
.
Best Practices
- Keep feedback collection simple and non-intrusive
- Clearly communicate how feedback will be used
- Act on feedback to improve your application
- Regularly analyze feedback trends
Privacy Considerations
When collecting user feedback, ensure you’re complying with relevant data protection regulations. Always inform users about data collection and obtain necessary consents.