assistant2: Render messages as Markdown (#21496)
This PR updates Assistant 2 to render the messages in the thread as Markdown: <img width="1138" alt="Screenshot 2024-12-03 at 6 09 27 PM" src="https://github.com/user-attachments/assets/c1c44fde-1efb-43cf-b9c9-768e6974c753"> Release Notes: - N/A
This commit is contained in:
parent
ecaf44511c
commit
9f459ba573
4 changed files with 81 additions and 4 deletions
|
@ -167,6 +167,10 @@ impl Thread {
|
|||
if let Some(last_message) = thread.messages.last_mut() {
|
||||
if last_message.role == Role::Assistant {
|
||||
last_message.text.push_str(&chunk);
|
||||
cx.emit(ThreadEvent::StreamedAssistantText(
|
||||
last_message.id,
|
||||
chunk,
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -320,6 +324,7 @@ pub enum ThreadError {
|
|||
pub enum ThreadEvent {
|
||||
ShowError(ThreadError),
|
||||
StreamedCompletion,
|
||||
StreamedAssistantText(MessageId, String),
|
||||
MessageAdded(MessageId),
|
||||
UsePendingTools,
|
||||
ToolFinished {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue