User feedback is an excellent source for assessing the quality of an LLM application. In Baserun, feedback is collected either as a 0-1 score or custom defined metadata. The feedback is then displayed in the input/output tab inside the trace detail or request detail panel.

client.feedback(name: str, score: float, metadata: Optional[Dict] = None) -> Tag:

Arguments

name
string

An optional name that will show up in the Trace/Completion detail view > Feedback section.

score
float
required

A score between 0 and 1

metadata
object

Extra information about the feedback. For example, a user comment.

Instructions

Within a LLM request or a trace, after create an client

client.feedback (0.9, metadata={"comment": "Great response!"})

Adding feedback to a completed trace or completion

Check out the Tags page for more information on how to add feedback to a trace or completion.