Message Feedback

Comprehensive guide to managing message feedback in the View Assistant platform, including feedback creation, retrieval, updates, and deletion for conversation messages.

Overview

Message Feedback enables users to provide feedback, ratings, and evaluations for AI-generated messages within conversations. This feature allows collection of user sentiment, quality ratings, and improvement suggestions to enhance AI model performance and conversation quality.

Message Feedback is managed via the Assistant API at [http|https]://[hostname]:[port]/v1.0/tenants/[tenant-guid]/assistant/conversations/[conversation-id]/messages/[message-id]/feedback and supports comprehensive operations including feedback creation, retrieval, updates, and deletion for optimal feedback management workflows.

Message Feedback Object Structure

Message Feedback objects contain information about user feedback for specific messages. Here's the structure:

{
  "feedback_id": "fb-123-456-789",
  "conversation_id": "abc123-def456-ghi789",
  "message_id": "msg-001",
  "rating": 5,
  "comment": "Very helpful response!",
  "feedback_type": "positive",
  "created_at": "2025-01-15T10:30:00.000000Z",
  "updated_at": "2025-01-15T10:30:00.000000Z",
  "user_guid": "11111111-1111-1111-1111-111111111111"
}

Field Descriptions

  • feedback_id (string): Unique identifier for the feedback entry
  • conversation_id (string): ID of the conversation containing the message
  • message_id (string): ID of the message the feedback relates to
  • rating (number, Optional): Numeric rating or score for the message
  • comment (string, Optional): Text comment or feedback description
  • feedback_type (string, Optional): Type of feedback (e.g., "positive", "negative", "neutral")
  • created_at (string): Timestamp when the feedback was created
  • updated_at (string): Timestamp when the feedback was last updated
  • user_guid (string): GUID of the user who provided the feedback

API Endpoints

Message Feedback is managed via the Assistant server API at [http|https]://[hostname]:[port]/v1.0/tenants/[tenant-guid]/assistant/conversations/[conversation-id]/messages/[message-id]/feedback

Supported HTTP Methods: GET, POST, PATCH, DELETE

Important: All feedback operations require appropriate authentication tokens.

Supported Operations

  • Create: Create new feedback for a specific message
  • Read: Retrieve feedback for a specific message (returns single feedback or array)
  • Read All: Retrieve all feedback entries for a conversation with pagination
  • Update: Modify existing feedback for a message
  • Delete: Remove feedback for a message

Create Message Feedback

Creates new feedback for a message using POST /v1.0/tenants/[tenant-guid]/assistant/conversations/[conversation-id]/messages/[message-id]/feedback.

Request Parameters

  • conversation-id (string, Path, Required): ID of the conversation containing the message
  • message-id (string, Path, Required): ID of the message to provide feedback for

Request Body

{
  "rating": 5,
  "comment": "Very helpful response!",
  "feedback_type": "positive"
}
curl --location --request POST 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/conversations/abc123-def456-ghi789/messages/msg-001/feedback' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "rating": 5,
    "comment": "Very helpful response!",
    "feedback_type": "positive"
}'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const createFeedback = async () => {
  try {
    const response = await api.MessageFeedback.create(
      "abc123-def456-ghi789", // conversationId
      "msg-001", // messageId
      {
        rating: 5,
        comment: "Very helpful response!",
        feedback_type: "positive"
      }
    );
    console.log(response, "Feedback created successfully");
  } catch (err) {
    console.log("Error creating feedback:", err);
  }
};

createFeedback();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def createFeedback():
    feedback = assistant.MessageFeedback.create(
        conversation_id="abc123-def456-ghi789",
        message_id="msg-001",
        rating=5,
        comment="Very helpful response!",
        feedback_type="positive"
    )
    print("Created Feedback:")
    print(feedback)

createFeedback()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

MessageFeedbackRequest request = new MessageFeedbackRequest
{
    rating = 5,
    comment = "Very helpful response!",
    feedback_type = "positive"
};

MessageFeedback feedback = await sdk.MessageFeedback.Create(
    "abc123-def456-ghi789",
    "msg-001",
    request
);

Response

Returns the created feedback object:

{
  "feedback_id": "fb-123-456-789",
  "conversation_id": "abc123-def456-ghi789",
  "message_id": "msg-001",
  "rating": 5,
  "comment": "Very helpful response!",
  "feedback_type": "positive",
  "created_at": "2025-01-15T10:30:00.000000Z",
  "updated_at": "2025-01-15T10:30:00.000000Z",
  "user_guid": "11111111-1111-1111-1111-111111111111"
}

Read Message Feedback

Retrieves feedback for a specific message using GET /v1.0/tenants/[tenant-guid]/assistant/conversations/[conversation-id]/messages/[message-id]/feedback. Returns either a single feedback object or an array of feedback entries.

Request Parameters

  • conversation-id (string, Path, Required): ID of the conversation containing the message
  • message-id (string, Path, Required): ID of the message to retrieve feedback for
curl --location 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/conversations/abc123-def456-ghi789/messages/msg-001/feedback' \
--header 'Authorization: ••••••'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const readFeedback = async () => {
  try {
    const response = await api.MessageFeedback.readMessageFeedback(
      "abc123-def456-ghi789", // conversationId
      "msg-001" // messageId
    );
    console.log(response, "Feedback fetched successfully");
  } catch (err) {
    console.log("Error fetching feedback:", err);
  }
};

readFeedback();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def readFeedback():
    feedback = assistant.MessageFeedback.read_message_feedback(
        conversation_id="abc123-def456-ghi789",
        message_id="msg-001"
    )
    print("Retrieved Feedback:")
    print(feedback)

readFeedback()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

MessageFeedback feedback = await sdk.MessageFeedback.ReadMessageFeedback(
    "abc123-def456-ghi789",
    "msg-001"
);

Response

Returns either a single feedback object or an array of feedback entries:

Single Feedback Response:

{
  "feedback_id": "fb-123-456-789",
  "conversation_id": "abc123-def456-ghi789",
  "message_id": "msg-001",
  "rating": 5,
  "comment": "Very helpful response!",
  "feedback_type": "positive",
  "created_at": "2025-01-15T10:30:00.000000Z",
  "updated_at": "2025-01-15T10:30:00.000000Z",
  "user_guid": "11111111-1111-1111-1111-111111111111"
}

Multiple Feedback Response:

[
  {
    "feedback_id": "fb-123-456-789",
    "conversation_id": "abc123-def456-ghi789",
    "message_id": "msg-001",
    "rating": 5,
    "comment": "Very helpful response!",
    "feedback_type": "positive",
    "created_at": "2025-01-15T10:30:00.000000Z",
    "updated_at": "2025-01-15T10:30:00.000000Z",
    "user_guid": "11111111-1111-1111-1111-111111111111"
  },
  {
    "feedback_id": "fb-987-654-321",
    "conversation_id": "abc123-def456-ghi789",
    "message_id": "msg-001",
    "rating": 4,
    "comment": "Good explanation",
    "feedback_type": "positive",
    "created_at": "2025-01-15T11:00:00.000000Z",
    "updated_at": "2025-01-15T11:00:00.000000Z",
    "user_guid": "22222222-2222-2222-2222-222222222222"
  }
]

Read All Conversation Feedback

Retrieves all feedback entries for a conversation using GET /v1.0/tenants/[tenant-guid]/assistant/conversations/[conversation-id]/feedback. Returns a paginated list of all feedback entries across all messages in the conversation.

Request Parameters

  • conversation-id (string, Path, Required): ID of the conversation to retrieve feedback for
  • limit (number, Query, Optional): Number of feedback entries to retrieve (default: 100)
  • offset (number, Query, Optional): Offset for pagination (default: 0)
curl --location 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/conversations/abc123-def456-ghi789/feedback?limit=100&offset=0' \
--header 'Authorization: ••••••'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const readAllFeedback = async () => {
  try {
    const response = await api.MessageFeedback.readAllConversationFeedback(
      "abc123-def456-ghi789", // conversationId
      100, // limit
      0    // offset
    );
    console.log(response, "All feedback fetched successfully");
  } catch (err) {
    console.log("Error fetching feedback:", err);
  }
};

readAllFeedback();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def readAllFeedback():
    feedbacks = assistant.MessageFeedback.read_all_conversation_feedback(
        conversation_id="abc123-def456-ghi789",
        limit=100,
        offset=0
    )
    print("All Feedback:")
    print(feedbacks)

readAllFeedback()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

MessageFeedback[] feedbacks = await sdk.MessageFeedback.ReadAllConversationFeedback(
    "abc123-def456-ghi789",
    limit: 100,
    offset: 0
);

Response

Returns an array of feedback entries:

[
  {
    "feedback_id": "fb-123-456-789",
    "conversation_id": "abc123-def456-ghi789",
    "message_id": "msg-001",
    "rating": 5,
    "comment": "Very helpful response!",
    "feedback_type": "positive",
    "created_at": "2025-01-15T10:30:00.000000Z",
    "updated_at": "2025-01-15T10:30:00.000000Z",
    "user_guid": "11111111-1111-1111-1111-111111111111"
  },
  {
    "feedback_id": "fb-987-654-321",
    "conversation_id": "abc123-def456-ghi789",
    "message_id": "msg-002",
    "rating": 4,
    "comment": "Good explanation",
    "feedback_type": "positive",
    "created_at": "2025-01-15T11:00:00.000000Z",
    "updated_at": "2025-01-15T11:00:00.000000Z",
    "user_guid": "22222222-2222-2222-2222-222222222222"
  }
]

Update Message Feedback

Updates existing feedback for a message using PATCH /v1.0/tenants/[tenant-guid]/assistant/conversations/[conversation-id]/messages/[message-id]/feedback.

Request Parameters

  • conversation-id (string, Path, Required): ID of the conversation containing the message
  • message-id (string, Path, Required): ID of the message to update feedback for

Request Body

Provide the fields to update:

{
  "rating": 4,
  "comment": "Updated comment - still helpful but could be more detailed",
  "feedback_type": "neutral"
}
curl --location --request PATCH 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/conversations/abc123-def456-ghi789/messages/msg-001/feedback' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "rating": 4,
    "comment": "Updated comment - still helpful but could be more detailed",
    "feedback_type": "neutral"
}'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const updateFeedback = async () => {
  try {
    const response = await api.MessageFeedback.update(
      "abc123-def456-ghi789", // conversationId
      "msg-001", // messageId
      {
        rating: 4,
        comment: "Updated comment - still helpful but could be more detailed",
        feedback_type: "neutral"
      }
    );
    console.log(response, "Feedback updated successfully");
  } catch (err) {
    console.log("Error updating feedback:", err);
  }
};

updateFeedback();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def updateFeedback():
    feedback = assistant.MessageFeedback.update(
        conversation_id="abc123-def456-ghi789",
        message_id="msg-001",
        rating=4,
        comment="Updated comment - still helpful but could be more detailed",
        feedback_type="neutral"
    )
    print("Updated Feedback:")
    print(feedback)

updateFeedback()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

MessageFeedbackRequest request = new MessageFeedbackRequest
{
    rating = 4,
    comment = "Updated comment - still helpful but could be more detailed",
    feedback_type = "neutral"
};

MessageFeedback feedback = await sdk.MessageFeedback.Update(
    "abc123-def456-ghi789",
    "msg-001",
    request
);

Response

Returns the updated feedback object:

{
  "feedback_id": "fb-123-456-789",
  "conversation_id": "abc123-def456-ghi789",
  "message_id": "msg-001",
  "rating": 4,
  "comment": "Updated comment - still helpful but could be more detailed",
  "feedback_type": "neutral",
  "created_at": "2025-01-15T10:30:00.000000Z",
  "updated_at": "2025-01-15T11:30:00.000000Z",
  "user_guid": "11111111-1111-1111-1111-111111111111"
}

Delete Message Feedback

Deletes feedback for a message using DELETE /v1.0/tenants/[tenant-guid]/assistant/conversations/[conversation-id]/messages/[message-id]/feedback. This permanently removes the feedback entry.

Request Parameters

  • conversation-id (string, Path, Required): ID of the conversation containing the message
  • message-id (string, Path, Required): ID of the message to delete feedback for

Note: Deleting feedback removes it permanently. This action cannot be undone.

curl --location --request DELETE 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/conversations/abc123-def456-ghi789/messages/msg-001/feedback' \
--header 'Authorization: ••••••'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const deleteFeedback = async () => {
  try {
    const response = await api.MessageFeedback.delete(
      "abc123-def456-ghi789", // conversationId
      "msg-001" // messageId
    );
    console.log(response, "Feedback deleted successfully");
  } catch (err) {
    console.log("Error deleting feedback:", err);
  }
};

deleteFeedback();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def deleteFeedback():
    result = assistant.MessageFeedback.delete(
        conversation_id="abc123-def456-ghi789",
        message_id="msg-001"
    )
    print("Deleted Feedback:", result)

deleteFeedback()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

bool deleted = await sdk.MessageFeedback.Delete(
    "abc123-def456-ghi789",
    "msg-001"
);

Response

Returns true on successful deletion, or a 404 Not Found error if the feedback doesn't exist.

Best Practices

When managing message feedback in the View Assistant platform, consider the following recommendations for optimal feedback collection and management:

  • Feedback Collection: Encourage users to provide feedback for AI responses to improve model performance and conversation quality
  • Rating Systems: Use consistent rating scales and feedback types to enable meaningful analysis
  • Comment Analysis: Leverage text comments to identify common issues and improvement areas
  • Feedback Aggregation: Use conversation-level feedback endpoints to analyze overall conversation quality
  • User Privacy: Respect user privacy when collecting and storing feedback data
  • Feedback Lifecycle: Implement appropriate retention policies for feedback data
  • Analytics Integration: Aggregate feedback data for insights into AI model performance and user satisfaction
  • Error Handling: Implement robust error handling for feedback operations, especially when feedback may not exist

Next Steps

After successfully managing message feedback, you can:

  • Model Improvement: Use feedback data to identify areas for AI model enhancement and training
  • Quality Analytics: Analyze feedback patterns to understand conversation quality trends
  • User Experience: Leverage feedback to improve user experience and conversation flows
  • Reporting: Build dashboards and reports showing feedback metrics and trends
  • Feedback Loops: Implement automated feedback loops to continuously improve AI responses
  • Platform Integration: Integrate feedback data with other View platform services for comprehensive analytics