Message Feedback (Public)

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

Overview

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

Public Message Feedback is managed via the Assistant API at [http|https]://[hostname]:[port]/v1.0/tenants/[tenant-guid]/assistant/public/conversations/[conversation-id]/messages/[message-id]/feedback and supports comprehensive operations including feedback creation, retrieval, updates, and deletion for optimal public 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",
  "details": "Very helpful response!",
  "tags": ["helpful", "accurate", "clear"],
  "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 (string): Rating or score for the message as a string
  • details (string): Detailed feedback description or comment
  • tags (string[]): Array of tags categorizing the feedback
  • 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

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

Supported HTTP Methods: GET, POST, PATCH, DELETE

Important: All public 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)
  • 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/public/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",
  "details": "Very helpful response!",
  "tags": ["helpful", "accurate", "clear"]
}
curl --location --request POST 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/public/conversations/abc123-def456-ghi789/messages/msg-001/feedback' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "rating": "5",
    "details": "Very helpful response!",
    "tags": ["helpful", "accurate", "clear"]
}'
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.PublicMessageFeedback.create(
      "abc123-def456-ghi789", // conversationId
      "msg-001", // messageId
      {
        rating: "5",
        details: "Very helpful response!",
        tags: ["helpful", "accurate", "clear"]
      }
    );
    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.PublicMessageFeedback.create(
        conversation_id="abc123-def456-ghi789",
        message_id="msg-001",
        rating="5",
        details="Very helpful response!",
        tags=["helpful", "accurate", "clear"]
    )
    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",
    details = "Very helpful response!",
    tags = new[] { "helpful", "accurate", "clear" }
};

MessageFeedback feedback = await sdk.PublicMessageFeedback.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",
  "details": "Very helpful response!",
  "tags": ["helpful", "accurate", "clear"],
  "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/public/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/public/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.PublicMessageFeedback.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.PublicMessageFeedback.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.PublicMessageFeedback.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",
  "details": "Very helpful response!",
  "tags": ["helpful", "accurate", "clear"],
  "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",
    "details": "Very helpful response!",
    "tags": ["helpful", "accurate", "clear"],
    "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",
    "details": "Good explanation",
    "tags": ["helpful", "detailed"],
    "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/public/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",
  "details": "Updated feedback - still helpful but could be more detailed",
  "tags": ["helpful", "needs-improvement"]
}
curl --location --request PATCH 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/public/conversations/abc123-def456-ghi789/messages/msg-001/feedback' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "rating": "4",
    "details": "Updated feedback - still helpful but could be more detailed",
    "tags": ["helpful", "needs-improvement"]
}'
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.PublicMessageFeedback.update(
      "abc123-def456-ghi789", // conversationId
      "msg-001", // messageId
      {
        rating: "4",
        details: "Updated feedback - still helpful but could be more detailed",
        tags: ["helpful", "needs-improvement"]
      }
    );
    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.PublicMessageFeedback.update(
        conversation_id="abc123-def456-ghi789",
        message_id="msg-001",
        rating="4",
        details="Updated feedback - still helpful but could be more detailed",
        tags=["helpful", "needs-improvement"]
    )
    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",
    details = "Updated feedback - still helpful but could be more detailed",
    tags = new[] { "helpful", "needs-improvement" }
};

MessageFeedback feedback = await sdk.PublicMessageFeedback.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",
  "details": "Updated feedback - still helpful but could be more detailed",
  "tags": ["helpful", "needs-improvement"],
  "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/public/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/public/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.PublicMessageFeedback.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.PublicMessageFeedback.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.PublicMessageFeedback.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 public 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 formats (as strings) to enable meaningful analysis
  • Tag Management: Leverage tags array to categorize feedback for easier analysis and filtering
  • Details Field: Encourage detailed feedback in the details field to identify specific improvement areas
  • User Privacy: Respect user privacy when collecting and storing feedback data in public applications
  • 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
  • Public API Considerations: Remember that public feedback is accessible through public endpoints, so ensure appropriate access controls

Next Steps

After successfully managing public 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 in public applications
  • 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