forked from joshcho/ChatGPT.el
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chatgpt_dev.py
53 lines (34 loc) · 1.67 KB
/
chatgpt_dev.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# chatgpt.py
import sys
import datetime
import importlib
# import imp
sys.path.insert(0, '/Users/carlos/Downloads/chatgpt-wrapper')
from chatgpt_wrapper.chatgpt import ChatGPT
# from chatgpt import ChatGPT
# ChatGPT = imp.load_source('ChatGPT', '/Users/carlos/Downloads/chatgpt-wrapper/chatgpt_wrapper/chatgpt.py')
# spec = importlib.util.spec_from_file_location('ChatGPT', '/Users/carlos/Downloads/chatgpt-wrapper/chatgpt_wrapper/chatgpt.py')
# chatgpt_module = importlib.util.module_from_spec(spec)
# spec.loader.exec_module(chatgpt_module)
# print("chatgpt module is:{0}".format(chatgpt_module.ChatGPT))
# ChatGPT = chatgpt_module.ChatGPT
bot = None
if bot == None:
bot = ChatGPT(headless = False)
print("chatgpt bot is:{0}".format(bot))
# bot.select_conversation_id("b912cdb8-a77e-4932-8f65-6e800b654098")
# bot.set_conversation_id_parent_message_id("e6db6053-ae64-410f-b979-02fc24b8ad55","a251de7d-e536-49c2-8a42-25f6fce7409f")
# response = bot.ask("what is sum of 1+2 ")
global conversation_info
# conversation_info = bot.get_conversation_info("e6db6053-ae64-410f-b979-02fc24b8ad55")
print("try to swtich conversation")
# bot.switch_to_conversation("e6db6053-ae64-410f-b979-02fc24b8ad55")
# print("response is: {0}".format(response))
# response = bot.ask("not it is 4 ")
# print("response is: {0}".format(response))
current_time = datetime.datetime.now(); formatted_time = current_time.strftime("%Y-%m-%d %H:%M:%S")
print("after switch conversation, try to ask")
# response = bot.ask("what is my name and now is:{0}".format(formatted_time))
# print("response is: {0}".format(response))
# input_result = input("Press Enter to continue...")
import code; code.interact(local=locals())