A small tool for collecting data from ChatGPT over long periods of time.
💬 What does it do?
ChatGPT rate limits the number of questions users may ask. 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. Contributions are welcome! 🤗
💬 Installation
To install sleepyask, do one of the following:
> pip install sleepyask
> py -m pip install sleepyask
> python -m pip install sleepyask
This project also depends on the following packages
> openai
💬 Usage
Authentication
You are required to provide an organization as well as an API Key
organization- Your OpenAI organization ID. Get it here: https://platform.openai.com/account/org-settingsapi_key- You OpenAI API Key. To get it:
> Go to https://platform.openai.com/account/api-keys
> Login (if it is required)
> Click on your profile picture on the top-right
> View API Keys
> Create new secret key.
count- This specifies the number of workers to create for asking questions. You can have multiple workers asking questions in parallel.
Sample code
It is recommended that you do not store your user credentials directly in your code. Instead, use something like python-dotenv to store your credentials in another file.
import os
from dotenv import load_dotenv
from sleepyask.chat import Sleepyask
load_dotenv() # take environment variables from .env.
TIMEOUT = 10000
RETRY_TIME = 5
RATE_LIMIT = 5
API_KEY = os.getenv('OPENAI_API_KEY')
# Index should be unique as it will be used to avoid repeat questions
QUESTION_LIST = [
{'index': 1, 'text': 'What is 1 + 1?'},
{'index': 2, 'text': 'What is 1 + 2?'},
{'index': 3, 'text': 'What is 1 + 3?'}
]
OUT_PATH = 'output.jsonl'
CONFIGS = { "model": "gpt-3.5-turbo", "n": 10, "temperature": 0.7}
sleepyask = Sleepyask(configs=CONFIGS,
rate_limit=RATE_LIMIT,
api_key=API_KEY,
timeout=TIMEOUT,
verbose=True,
retry_time=RETRY_TIME)
sleepyask.start(question_list=QUESTION, out_path=OUT_PATH)
💬 Get involved
- 🐛 Found a bug or interested in adding a feature? - Create an issue
- 🤗 Want to help? - Create a pull-request!
Metadata
Release files for sleepyask 7.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sleepyask-7.1.0.tar.gz | 4.9 kB | Without provenance | Details for sleepyask-7.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sleepyask-7.1.0-py3-none-any.whl | Python 3 | none | any | Details for sleepyask-7.1.0-py3-none-any.whl |
Total release size: 10.1 kB
Release files / sleepyask-7.1.0.tar.gz
| Download URL | sleepyask-7.1.0.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
60bac64eb8a4811f86344706547056ebc0b0b1bd4c2ae73d56113af2e1c4a237
|
|
BLAKE2b-256 checksum How to use checksums |
2eed5c669b36895b3a208edea47d86addc59f862a5b10530cc97296a0ee48a08
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / sleepyask-7.1.0-py3-none-any.whl
| Download URL | sleepyask-7.1.0-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c5343ce2a3fb4f1f702f07446e03eea5e15f2f5ceaedf026cc2c48186b236773
|
|
BLAKE2b-256 checksum How to use checksums |
7f031734280300fe51b50cf978cac6bd0973dc3815261f3dc0b0ed588318c97b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for sleepyask 7.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.