Skip to content

Pi ai API .This is a python script that allows you to chat with Pi ai from https://pi.ai/talk, via a terminal

License

Notifications You must be signed in to change notification settings

Debronejacobs/Pi-AI-python-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Pi-AI-python-client

this is a python script that allows you to chat with Pi ai from https://pi.ai/talk via the terminal Pi, your personal AI, is an innovative platform designed to be more than just a typical chatbot.

  1. 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.
  2. 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.
  3. 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.
  4. 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:

  1. The cookies
  2. The chat ID

To obtain these, you must first create an account at Pi AI's website.

Accessing Browser Developer Tools

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:

Google Chrome

  • Windows/Linux: Press Ctrl + Shift + I or F12. 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".

Mozilla Firefox

  • Windows/Linux: Press Ctrl + Shift + I or F12 to open the toolbox. For just the console, use Ctrl + Shift + K.
  • macOS: Press Cmd + Option + I for the toolbox. For just the console, use Cmd + Option + K.

Safari

  • 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.

Microsoft Edge

  • Windows/Linux: Press F12 or Ctrl + Shift + I.
  • macOS: Press Cmd + Option + I.

Opera

  • Windows/Linux: Press Ctrl + Shift + I or use Ctrl + Shift + C to directly go into the element inspector mode.
  • macOS: Press Cmd + Option + I.

Capturing Cookies and Chat ID

After accessing the developer tools:

  • Navigate to the Network tab.
  • Send a message to the AI.
  • Look for the network request named chat.

image

now tap on 'chat'

The cookies can be found in the request headers

image

look for the cookie in the request header

image

image

look for the conversation id in the payload section

image

now when you run the script provide the session cookie and chat id please feel free to improve upon the script.

if interested look you can also chat with it via telegram using this code ......

About

Pi ai API .This is a python script that allows you to chat with Pi ai from https://pi.ai/talk, via a terminal

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages