You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 7, 2023. It is now read-only.
As I remark the api python is n't working but the "python3 -m pyChatGPT" is still functional,
I tried to do this wrapper :
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import pexpect
import time
import sys
p = pexpect.spawnu('python3 -m pyChatGPT')
p.logfile = open("mylog", "w")
p.timeout=300
p.expect('Please enter your session token:')
p.sendline('**Here is my session**')
#p.expect('Please enter your conversation id')
p.expect('if you want to continue old chat')
p.sendline('**uuid**')
p.expect('You')
#p.interact()
time.sleep(5)
Question=sys.argv[1]
p.sendline(Question)
p.expect(Question)
p.expect('ChatGPT:')
time.sleep(1)
p.expect('You')
#print("before :")
print(p.before)
If useful, it s now functional ( sometimes ), but if the "question" is on several lines, it takes only the first line :(
As I remark the api python is n't working but the "python3 -m pyChatGPT" is still functional,
I tried to do this wrapper :
If useful, it s now functional ( sometimes ), but if the "question" is on several lines, it takes only the first line :(