Introduce the ability to talk to GPT-4 within buffers on preview and dev (#2524)

This adds basic ability to interact with OpenAI inside a buffer.

Release Notes:

* If`OPENAI_API_KEY` is defined in your environment, you can now run the
`ai: assist` command to pass the text of your current buffer to GPT-4.
If you're editing a file with a `.zmd` extension, you can also invoke
the model with `cmd-enter.` (preview-only)
This commit is contained in:
Nathan Sobo 2023-05-24 12:00:43 -06:00 committed by GitHub
commit 0b7d095c0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 475 additions and 14 deletions

View file

@ -960,7 +960,7 @@ impl<T: 'static, E: 'static + Display> Task<Result<T, E>> {
pub fn detach_and_log_err(self, cx: &mut AppContext) {
cx.spawn(|_| async move {
if let Err(err) = self.await {
log::error!("{}", err);
log::error!("{:#}", err);
}
})
.detach();