snowby666 / poe-api-wrapper

👾 A Python API wrapper for Poe.com. With this, you will have free access to GPT-4, Claude, Llama, Gemini, Mistral and more! 🚀
https://pypi.org/project/poe-api-wrapper/
GNU General Public License v3.0
817 stars 96 forks source link

Poe: better !history function #16

Closed johnd0e closed 1 year ago

johnd0e commented 1 year ago

It would be convenient to have such functions:

johnd0e commented 1 year ago

Another issue: the output of !history can be very very long (and it takes time to retrieve it), while in fact most of the time we are interesting in getting recent items only. So I think it would be convenient to limit output to last 10-20 items, with option to continue.

P.S. Same is for threads

snowby666 commented 1 year ago

get_chat_history doesnt consume that much resources actually. And this api is aimed for general use so Poe is just an example of the library. I will rectify the example function later. I'm currently resolving the issue related to uploading file limit. Thanks for your patience

johnd0e commented 1 year ago

Poe is just an example of the library.

And it is very useful example, thank you for improving it!

johnd0e commented 1 year ago

get_chat_history doesnt consume that much resources actually.

I see in sources that requests are paginated. So if we have, say, 300 items in history, then it leads to 30 separate requests, and I think that consume a lot if time to finish.

So in turn it might make sense to consider that in PoeApi class. I mean that get_chat_history and some other methods could be implemented as generators.

snowby666 commented 1 year ago

Yeah I'm intended to refactor it as well. Im gonna save the chatCode and chatId once when opening a thread.

johnd0e commented 1 year ago

snowby666 closed this as completed 1 hour ago

But I do not see any related changes in Poe. (The only visible change - !load command implemented, but that is rather #17)

johnd0e commented 1 year ago

@snowby666 Shouldn't reopen this issue?

snowby666 commented 1 year ago

I think the current example is good enough. If any improvement then it would be adding paginations for chat history and threads is all (20 each page)

johnd0e commented 1 year ago

I think the current example is good enough.

Good indeed, but could be even better. Current !history is pretty useless, because we are unable to open chat from it.

johnd0e commented 12 months ago

!history command is pretty slow, so it could be several minutes until PoeExample finishes fetching all the items (when I have a lot). One could think that app hangs. It would be good if you could improve pagination.