Capture user feedback
You can record feedback on generations from your users using the Humanloop Python SDK. This allows you to monitor how your generations perform with your users.
This guide shows how to use the Humanloop SDK to record user feedback on datapoints. This works equivalently for both the completion and chat APIs.
Prerequisites
- You already have a Prompt — if not, please follow our Prompt creation guide first.
- Already have integrated
humanloop.chat()
orhumanloop.complete()
to log generations with the Python or TypeScript SDKs. If not, follow our guide to integrating the SDK.
Record feedback with the datapoint ID
-
Extract the data ID from the
humanloop.complete_deployed()
response. -
Call
humanloop.feedback()
referencing the saved datapoint ID to record user feedback.
You can also include the source of the feedback when recording it.
The feedback recorded for each datapoint can be viewed in the Logs tab of your project.
Different use cases and user interfaces may require different kinds of feedback that need to be mapped to the appropriate end user interaction. There are broadly 3 important kinds of feedback:
- Explicit feedback: these are purposeful actions to review the generations. For example, ‘thumbs up/down’ button presses.
- Implicit feedback: indirect actions taken by your users may signal whether the generation was good or bad, for example, whether the user ‘copied’ the generation, ‘saved it’ or ‘dismissed it’ (which is negative feedback).
- Free-form feedback: Corrections and explanations provided by the end-user on the generation.
Recording corrections as feedback
It can also be useful to allow your users to correct the outputs of your model. This is strong feedback signal and can also be considered as ground truth data for finetuning later.
This feedback will also show up within Humanloop, where your internal users can also provide feedback and corrections on logged data to help with evaluation.