# PoePT
<img src="https://psc2.cf2.poecdn.net/assets/_next/static/media/poeFullWhiteMultibot.e2e2745a.svg" width="100" />
PoePT is a simple Selenium Python package that provides automation for interacting with the Poe chatbots.
Giving you access to multiple chatbots like:
- Assistant
- ChatGPT-3
- ChatGPT-4
- Gemini
- Bard
- Claude-Instant
<br />
## Installation
You can install PoePT using pip:
```
py -m pip install poept -U
```
or
```
py -m pip install git+https://github.com/Saikyo0/poept@main
```
<br />
## Requirements:
- a POE account (make one at poe.com)
- Chrome
<br />
## Usage
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
```python
from poept import PoePT
bot = PoePT()
bot.login("your_email@example.com")
```
- Once you're logged in, you can ask a question to the chatbot of your choice and retrieve the result
```python
result = bot.ask(newchat=False, bot="Assistant", prompt="hello")
print(result)
```
- the `newchat` parameter is used for either staying in the same chat for upcoming prompts or making new chat, but its ignored on the first question
- When you're done with your session, be sure to close the connection:
```python
bot.close()
```
<br />
<h2> Examples: <a href="https://github.com/Saikyo0/PoePT/blob/main/poept/examples"> link </a></h2>
<br />
## Extra
- status of client
```python
status = bot.status
```
| 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 |
<br />
- Get Live Updating Result
```python
from poept import PoePT
import threading
bot = PoePT()
bot.login("<email>@gmail.com")
prompt = "Write A Lorem Ipsum"
def ask_bot():
print("> "+prompt)
bot.ask(bot="Assistant", prompt=prompt)
threading.Thread(target=ask_bot).start()
while True:
if bot.prompt == prompt:
if bot.status == "wait":
print(bot.status)
print('\r' + bot.response, end='')
elif bot.status == "ready":
break
```
<br />
- Image Response
```python
prompt = "An Apple"
result = bot.ask(bot="StableDiffusion3-2B", prompt=prompt, img_output=True)
print(result)
```
<br />
- Live voice Input
```python
print("Listening...")
prompt = bot.live_voice(timeout=4)
print("Recording complete.")
result = bot.ask(bot="Assistant", prompt=prompt)
print("\nresponse:", result)
```
- File voice Input
```python
audio_file = os.path.abspath("audio.wav")
prompt = bot.file_voice(audio_file)
result = bot.ask(newchat=False, bot="Assistant", prompt=prompt)
print("\nresponse:", result)
```
<br />
- Cookie control
- default cookies path: `./saved_cookies/cookies.txt`
```python
bot.clear_cookies()
bot.load_cookies("path")
```
<br />
- configure classes and keys
```python
bot.config(self, website="https://poe.com/", #Base URL of POE.
email_form=".textInput_input__9YpqY", #CSS selector for the email input form.
go_btn=".Button_buttonBase__Bv9Vx.Button_primary__6UIn0", #CSS selector for the 'Go' button.
code_form=".VerificationCodeInput_verificationCodeInput__RgX85", #CSS selector for the verification code input div.
login_btn=".Button_buttonBase__Bv9Vx.Button_primary__6UIn0", #CSS selector for the login button.
query_input_form=".GrowingTextArea_textArea__ZWQbP", #CSS selector for the chat input div.
query_send_btn=".ChatMessageSendButton_sendButton__4ZyI4", #CSS selector for the chat send button.
clear_key_btn=".ChatBreakButton_button__zyEye", #CSS selector for the clear chat button.
file_input_form=".ChatMessageFileInputButton_input__svNx4", #CSS selector for the file input div.
file_input_box=".ChatMessageInputAttachments_container__AAxGu", #CSS selector for the file input box in chat.
voice_input_btn=".ChatMessageVoiceInputButton_button__NjXno", #CSS selector for the voice input button.
msg_element=".ChatMessage_chatMessage__xkgHx", #CSS selector for the response message element div.
):
```
<br />
## Contributing
If you encounter a bug open an issue on the GitHub repository. Pull requests are also welcome!
<a href=https://github.com/saikyo0>saikyo0</a>
Raw data
{
"_id": null,
"home_page": "https://github.com/saikyo0/PoePT",
"name": "PoePT",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "POE, QUORA, PYTHON",
"author": "Saikyo0",
"author_email": "mamaexus@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e6/57/789fd5cc89297b1ae5ff1d2b6debeba470da7dd0d570a3a2dfeb37a9cab8/poept-0.3.1.tar.gz",
"platform": null,
"description": "# PoePT\r\n\r\n<img src=\"https://psc2.cf2.poecdn.net/assets/_next/static/media/poeFullWhiteMultibot.e2e2745a.svg\" width=\"100\" />\r\n\r\n\r\nPoePT is a simple Selenium Python package that provides automation for interacting with the Poe chatbots.\r\nGiving you access to multiple chatbots like:\r\n- Assistant\r\n- ChatGPT-3\r\n- ChatGPT-4\r\n- Gemini\r\n- Bard\r\n- Claude-Instant \r\n <br />\r\n\r\n\r\n## Installation\r\nYou can install PoePT using pip:\r\n```\r\npy -m pip install poept -U\r\n```\r\nor\r\n```\r\npy -m pip install git+https://github.com/Saikyo0/poept@main\r\n``` \r\n<br />\r\n\r\n\r\n## Requirements:\r\n- a POE account (make one at poe.com) \r\n- Chrome\r\n\r\n \r\n<br />\r\n\r\n## Usage\r\nHere's an example of how to use PoePT to log in to the Poe chatbot and ask a question:\r\n\r\n- create connection with bot\r\n- login is ***needed*** every time but will only ask for code if you havent logged in before\r\n```python\r\nfrom poept import PoePT\r\n\r\nbot = PoePT()\r\nbot.login(\"your_email@example.com\") \r\n```\r\n- Once you're logged in, you can ask a question to the chatbot of your choice and retrieve the result\r\n\r\n```python\r\nresult = bot.ask(newchat=False, bot=\"Assistant\", prompt=\"hello\")\r\nprint(result)\r\n```\r\n- the `newchat` parameter is used for either staying in the same chat for upcoming prompts or making new chat, but its ignored on the first question\r\n- When you're done with your session, be sure to close the connection:\r\n\r\n```python\r\nbot.close()\r\n```\r\n\r\n<br />\r\n\r\n<h2> Examples: <a href=\"https://github.com/Saikyo0/PoePT/blob/main/poept/examples\"> link </a></h2>\r\n\r\n<br />\r\n\r\n## Extra\r\n\r\n- status of client\r\n\r\n```python\r\nstatus = bot.status\r\n```\r\n| Status | Meanings |\r\n|--------|------------------------------------------|\r\n| false | the bot isn't connected and cant answer |\r\n| ready | the bot is connected and ready to answer |\r\n| wait | the bot is generating an answer |\r\n \r\n<br />\r\n\r\n- Get Live Updating Result\r\n\r\n```python\r\nfrom poept import PoePT\r\nimport threading\r\n\r\nbot = PoePT()\r\nbot.login(\"<email>@gmail.com\") \r\n\r\nprompt = \"Write A Lorem Ipsum\"\r\n\r\ndef ask_bot():\r\n print(\"> \"+prompt)\r\n bot.ask(bot=\"Assistant\", prompt=prompt)\r\n\r\nthreading.Thread(target=ask_bot).start()\r\nwhile True:\r\n if bot.prompt == prompt:\r\n if bot.status == \"wait\":\r\n print(bot.status)\r\n print('\\r' + bot.response, end='')\r\n elif bot.status == \"ready\":\r\n break\r\n```\r\n\r\n<br />\r\n\r\n- Image Response\r\n\r\n```python\r\nprompt = \"An Apple\"\r\nresult = bot.ask(bot=\"StableDiffusion3-2B\", prompt=prompt, img_output=True)\r\nprint(result)\r\n```\r\n\r\n<br />\r\n\r\n- Live voice Input\r\n```python\r\nprint(\"Listening...\") \r\nprompt = bot.live_voice(timeout=4)\r\nprint(\"Recording complete.\")\r\nresult = bot.ask(bot=\"Assistant\", prompt=prompt)\r\nprint(\"\\nresponse:\", result)\r\n```\r\n\r\n- File voice Input\r\n```python\r\naudio_file = os.path.abspath(\"audio.wav\")\r\nprompt = bot.file_voice(audio_file)\r\nresult = bot.ask(newchat=False, bot=\"Assistant\", prompt=prompt)\r\nprint(\"\\nresponse:\", result)\r\n```\r\n \r\n<br />\r\n\r\n- Cookie control\r\n- default cookies path: `./saved_cookies/cookies.txt`\r\n\r\n```python\r\nbot.clear_cookies()\r\nbot.load_cookies(\"path\")\r\n```\r\n \r\n<br />\r\n\r\n- configure classes and keys\r\n```python\r\nbot.config(self, website=\"https://poe.com/\", #Base URL of POE.\r\n email_form=\".textInput_input__9YpqY\", #CSS selector for the email input form.\r\n go_btn=\".Button_buttonBase__Bv9Vx.Button_primary__6UIn0\", #CSS selector for the 'Go' button.\r\n code_form=\".VerificationCodeInput_verificationCodeInput__RgX85\", #CSS selector for the verification code input div.\r\n login_btn=\".Button_buttonBase__Bv9Vx.Button_primary__6UIn0\", #CSS selector for the login button.\r\n query_input_form=\".GrowingTextArea_textArea__ZWQbP\", #CSS selector for the chat input div.\r\n query_send_btn=\".ChatMessageSendButton_sendButton__4ZyI4\", #CSS selector for the chat send button.\r\n clear_key_btn=\".ChatBreakButton_button__zyEye\", #CSS selector for the clear chat button.\r\n file_input_form=\".ChatMessageFileInputButton_input__svNx4\", #CSS selector for the file input div.\r\n file_input_box=\".ChatMessageInputAttachments_container__AAxGu\", #CSS selector for the file input box in chat.\r\n voice_input_btn=\".ChatMessageVoiceInputButton_button__NjXno\", #CSS selector for the voice input button.\r\n msg_element=\".ChatMessage_chatMessage__xkgHx\", #CSS selector for the response message element div.\r\n ):\r\n```\r\n<br />\r\n\r\n## Contributing \r\nIf you encounter a bug open an issue on the GitHub repository. Pull requests are also welcome! \r\n\r\n<a href=https://github.com/saikyo0>saikyo0</a>\r\n",
"bugtrack_url": null,
"license": null,
"summary": "A Simple Selenium Based Python Library For Quora`s Poe.com",
"version": "0.3.1",
"project_urls": {
"Download": "https://github.com/Saikyo0/PoePT/archive/refs/tags/v0.3.1.tar.gz",
"Homepage": "https://github.com/saikyo0/PoePT"
},
"split_keywords": [
"poe",
" quora",
" python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e657789fd5cc89297b1ae5ff1d2b6debeba470da7dd0d570a3a2dfeb37a9cab8",
"md5": "9a4dcfd375e0c092d90d332805014cce",
"sha256": "732d149b0ca03590d01b6111088403e73b3d7badee64e0112e3b0de265214850"
},
"downloads": -1,
"filename": "poept-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "9a4dcfd375e0c092d90d332805014cce",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 18867,
"upload_time": "2024-07-21T19:30:10",
"upload_time_iso_8601": "2024-07-21T19:30:10.160945Z",
"url": "https://files.pythonhosted.org/packages/e6/57/789fd5cc89297b1ae5ff1d2b6debeba470da7dd0d570a3a2dfeb37a9cab8/poept-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-21 19:30:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "saikyo0",
"github_project": "PoePT",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "pyaudio",
"specs": []
},
{
"name": "seleniumbase",
"specs": []
},
{
"name": "SpeechRecognition",
"specs": []
}
],
"lcname": "poept"
}