roboto.ai.agent_thread.feedback
Module Contents
AdminUpdateFeedbackRequest
Bases: pydantic.BaseModel
Triage fields editable by Roboto admins.
Fields omitted from the request (NotSet) are left unchanged. Fields explicitly set to None clear the column back to NULL. Fields set to a value overwrite the column.
Setting resolved to True additionally stamps resolved_at and resolved_by server-side; setting it back to False clears them.
Parameters
data AnyAttributes
AdminUpdateFeedbackRequest.admin_label
AdminUpdateFeedbackRequest.admin_note
AdminUpdateFeedbackRequest.model_config
model_config #Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
AdminUpdateFeedbackRequest.resolved
FeedbackCategory
Bases: roboto.compat.StrEnum
Taxonomy of feedback categories.
Which categories are valid depends on sentiment (see category_is_valid_for_sentiment()). OTHER is always permitted; when OTHER is among the selected categories, notes is required.
Attributes
FeedbackCategory.CORRECT
FeedbackCategory.FORMATTING
FeedbackCategory.GOOD_TOOL_USE
FeedbackCategory.HELPFUL
FeedbackCategory.INCOMPLETE
FeedbackCategory.INCORRECT
FeedbackCategory.OTHER
FeedbackCategory.REFUSED_VALID_REQUEST
FeedbackCategory.SLOW
FeedbackCategory.TOOL_FAILURE
FeedbackCategory.UNSAFE
FeedbackSentiment
NEGATIVE_CATEGORIES
POSITIVE_CATEGORIES
SubmitFeedbackRequest
Bases: pydantic.BaseModel
Request body for submitting feedback on an assistant message.
One row per (session, message, user); resubmitting replaces the previous sentiment/categories/notes rather than adding a new row.
Parameters
data AnyAttributes
SubmitFeedbackRequest.categories
Categories describing what was good or bad. Semantically a set: duplicates are dropped and the persisted order is enum-value sort, not request order.
SubmitFeedbackRequest.notes
Free-text notes. Whitespace-only input is normalised to None before persistence. Required when FeedbackCategory.OTHER is selected.
UserFeedbackRecord
Bases: pydantic.BaseModel
Customer-facing projection of AgentFeedbackRecord.
Excludes every admin-only column (admin_label, admin_note, resolved, resolved_by, resolved_at) so routes that serve an end user never return internal triage state. Use this as the return type of any non-admin endpoint that surfaces feedback, including the response to the submitter’s own submit call.
The admin endpoints continue to return AgentFeedbackRecord directly.
Parameters
data AnyAttributes
UserFeedbackRecord.categories
Categories describing the feedback. May be empty.
UserFeedbackRecord.from_admin_record()
Project an AgentFeedbackRecord down to the user-facing shape.
Use at the boundary of any non-admin route that materialises a full admin record from persistence — the projection guarantees no admin triage column accidentally escapes to a customer response.
The projection is driven by cls.model_fields rather than a hand list of columns: a new submitter-controlled column added to both records flows through automatically, and a new admin-only column on AgentFeedbackRecord is silently dropped here (which is what we want for privacy). The matching test asserts the admin-only field set has not drifted unexpectedly.
Parameters
record AgentFeedbackRecordReturn type
Attributes
UserFeedbackRecord.message_sequence_num
Zero-indexed position of the assistant message within the session.
UserFeedbackRecord.modified
When the submitter last updated this feedback.
category_is_valid_for_sentiment()
Report whether category is a permitted choice under sentiment.
FeedbackCategory.OTHER is always permitted.
Parameters
category FeedbackCategorysentiment FeedbackSentimentReturn type