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
859 stars 99 forks source link

support for multi-users? #35

Closed wingeva1986 closed 1 year ago

wingeva1986 commented 1 year ago

Does the API support for multi-users connecting by calling client[token] = PoeApi(token)?

snowby666 commented 1 year ago

Yes this api does support multi-users connection Example:

from poe_api_wrapper import PoeApi
import threading

token = "Token_here"

client1 = PoeApi(token)
client2 = PoeApi(token)

def t1_send():
    for chunk in client1.send_message('a2', 'Nice to meet you'):
        pass

def t2_send():
    for chunk in client2.send_message('a2', 'Print hello world'):
        pass

t1 = threading.Thread(target=t1_send)
t2 = threading.Thread(target=t2_send)

t1.start()
t2.start()

t1.join()
t2.join()
victoryhb commented 11 months ago

Hi, it seems that the example code no longer works. Poe seems to give the same response when two different messages are sent to the same bot at the same time.