assistant2: Add general structure for conversation history (#11516)

This PR adds the general structure for conversation history to the new
assistant.

Right now we have a placeholder button in the assistant panel that will
toggle a picker containing some placeholder saved conversations.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-05-07 17:03:33 -04:00 committed by GitHub
parent 47ca343803
commit 6a64b732b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 239 additions and 1 deletions

View file

@ -0,0 +1,29 @@
pub struct SavedConversation {
/// The title of the conversation, generated by the Assistant.
pub title: String,
pub messages: Vec<SavedMessage>,
}
pub struct SavedMessage {
pub text: String,
}
/// Returns a list of placeholder conversations for mocking the UI.
///
/// Once we have real saved conversations to pull from we can use those instead.
pub fn placeholder_conversations() -> Vec<SavedConversation> {
vec![
SavedConversation {
title: "How to get a list of exported functions in an Erlang module".to_string(),
messages: vec![],
},
SavedConversation {
title: "7 wonders of the ancient world".to_string(),
messages: vec![],
},
SavedConversation {
title: "Size difference between u8 and a reference to u8 in Rust".to_string(),
messages: vec![],
},
]
}