Skip to content

feedbacks

Classes

FeedbackModel

Bases: BaseModel

Represents a feedback entry in the database.

Attributes

id
id: str

Unique identifier for the feedback.

user_id
user_id: str

ID of the user who submitted the feedback.

version
version: int

Schema version of the feedback.

type
type: str

Type of feedback (e.g., 'rating', 'comment').

data
data: Optional[dict] = None

Content of the feedback, structure depends on 'type'.

Dict Fields
  • model_id (str, optional): ID of the model being rated
  • rating (str|int, optional): The rating value (e.g., 1, 0, -1 for win/draw/lose)
  • sibling_model_ids (list[str], optional): IDs of sibling models in comparison scenarios (e.g., arena)
  • tags (list[str], optional): Tags associated with the feedback
  • reason (str, optional): Reason for the rating
  • comment (str, optional): Additional comment provided by the user
meta
meta: Optional[dict] = None

Metadata associated with the feedback.

Dict Fields
  • arena (bool, optional): Whether the feedback is related to the arena feature
  • chat_id (str, optional): ID of the chat session where feedback was given
  • message_id (str, optional): ID of the message being rated or commented on
  • tags (list[str], optional): Tags associated with the feedback
  • model_id (str, optional): ID of the model being rated
  • message_index (int, optional): Index of the message in the chat history
  • base_models (dict[str, str], optional): Mapping of model IDs to their base model IDs
snapshot
snapshot: Optional[dict] = None

Snapshot of the context (e.g., chat history) when feedback was given.

Dict Fields
  • chat (dict, optional): Complete chat object containing the conversation state
  • chat.chat (dict, optional): Nested chat data structure
  • chat.chat.history (dict, optional): Chat history information
  • chat.chat.history.messages (dict[str, object], optional): Message history mapping message IDs to message objects
  • chat.chat.history.messages[*].parentId (str, optional): ID of parent message
  • chat.chat.history.messages[*].childrenIds (list[str], optional): List of child message IDs
  • chat.chat.history.messages[*].content (str, optional): Message content text
  • chat.chat.history.messages[*].role (str, optional): Message role (e.g., 'user', 'assistant')
  • chat.chat.history.messages[*].model (str, optional): Model used for the message
  • chat.chat.history.messages[*].done (bool, optional): Whether message processing is complete
created_at
created_at: int

Timestamp when feedback was created (epoch).

updated_at
updated_at: int

Timestamp when feedback was last updated (epoch).

FeedbackResponse

Bases: BaseModel

Response model for feedback items.

Attributes

id
id: str

Unique identifier for the feedback.

user_id
user_id: str

ID of the user who submitted the feedback.

version
version: int

Schema version of the feedback.

type
type: str

Type of feedback (e.g., 'rating', 'comment').

data
data: Optional[dict] = None

Content of the feedback, structure depends on 'type'.

Dict Fields
  • model_id (str, optional): ID of the model being rated
  • rating (str|int, optional): The rating value (e.g., 1, 0, -1 for win/draw/lose)
  • sibling_model_ids (list[str], optional): IDs of sibling models in comparison scenarios (e.g., arena)
  • tags (list[str], optional): Tags associated with the feedback
  • reason (str, optional): Reason for the rating
  • comment (str, optional): Additional comment provided by the user
meta
meta: Optional[dict] = None

Metadata associated with the feedback.

Dict Fields
  • arena (bool, optional): Whether the feedback is related to the arena feature
  • chat_id (str, optional): ID of the chat session where feedback was given
  • message_id (str, optional): ID of the message being rated or commented on
  • tags (list[str], optional): Tags associated with the feedback
  • model_id (str, optional): ID of the model being rated
  • message_index (int, optional): Index of the message in the chat history
  • base_models (dict[str, str], optional): Mapping of model IDs to their base model IDs
snapshot
snapshot: Optional[dict] = None

Snapshot of the context (e.g., chat history) when feedback was given.

