Comments (5)
Hi. I cannot reproduce the same issue.
This is most likely due to passing an incorrect/malformatted conversation_id
or parent_id
to the ChatGPT
class.
Can you please check if you are inputting a correct value?
from pychatgpt.
I don't use conversation_id and parent_id, every conversation is independent.
BTW, should I use below code every time I send_message? or I will do it once among the 1000 sentences generation?
api.refresh_auth() # refresh the authorization token & cf cookies
api.reset_conversation() # reset the conversation
from pychatgpt.
What do you mean by to generate 1000 sentences. May I have the code snippet or the prompt that you are using?
Also, you don't need to use refresh_auth()
as it is done every time when you use send_message()
.
Normally, the library will keep conversation just like the normal ChatGPT website.
If you want to reset the conversation, you can use reset_conversation()
.
from pychatgpt.
I have 1000 sentences in a csv file and I want to use chatGPT to generate 1000 specific paraphrases.
session_token = 'ey...w' # `__Secure-next-auth.session-token` cookie from https://chat.openai.com/chat
api = ChatGPT(session_token) # auth with session token
api2 = ChatGPT(email='[email protected]', password='zzz') # auth with email and password
api3 = ChatGPT(email='[email protected]', password='zzz') # auth with email and password
data = pd.read_csv('sentences1000.csv', header=0, names=['sentences'])
prompt = 'paraprase this sentence:'
def chatgpt_response(message, myapi):
resp = myapi.send_message(message)
return resp['message']
def get_results(data, prompt):
results = []
prompt_data = prompt + data
for i,v in prompt_data['sentences'].items():
try:
result = chatgpt_response(v, api)
# api.refresh_auth() # refresh the authorization token
api.reset_conversation() # reset the conversation
except Exception as e:
print(e)
try:
result = chatgpt_response(v, api2)
# api2.refresh_auth() # refresh the authorization token
api2.reset_conversation() # reset the conversation
except Exception as e:
print(e)
result = chatgpt_response(v, api3)
# api3.refresh_auth() # refresh the authorization token
api3.reset_conversation() # reset the conversation
print(result)
results.append(result)
results_pd = pd.DataFrame(results, columns=['outputs'])
results_pd.to_csv('chatgpt_results.csv', index=False)
return results
from pychatgpt.
I have 1000 sentences in a csv file and I want to use chatGPT to generate 1000 specific paraphrases.
This probably triggered the rate limit of ChatGPT.
AFAIK, ChatGPT has a limit of 45 requests/minute and this library does not have rate limit handling yet.
You can try to slow it down by adding time.sleep
.
from pychatgpt.
Related Issues (20)
- chatgpt plus: can we use pychatgpt? HOT 1
- pyChatGPT doesn't work for edge.
- pychatgpt doesn't work for two response
- pychatgpt doesn't work for two response in last version
- today pyChatgpt not working anymore ... HOT 5
- anyone help this problem
- how to use pychatgpt by email and password without cash
- TimeoutException HOT 18
- python example wrapper with 'python3 -m pyChatGPT' ?
- Login button update?
- Crash on session_token = chatgptapi ----- api = ChatGPT(session_token)
- GRPC error HOT 1
- response['message'] could not get the returned data HOT 10
- 'NoneType' object has no attribute 'group' HOT 2
- Made a library that has a similar structure to this library, but is maintained and improved
- help:list index out of range HOT 2
- Add a support for system prompts
- list index out of range
- do not work HOT 3
- version chrome_driver problem HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pychatgpt.