Skip to main content

A small tool for automating collecting data from ChatGPT

Project description

image

A small tool for automating collecting data from ChatGPT over long periods of time.

Stargazers Releases Issues

What does it do?

ChatGPT currently limits the number of questions that users may ask per hour. The goal of this project is to allow users to just leave their computers on for extended periods of time to collect large amounts of responses from ChatGPT. There might not be a lot of practical use for this. Its main use is in research or data analysis.

Install as a Python Library

pip install sleepyask

image

Documentation

Using the Official ChatGPT API

Authentication

You are required to provide an organization as well as an API Key
If you are not part of an organization, use this: org-PuBY7H2zebXAGmpU6YsRQ3c1
Your create an API Key on OpenAI by

clicking on your profile picture on the top-right > View API Keys > Create new secret key.  

Sample config

config = {
	"organization": "Your OpenAI organization",
	"api_key": "Your OpenAI api key"
}

Sample code

from sleepyask.openai import chat

# Your ChatGPT login information
config_1 = {
	"organization": "Your ChatGPT organization",
	"api_key": "Your ChatGPT api key"
}

config_2 = {
	"organization": "Your ChatGPT organization",
	"api_key": "Your ChatGPT api key"
}

configs = [config_1, config_2]

## List of questions you would like to ask ChatGPT
question_list = [
  'What is 1 + 1?',
  'What is 1 + 2?',
  'What is 1 + 3?'
]

# The filename in which you would like your responses to be stored.
output_file_path = 'draw.json'  

# Run sleepy_ask
chat.ask(configs=configs,
           questions=question_list,
           output_file_path=output_file_path,
           verbose=True)

Using the Unofficial ChatGPT API

Authentication

There are multiple ways to configure authentication with ChatGPT:
Email + Password

config = {
  "email": "Your ChatGPT email",
  "password": "Your ChatGPT password"
}

Access Token
Access token can be found here: https://chat.openai.com/api/auth/session

config = {
  "access_token": "Your access token"
}

image

Sleepyask supports the use of multiple accounts

You can use multiple accounts to collect responses at a significantly quicker rate.
Example usage:

from sleepyask.free import chat

# Your ChatGPT login information
config_1 = {
  "email": "Your ChatGPT email",
  "password": "Your ChatGPT password"
}

config_2 = {
  "email": "Your ChatGPT email",
  "password": "Your ChatGPT password"
}

configs = [config_1, config_2]

# List of questions you would like to ask ChatGPT
question_list = [
  'What is 1 + 1?',
  'What is 1 + 2?',
  'What is 1 + 3?'
]

# The filename in which you would like your responses to be stored.
output_file_path = 'draw.json'  

# Run sleepy_ask
chat.ask(configs=configs,
           questions=question_list,
           output_file_path=output_file_path,
           verbose=True)

Get involved

  • 🐛 Found a bug or interested in adding a feature? - Create an issue
  • 🤗 Want to help? - Create a pull-request!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sleepyask-3.0.0.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

sleepyask-3.0.0-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file sleepyask-3.0.0.tar.gz.

File metadata

  • Download URL: sleepyask-3.0.0.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for sleepyask-3.0.0.tar.gz
Algorithm Hash digest
SHA256 7825fe41e8f575e36465ed9f4d37cfee32b1275f7c818b8fb2ab6ce7f43f5949
MD5 87c8ee2365deeb4fead0120ca30e12f1
BLAKE2b-256 44ca93aff06e6ef938e199bb9653cde8be584fd23eb3d8178fd22cc14291352c

See more details on using hashes here.

File details

Details for the file sleepyask-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: sleepyask-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 19.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for sleepyask-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c5d034fb6d9c9f5a0543177bcc7871de681f7f98fadcf82b47cffb92e897c27
MD5 adbd93a3d2a20cbb1976d180e186dab6
BLAKE2b-256 44315770e0e1ec81687b3ab93a20aca3c3a6ee59a545e3dbde6dd88e141315fe

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page