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:
parent
bd02b35ba9
commit
a02684b2f7
7 changed files with 211 additions and 8 deletions
23
crates/assistant2/src/thread.rs
Normal file
23
crates/assistant2/src/thread.rs
Normal 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(),
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue