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

Commit

Permalink
warning messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio committed Jun 6, 2023
1 parent 69e84a6 commit 0c62cce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/revChatGPT/V1.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,11 +476,13 @@ def post_messages(
"Conversation ID %s not found in conversation mapping, try to get conversation history for the given ID",
conversation_id,
)
with contextlib.suppress(Exception):
try:
history = self.get_msg_history(conversation_id)
self.conversation_mapping[conversation_id] = history[
"current_node"
]
except requests.exceptions.HTTPError:
print("Conversation unavailable")
else:
self.__map_conversations()
if conversation_id in self.conversation_mapping:
Expand Down Expand Up @@ -706,7 +708,7 @@ def get_msg_history(self, convo_id: str, encoding: str | None = None) -> list:
self.__check_response(response)
if encoding is not None:
response.encoding = encoding
return json.loads(response.text)
return response.json()

@logger(is_timed=True)
def gen_title(self, convo_id: str, message_id: str) -> str:
Expand Down

0 comments on commit 0c62cce

Please sign in to comment.