assistant2: Add rudimentary chat functionality (#21178)

This PR adds in rudimentary functionality for sending messages to the
LLM in `assistant2`.

<img width="1079" alt="Screenshot 2024-11-25 at 1 49 11 PM"
src="https://github.com/user-attachments/assets/5accb749-c034-4fb2-bf55-3ae5bc9529ad">

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-11-25 14:08:40 -05:00 committed by GitHub
parent bd02b35ba9
commit a02684b2f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 211 additions and 8 deletions

View file

@ -0,0 +1,23 @@
use gpui::{ModelContext, Task};
use language_model::Role;
/// A message in a [`Thread`].
pub struct Message {
pub role: Role,
pub text: String,
}
/// A thread of conversation with the LLM.
pub struct Thread {
pub messages: Vec<Message>,
pub pending_completion_tasks: Vec<Task<()>>,
}
impl Thread {
pub fn new(_cx: &mut ModelContext<Self>) -> Self {
Self {
messages: Vec::new(),
pending_completion_tasks: Vec::new(),
}
}
}