Skip to content

Maira Feedback

Maira allows you to send feedback on its responses. Each query and its response form a conversation, which has a conversation_id. You get the conversation_id in the iAsk response (see the "Maira Integration" tutorial).

Feedback on a single conversation

To send feedback on a response, use PUT /v1/gpt/conversations/{conversation_id}, with the conversation_id in the path and a JSON body. The request uses the same project-key and api-key headers as iAsk.

Each call sends exactly one of type, rating, masked_response or linked_dataset_id. type and rating are separate parameters, so to send both, use two calls.

To rate a response, send type or rating, optionally with a message from the user. For example, with type:

{
  "message": "Helpful, but I'd like a simpler answer.",
  "type": "positive"
}

Or with rating:

{
  "message": "Tell us your experience of the response",
  "rating": 5
}

Response:

{
  "detail": {
    "response": "Conversation 3fa85f64-5717-4562-b3fc-2c963f66afa6 updated."
  }
}

Let's look at the parameters:

  • message: Optional[str] - Feedback message from the user describing their experience of the response.
  • type: Optional[str] - Type of feedback. Can only take positive or negative.
  • rating: Optional[int] - Rating of the response, represented as an integer. The lower bound is 0. To set the upper limit, use max_feedback_rating in the GPT settings (refer to the "Settings" section of the "Maira Settings and Conversation Summary" tutorial).
  • masked_response: Optional - See the sandbox for details.
  • linked_dataset_id: Optional - See the sandbox for details.

Bulk feedback

You can also submit feedback for multiple conversations at once with PUT /v1/gpt/conversations.

Note

More information on bulk feedback is coming soon.