sleepyask
v7.1.0

一種用於從GPT-3.5型號中收集大量響應的小工具。

chatgpt費率限制了用戶可能提出的問題的數量。該項目的目的是允許用戶將計算機放在很長一段時間內,以從Chatgpt收集大量響應。歡迎捐款! ?
要安裝睡覺,請執行以下操作之一:
> pip install sleepyask
> py -m pip install sleepyask
> python -m pip install sleepyask該項目還取決於以下軟件包
> openai
您需要提供組織以及API密鑰
organization - 您的OpenAI組織ID。在這裡獲取:https://platform.openai.com/account/org-settingsapi_key您OpenAI API密鑰。得到它: > 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 - 這指定要提出問題的工人數量。您可以讓多個工人並行提出問題。建議您不要將用戶憑據直接存儲在代碼中。而是使用python-dotenv之類的東西將您的憑據存儲在另一個文件中。
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 )