> This page is for version v5.0 (default).
> For other versions, use one of these documentation indexes:
> - v5.0 (default): https://humanloop.com/docs/v5/llms.txt
> - v4.0: https://humanloop.com/docs/v4/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://humanloop.com/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://humanloop.com/docs/_mcp/server.

> Learn how to record user feedback on your generated Prompt Logs using the Humanloop SDK.

### Prerequisites

* You already have a Prompt — if not, please follow our [Prompt creation](/docs/v4/guides/create-prompt) guide first.
* You have created a Human Evaluator. For this guide, we will use the "rating" example Evaluator automatically created for your organization.

#### Install and initialize the SDK

First you need to install and initialize the SDK. If you have already done this, skip to the next section.

Open up your terminal and follow these steps:

1. Install the Humanloop SDK:

```python
pip install humanloop
```

```typescript
npm install humanloop
```

2. Initialize the SDK with your Humanloop API key (you can get it from the [Organization Settings page](https://app.humanloop.com/account/api-keys)).

```python
from humanloop import Humanloop
humanloop = Humanloop(api_key="<YOUR HUMANLOOP KEY>")

# Check that the authentication was successful
print(humanloop.prompts.list())
```

```typescript
import { HumanloopClient, Humanloop } from "humanloop";

const humanloop = new HumanloopClient({ apiKey: "YOUR_API_KEY" });

// Check that the authentication was successful
console.log(await humanloop.prompts.list());
```

## Configure feedback

To collect user feedback, connect a Human Evaluator to your Prompt. The Evaluator specifies the type of the feedback you want to collect.
See our guide on [creating Human Evaluators](/docs/v4/guides/evaluation/evaluating-with-human-feedback) for more information.

> **Info**
>
> You can use the example "rating" Evaluator that is automatically for you. This
> Evaluator allows users to apply a label of "good" or "bad", and is
> automatically connected to all new Prompts. If you choose to use this
> Evaluator, you can skip to the "Log feedback" section.

#### Setting up a Human Evaluator for feedback

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:

1. **Explicit feedback**: these are purposeful actions to review the generations. For example, ‘thumbs up/down’ button presses.
2. **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).
3. **Free-form feedback**: Corrections and explanations provided by the end-user on the generation.

You should create Human Evaluators structured to capture the feedback you need.
For example, a Human Evaluator with return type "text" can be used to capture free-form feedback, while a Human Evaluator with return type "multi\_select" can be used to capture user actions
that provide implicit feedback.

If you have not done so, you can follow our guide to [create a Human Evaluator](/docs/v4/guides/evaluation/evaluating-with-human-feedback) to set up the appropriate feedback schema.

### Open the Prompt's monitoring dialog

Go to your Prompt's dashboard. Click **Monitoring** in the top right to open the monitoring dialog.

![Prompt dashboard showing Monitoring dialog](/docs/_fern-img/8327c0a05d11fbe08afde8e2121f62fb274b2e625c0c818cf3d61a8052113ae8.webp)

### Connect your Evaluator

Click **Connect Evaluators** and select the Human Evaluator you created.

![Dialog connecting the "Tweet Issues" Evaluator as a Monitoring Evaluator](/docs/_fern-img/4bb779640dfa290036e26e6f0a5c2081a6da6370755cd2a1b625b714d393065d.webp)

You should now see the selected Human Evaluator attached to the Prompt in the Monitoring dialog.

![Monitoring dialog showing the "Tweet Issues" Evaluator attached to the Prompt](/docs/_fern-img/eb59aeb7466f147ea5cacdc0c4799fc23cd381924e1ea529acf77fdc8e9fbeeb.webp)

## Log feedback

With the Human Evaluator attached to your Prompt, you can record feedback against the Prompt's Logs.

### Retrieve Log ID

The ID of the Prompt Log can be found in the response of the `humanloop.prompts.call(...)` method.

```python
log = humanloop.prompts.call(
    version_id="prv_qNeXZp9P6T7kdnMIBHIOV",
    path="persona",
    messages=[{"role": "user", "content": "What really happened at Roswell?"}],
    inputs={"person": "Trump"},
)
log_id = log.id
```

### Log the feedback

Call `humanloop.evaluators.log(...)` referencing the above Log ID as `parent_id` to record user feedback.

```python
feedback = humanloop.evaluators.log(
    # Pass the `log_id` from the previous step to indicate the Log to record feedback against
    parent_id=log_id,
    # Here, we're recording feedback against a "Tweet Issues" Human Evaluator,
    # which is of type `multi_select` and has multiple options to choose from.
    path="Feedback Demo/Tweet Issues",
    judgment=["Inappropriate", "Too many emojis"],
)
```

#### More examples

The "rating" and "correction" Evaluators are attached to all Prompts by default.
You can record feedback using these Evaluators as well.

The "rating" Evaluator can be used to record explicit feedback (e.g. from a 👍/👎 button).

```python
rating_log = humanloop.evaluators.log(
    parent_id=log_id,
    # We're recording feedback using the "rating" Human Evaluator,
    # which has 2 options: "good" and "bad".
    path="rating",
    judgment="good",

    # You can also include the source of the feedback when recording it with the `user` parameter.
    user="user_123",
)
```

The "correction" Evaluator can be used to record user-provided corrections to the generations (e.g. If the user edits the generation before copying it).

```python
correction_log = humanloop.evaluators.log(
    parent_id=log_id,
    path="correction",
    judgment="NOTHING happened at Roswell, folks! Fake News media pushing ALIEN conspiracy theories. SAD! "
    + "I know Area 51, have the best aliens. Roswell? Total hoax! Believe me. 👽🚫 #Roswell #FakeNews",
)
```

If the user removes their feedback (e.g. if the user deselects a previous 👎 feedback), you can record this by passing `judgment=None`.

```python
removed_rating_log = humanloop.evaluators.log(
    parent_id=log_id,
    path="rating",
    judgment=None,
)
```

## View feedback

You can view the applied feedback in two main ways: through the Logs that the feedback was applied to, and through the Evaluator itself.

### Feedback applied to Logs

The feedback recorded for each Log can be viewed in the **Logs** table of your Prompt.

![Logs table showing feedback applied to Logs](/docs/_fern-img/fcd13145001e4cc1c189712cd48ccd6634e7615b2422d0a6e26ebfe9be7e80a3.webp)

Your internal users can also apply feedback to the Logs directly through the Humanloop app.

![Log drawer showing feedback section](/docs/_fern-img/c4c1bec49e8f439f183a55358aacd53a1a37c1644ca0d8a635ba0441f1305055.webp)

### Feedback for an Evaluator

You can view all feedback recorded for a specific Human Evaluator in the **Logs** tab of the Evaluator.
This will display all feedback recorded for the Evaluator across all other Files.

![Logs table for "Tweet Issues" Evaluator showing feedback](/docs/_fern-img/9952158000bd89513dfc48146f1bc370a79170fe2333352b9c33b1fd368bb75b.webp)

## Next steps

* [Create and customize your own Human Evaluators](../evals/human-evaluators) to capture the feedback you need.
* Human Evaluators can also be used in Evaluations, allowing you to [collect judgments from your subject-matter experts](../evals/run-human-evaluation).