solderneer / obsidian-ai-tools

Adding powerful semantic search, generative answers, and other AI tools to Obsidian, using Supabase + OpenAI.
https://obsidian.md
MIT License
215 stars 16 forks source link

Text typing speed #4

Open johannesCmayer opened 12 months ago

johannesCmayer commented 12 months ago

I have just started to experiment with your plugin and it seems very promising, interesting and powerful.

However, one thing that's really bad in my opinion is this slow typing out of the text once you submit the query to GPT. Would it not be possible to just display the text at whatever speed the API returns it? The openAI API does have a streaming functionality.

solderneer commented 12 months ago

Yea as I've used the plugin more and more, it's been annoying me too. I am aware of the stream functionality, but for some reason I can't remember when I was hacking this out 3 weeks ago I was stuck on getting it to work properly.

In release 1.1.4, the typing speed is faster now as a temporary solution. When I get sometime later this weekend, I'll look into this. Or if you'd like, I'd welcome a pull request!

johannesCmayer commented 12 months ago

Well just pasting the text instantly once you get the full blob without streaming would also be a solution, which might be easier to implement. Streaming could be added later of cause. I implemented streaming like this:

This might not be helpful at all because my code is messy, and the structure is probably very different from your thing because mine is just a CLI app.