Dict Fields
  • chat (dict, optional): Complete chat object containing the conversation state
  • chat.chat (dict, optional): Nested chat data structure
  • chat.chat.history (dict, optional): Chat history information
  • chat.chat.history.messages (dict[str, object], optional): Message history mapping message IDs to message objects
  • chat.chat.history.messages[*].parentId (str, optional): ID of parent message
  • chat.chat.history.messages[*].childrenIds (list[str], optional): List of child message IDs
  • chat.chat.history.messages[*].content (str, optional): Message content text
  • chat.chat.history.messages[*].role (str, optional): Message role (e.g., 'user', 'assistant')
  • chat.chat.history.messages[*].model (str, optional): Model used for the message
  • chat.chat.history.messages[*].done (bool, optional): Whether message processing is complete
created_at
created_at: int

Timestamp when feedback was created (epoch).

updated_at
updated_at: int

Timestamp when feedback was last updated (epoch).

RatingData

Bases: BaseModel

Data structure for rating-type feedback.

Attributes

rating
rating: Optional[str | int] = None

The rating value (e.g., 1-5, 'thumbs_up').

model_id
model_id: Optional[str] = None

ID of the model being rated.

sibling_model_ids
sibling_model_ids: Optional[list[str]] = None

IDs of sibling models in comparison scenarios (e.g., arena).

reason
reason: Optional[str] = None

Reason for the rating.

comment
comment: Optional[str] = None

Additional comment provided by the user.

MetaData

Bases: BaseModel

Metadata for feedback entries.

Attributes

arena
arena: Optional[bool] = None

Whether the feedback is related to the arena feature.

chat_id
chat_id: Optional[str] = None

ID of the chat session where feedback was given.

message_id
message_id: Optional[str] = None

ID of the message being rated or commented on.

tags
tags: Optional[list[str]] = None

Tags associated with the feedback.

SnapshotData

Bases: BaseModel

Snapshot data capturing context at the time of feedback.

Attributes

chat
chat: Optional[dict] = None

The state of the chat when feedback was submitted.

Dict Fields
  • chat (dict, optional): Nested chat data structure
  • chat.chat (dict, optional): Chat data structure
  • chat.chat.history (dict, optional): Chat history information
  • chat.chat.history.messages (dict[str, object], optional): Message history mapping message IDs to message objects
  • chat.chat.history.messages[*].parentId (str, optional): ID of parent message
  • chat.chat.history.messages[*].childrenIds (list[str], optional): List of child message IDs
  • chat.chat.history.messages[*].content (str, optional): Message content text
  • chat.chat.history.messages[*].role (str, optional): Message role (e.g., 'user', 'assistant')
  • chat.chat.history.messages[*].model (str, optional): Model used for the message
  • chat.chat.history.messages[*].done (bool, optional): Whether message processing is complete

FeedbackForm

Bases: BaseModel

Form for creating or updating feedback.

Attributes

type
type: str

Type of feedback (e.g., 'rating').

data
data: Optional[RatingData] = None

Specific data for the feedback type.

meta
meta: Optional[dict] = None

Metadata associated with the feedback.

Dict Fields
  • arena (bool, optional): Whether the feedback is related to the arena feature
  • chat_id (str, optional): ID of the chat session where feedback was given
  • message_id (str, optional): ID of the message being rated or commented on
  • tags (list[str], optional): Tags associated with the feedback
  • model_id (str, optional): ID of the model being rated
  • message_index (int, optional): Index of the message in the chat history
  • base_models (dict[str, str], optional): Mapping of model IDs to their base model IDs
snapshot
snapshot: Optional[SnapshotData] = None

Context snapshot.

UserResponse

Bases: BaseModel

User details associated with feedback.

Attributes

id
id: str

User ID.

name
name: str

User's display name.

email
email: str

User's email address.

role
role: str = 'pending'

User's role (e.g., 'admin', 'user').

last_active_at
last_active_at: int

Timestamp of last activity (epoch).

updated_at
updated_at: int

Timestamp of last update (epoch).

created_at
created_at: int

Timestamp of account creation (epoch).

FeedbackUserResponse

Bases: FeedbackResponse

Feedback response including user details.

Attributes

user
user: Optional[UserResponse] = None

The user who submitted the feedback.

FeedbackListResponse

Bases: BaseModel

Response model for a list of feedbacks with pagination.

Attributes

items
items: list[FeedbackUserResponse]

List of feedback items.

total
total: int

Total number of feedbacks matching the query.