PoePT is a simple Selenium Python package that provides automation for interacting with the Poe chatbots. Giving you access to multiple chatbots like:
- gpt-4o
- gpt-4
- Assistant
- Web-Search
- Claude-3.5-Sonnet
- Claude-3-Sonnet
- Claude-3-Opus
- Claude-3-Haiku
- Gemini-1.5-Flash-128k
- Gemini-1.5-Pro
- Claude-Instant
- Mistral-Large
- Mistral-Medium
- Gemini-1.5-Flash-1M
- Gemini-1.5-Pro-2M
brew install --cask chromedriver
pip install git+https://github.com/dzianisv/poept
python3 -m poept.server
| start http OpenAI compatible APIpython3 -m poept.client
| start client with interactive promptpython3 -m poept.langchain.client
| connects to the OpenAI compatible API and opens an interactive prompt to talk
You can install PoePT using pip:
brew install --cask chromedriver
pip install git+https://github.com/dzianisv/poept
- a POE account (make one at poe.com)
- Chrome
Here's an example of how to use PoePT to log in to the Poe chatbot and ask a question:
- create connection with bot
- login is needed every time but will only ask for code if you havent logged in before
from poept import PoePT
bot = PoePT(email=os.environ.get("POE_EMAIL"))
- Once you're logged in, you can ask a question to the chatbot of your choice and retrieve the result:
result = bot.ask(model="gpt-4o", prompt="Who did invent GPT model?")
print(result)
- When you're done with your session, be sure to close the connection:
bot.close()
Examples: link
- POE_HEADLESS=true
- POE_EMAIL=
- status of client
status = bot.stat
Status | Meanings |
---|---|
false | the bot isn't connected and cant answer |
ready | the bot is connected and ready to answer |
wait | the bot is generating an answer |
- Get Live Updating Result
from poept import PoePT
import threading
bot = PoePT(email=os.environ.get("POE_EMAIL"))
def ask_bot():
bot.ask("Sage", "Write A Lorem Ipsum")
threading.Thread(target=ask_bot).start()
while bot.stat == "wait":
print(bot.stat)
print('\r' + bot.response, end='')
- Live voice Input
print("Listening...")
question = bot.livevoice(timeout=2)
print("Recording complete.")
result = bot.ask(bot="sage", prompt=question)
print("\nresponse:", result)
- File voice Input
question = bot.filevoice("audio.wav")
result = bot.ask(bot="sage", prompt=question)
print("\nresponse:", result)
- clear cookies
status = bot.status()
- configure classes and keys
bot.config(
website="https://poe.com/",
email_key=f"//button[contains(translate(., '{letters[0]}', '{letters[-1]}' ), 'email')]",
email_area="input[class*=EmailInput]",
code_area="input[class*=CodeInput",
go_key=f"//button[contains(translate(., '{letters[0]}', '{letters[-1]}' ), 'go')]",
log_key=f"//button[contains(translate(., '{letters[0]}', '{letters[-1]}' ), 'log')]",
talk_key=f"//button[contains(translate(., '{letters[0]}', '{letters[-1]}' ), 'talk')]",
send_key="button[class*=SendButton]",
text_area="textarea[class*=TextArea]",
clear_key="button[class*=ChatBreak]",
msg_element="ChatMessage_messageRow__7yIr2"
)
Here's the updated table:
KEY | Value |
---|---|
website | "https://poe.com/" |
clear_key | "button[class*=ChatBreak]" |
code_area | "input[class*=VerificationCodeInput]" |
talk_key | "//button[contains(translate(., 'a', 'A'), 'talk')]" |
email_area | "input[class*=EmailInput]" |
email_key | "//button[contains(translate(., 'a', 'A'), 'email')]" |
go_key | "//button[contains(translate(., 'a', 'A'), 'go')]" |
log_key | "//button[contains(translate(., 'a', 'A'), 'log')]" |
text_area | "textarea[class*=TextArea]" |
send_key | "button[class*=SendButton]" |
chat_element | "div[class*=ChatMessagesView_infiniteScroll]" |
msg_element | "div[class*=ChatMessage_messageRow]" |
If you encounter a bug open an issue on the GitHub repository. Pull requests are also welcome!