Introduce rating for assistant threads (#26780)

Release Notes:

- N/A

---------

Co-authored-by: Richard Feldman <oss@rtfeldman.com>
Co-authored-by: Agus Zubiaga <hi@aguz.me>
This commit is contained in:
Antonio Scandurra 2025-03-14 15:41:50 +01:00 committed by GitHub
parent c62210b178
commit f68a475eca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 378 additions and 117 deletions

View file

@ -97,6 +97,7 @@ pub enum Event {
InlineCompletionRating(InlineCompletionRatingEvent),
Call(CallEvent),
Assistant(AssistantEvent),
AssistantThreadFeedback(AssistantThreadFeedbackEvent),
Cpu(CpuEvent),
Memory(MemoryEvent),
App(AppEvent),
@ -230,6 +231,26 @@ pub struct ReplEvent {
pub repl_session_id: String,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum ThreadFeedbackRating {
Positive,
Negative,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct AssistantThreadFeedbackEvent {
/// Unique identifier for the thread
pub thread_id: String,
/// The feedback rating (thumbs up or thumbs down)
pub rating: ThreadFeedbackRating,
/// The serialized thread data containing messages, tool calls, etc.
pub thread_data: serde_json::Value,
/// The initial project snapshot taken when the thread was created
pub initial_project_snapshot: serde_json::Value,
/// The final project snapshot taken when the thread was first saved
pub final_project_snapshot: serde_json::Value,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct BacktraceFrame {
pub ip: usize,