assistant2: Add initial support for attaching file context (#21934)

This PR adds the initial support for attaching files as context to a
thread in Assistant2.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-12-12 15:30:17 -05:00 committed by GitHub
parent 111e844753
commit 52c0d712a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 460 additions and 132 deletions

View file

@ -88,13 +88,13 @@ impl AssistantPanel {
thread: cx.new_view(|cx| {
ActiveThread::new(
thread.clone(),
workspace,
workspace.clone(),
language_registry,
tools.clone(),
cx,
)
}),
message_editor: cx.new_view(|cx| MessageEditor::new(thread.clone(), cx)),
message_editor: cx.new_view(|cx| MessageEditor::new(workspace, thread.clone(), cx)),
tools,
local_timezone: UtcOffset::from_whole_seconds(
chrono::Local::now().offset().local_minus_utc(),
@ -123,7 +123,8 @@ impl AssistantPanel {
cx,
)
});
self.message_editor = cx.new_view(|cx| MessageEditor::new(thread, cx));
self.message_editor =
cx.new_view(|cx| MessageEditor::new(self.workspace.clone(), thread, cx));
self.message_editor.focus_handle(cx).focus(cx);
}
@ -145,7 +146,8 @@ impl AssistantPanel {
cx,
)
});
self.message_editor = cx.new_view(|cx| MessageEditor::new(thread, cx));
self.message_editor =
cx.new_view(|cx| MessageEditor::new(self.workspace.clone(), thread, cx));
self.message_editor.focus_handle(cx).focus(cx);
}