Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make requests async #7

Open
reachtarunhere opened this issue Mar 20, 2023 · 4 comments
Open

Make requests async #7

reachtarunhere opened this issue Mar 20, 2023 · 4 comments

Comments

@reachtarunhere
Copy link

Hi! Thanks for the project. I love using it.

One little issue I have is that currently whenever I make a response in the Chat my whole emacs hangs. I would ideally want to do other things nav around. I suspect this is because the requests being made are not async?

Thank You!

@CarlQLange
Copy link
Owner

Yeah I totally agree, but I was unfamiliar with the requests library when I wrote this initially. I'll try and write an async version of it tomorrow!

@CarlQLange
Copy link
Owner

CarlQLange commented Mar 21, 2023

I've made a messy start on this on the asyncify branch. Unfortunately I still don't really know what I'm doing, so it'll take me a bit longer to get it perfect. It's happening, though :)

@CarlQLange
Copy link
Owner

In the meantime I've seen that https://github.com/karthink/gptel is async out of the box and looks quite comparable to this package.

@CarlQLange
Copy link
Owner

OK, I would say some of the harder edges have now been made async (eg, sending a message in a chat buffer, auto-renaming buffer/file). Not everything is async - none of the insert or replace region functions made it (I can't figure out a reasonable way to do this that won't totally mess with edits made to the buffer in between request and response), and the initial start-chat is also still sync.

Now it would be nice to have a loading indicator, timeout, a request queue, and inflight request cancellation and/or debouncing, because you can get impatient, resend the chat, and then get several responses in your buffer out of order. Contributions welcome 😅😅😅😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants