1-1 到OpenAI的網站
go to https://chat.openai.com/chat
1-3 選"__Secure-next-auth.session-token"並複製後面一長串的值
check "__Secure-next-auth.session-token" and copy the value
from chatgpt_api import chatgpt_api
api = chatgpt_api(
# your token
)
api.open_browser()
# 傳入訊息
# send message to chatGPT
resp = api.send_message('good morning')
print(resp)
你也可以指定輸出語言,目前只提供繁簡中文和英文
you can also specify a language you want chaTGPT replay with, now only English, ZH-TW and ZH-CN are supported.
resp = api.send_message('What can I do if I lose my sleep?', 'zhtw')
print(resp)