Python sdk
User Feedbacks

Feedback

Agiflow also make it possible to add user feedback via backend API. Here is how to do it:

Inline feedback

User can provide feedback from past action, for this to work, you will need to provide extra information such as message Id to Agiflow to correctly associate user feedback to the right action.

agiflow.associate_trace(
  id, # messageId, etc... your unique id that will be linked to trace_id
  span_id # messageId, etc... your unique id that will be linked to span_id
);

Later on, when user provide feedback, you can simply do:

agiflow.report_score(
  id, # action_id or your unique id
  0.6 // Normalised score
);

We use normalised score to make it easier for fine-tune. Here is a reference for conversion:

  • Thumbs up = 1; thumbs down = 0;
  • Rank 0 -> 10 is converted to [0, 1].

Feedback widget

  • You can asynchronously invoke feedback widget on the frontend.