Set the human feedback for a message.

Parameters

message_id
str

The ID of the message to set the human feedback for.

feedback
int

The human feedback value to set. This can be one of the following values: -1 (negative feedback), 0 (neutral feedback), or 1 (positive feedback).

Returns

success
bool
required

True if the human feedback was successfully set, False otherwise.

Example

Code Example
from chainlit.client.cloud import chainlit_client

message_id = "12345"
feedback = 1

success = await chainlit_client.set_human_feedback(message_id, feedback)

if success:
    print("Human feedback set successfully.")
else:
    print("Failed to set human feedback.")