Chat with PI your friendly AI via telegram
this is a python script that allows you to chat with Pi ai from https://pi.ai/talk viA TELEGRAM. Pi, your personal AI, is an innovative platform designed to be more than just a typical chatbot.
-
Personal Intelligence:
- The name "Pi" stands for "personal intelligence". Unlike traditional AI models, Pi aims to be more relatable and emotionally aware.
- It prioritizes conversations with people, emphasizing empathy and understanding. Rather than just providing factual answers, Pi strives to be a supportive companion.
-
Supportive and Conversational:
- Pi isn't solely about productivity or search queries. It's more like chatting with a chatty friend.
- When you interact with Pi, you'll notice that it takes a moment to think before responding. This deliberate pace creates a more natural and engaging conversation.
-
Emotional Intelligence (EQ):
- Pi isn't just smart; it also possesses good emotional intelligence.
- Whether you need advice, want to discuss something on your mind, or seek creative inspiration, Pi is there to listen and engage.
-
Accessible and Available:
- You can find Pi at this link ¹.
- It's like having a virtual companion—ready to chat, offer insights, or simply be there whenever you need it.
This script enables you to interact with Pi AI via the terminal. Additionally, you can modify it to communicate with the AI in various other ways. To use this script effectively, you'll need two key pieces of information:
- The cookies
- The chat ID
To obtain these, you must first create an account at Pi AI's website.
Once you have made your account, open your browser's developer tools to capture the required information. Here’s how you can open the developer tools across different browsers:
- Windows/Linux: Press
Ctrl + Shift + I
orF12
. Alternatively, right-click on any page element and select "Inspect" from the context menu. - macOS: Press
Cmd + Option + I
. You can also right-click on any page element and select "Inspect".
- Windows/Linux: Press
Ctrl + Shift + I
orF12
to open the toolbox. For just the console, useCtrl + Shift + K
. - macOS: Press
Cmd + Option + I
for the toolbox. For just the console, useCmd + Option + K
.
- macOS: First, ensure that the developer menu is enabled by going to Safari > Preferences > Advanced, and checking the box at the bottom that says "Show Develop menu in menu bar". Once enabled, you can press
Cmd + Option + I
to open the developer tools.
- Windows/Linux: Press
F12
orCtrl + Shift + I
. - macOS: Press
Cmd + Option + I
.
- Windows/Linux: Press
Ctrl + Shift + I
or useCtrl + Shift + C
to directly go into the element inspector mode. - macOS: Press
Cmd + Option + I
.
After accessing the developer tools:
- Navigate to the Network tab.
- Send a message to the AI.
- Look for the network request named
chat
.
now tap on 'chat'
The cookies can be found in the request headers
look for the cookie in the request header
look for the conversation id in the payload section
now when you run the script provide the session cookie and chat id please feel free to improve upon the script.
now fill in the cookie and chat id in the telegram bot code and enjoy chatting with PI via the terminal.