Cycle message roles on click
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
ac7178068f
commit
ef7ec265c8
4 changed files with 106 additions and 51 deletions
|
@ -34,6 +34,16 @@ enum Role {
|
|||
System,
|
||||
}
|
||||
|
||||
impl Role {
|
||||
pub fn cycle(&mut self) {
|
||||
*self = match self {
|
||||
Role::User => Role::Assistant,
|
||||
Role::Assistant => Role::System,
|
||||
Role::System => Role::User,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for Role {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue