Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.

Commit

Permalink
init with parent_id
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry-Jing committed Dec 9, 2022
1 parent 1b2ab9e commit b5bbf5b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
11 changes: 7 additions & 4 deletions src/asyncChatGPT/asyncChatGPT.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class Chatbot:
:param conversation_id: The conversation ID
:type conversation_id: :obj:`str`, optional
:param parent_id: The parent ID
:type parent_id: :obj:`str`, optional
:param debug: Whether to enable debug mode
:type debug: :obj:`bool`, optional
Expand All @@ -42,19 +45,19 @@ class Chatbot:
:return: None or Exception
"""
config: json
conversation_id: str
parent_id: str
conversation_id: uuid
parent_id: uuid
base_url: str
headers: dict
conversation_id_prev: str
parent_id_prev: str

def __init__(self, config, conversation_id=None, debug=False, refresh=True) -> Exception:
def __init__(self, config, conversation_id=None, parent_id=None, debug=False, refresh=True) -> Exception:
self.debugger = Debugger(debug)
self.debug = debug
self.config = config
self.conversation_id = conversation_id
self.parent_id = generate_uuid()
self.parent_id = parent_id if parent_id else generate_uuid()
self.base_url = "https://chat.openai.com/"
if ("session_token" in config or ("email" in config and "password" in config)) and refresh:
self.refresh_session()
Expand Down
11 changes: 7 additions & 4 deletions src/revChatGPT/revChatGPT.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class Chatbot:
:param conversation_id: The conversation ID
:type conversation_id: :obj:`str`, optional
:param parent_id: The parent ID
:type parent_id: :obj:`str`, optional
:param debug: Whether to enable debug mode
:type debug: :obj:`bool`, optional
Expand All @@ -41,19 +44,19 @@ class Chatbot:
:return: None or Exception
"""
config: json
conversation_id: str
parent_id: str
conversation_id: uuid
parent_id: uuid
base_url: str
headers: dict
conversation_id_prev: str
parent_id_prev: str

def __init__(self, config, conversation_id=None, debug=False, refresh=True) -> Exception:
def __init__(self, config, conversation_id=None, parent_id=None, debug=False, refresh=True) -> Exception:
self.debugger = Debugger(debug)
self.debug = debug
self.config = config
self.conversation_id = conversation_id
self.parent_id = generate_uuid()
self.parent_id = parent_id if parent_id else generate_uuid()
self.base_url = "https://chat.openai.com/"
if ("session_token" in config or ("email" in config and "password" in config)) and refresh:
self.refresh_session()
Expand Down

0 comments on commit b5bbf5b

Please sign in to comment.