Skip to content

Submit Feedback

The submit_feedback() method allows you to submit end-user feedback for a conversation. This feedback is automatically tagged as coming from customers and is used in analytics to measure user satisfaction.

Method Signature

python
conversation_manager.submit_feedback(
    conversation_id: Union[int, str],
    sentiment: Union[Sentiment, str],
    comment: Optional[str] = None,
    metadata: Optional[Dict[str, Any]] = None
)

Parameters

ParameterTypeRequiredDescription
conversation_idstring or integerYesConversation ID (string) or database ID (integer)
sentimentstring or SentimentYesUser sentiment: positive, neutral, or negative
commentstringNoUser feedback text (max 5000 characters)
metadatadictNoAdditional contextual information

Basic Usage

python
from agentsight import conversation_manager

conversation_manager.submit_feedback(
    conversation_id="conv-123",
    sentiment="positive",
    comment="Very helpful!"
)

Complete Usage Example

python
from agentsight import conversation_manager
from agentsight.enums import Sentiment

conversation_manager.submit_feedback(
    conversation_id="support-session-456", # or use database ID
    sentiment=Sentiment.POSITIVE,
    comment="Excellent service! The agent was knowledgeable and resolved my password reset issue in under 3 minutes.",
    metadata={
        "rating": 5,
        "would_recommend": True,
        "issue_resolved": True,
        "response_time_rating": "excellent",
        "feedback_channel": "post_chat_survey",
        "collected_at": "2024-01-15T10:35:00Z"
    }
)

Sentiment Values

SentimentDescriptionUse Case
positiveUser is satisfiedIssue resolved, helpful response
neutralUser has mixed feelingsPartial help, average experience
negativeUser is dissatisfiedIssue not resolved, poor experience

Thumbs up/Thumbs down

You can also use this field if you only have thumbs up/thumbs down, just pass it as positive/negative

Using Database ID

python
# Fetch conversation first
from agentsight import agentsight_api

conversation = agentsight_api.fetch_conversation("conv-123")

# Submit feedback using database ID
conversation_manager.submit_feedback(
    conversation_id=conversation['id'],  # Integer database ID
    sentiment="positive",
    comment="Great support!"
)

Feedback Source

The feedback source is automatically determined by authentication method:

AuthenticationSourceUsage
API KeycustomerEnd-user feedback - included in analytics
JWTplatformInternal feedback - excluded from analytics

Analytics Note

Only customer feedback (from API keys) is used in satisfaction metrics. This ensures analytics reflect genuine user experience, not internal QA reviews.