Skip to content

Commit

Permalink
force switch to local conversation list before openai tuning is complete
Browse files Browse the repository at this point in the history
Signed-off-by: pengzhile <[email protected]>
  • Loading branch information
pengzhile committed Mar 8, 2023
1 parent 0c83491 commit 641148e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pandora/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-

__version__ = '0.6.4'
__version__ = '0.6.5'
3 changes: 2 additions & 1 deletion src/pandora/openai/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,11 @@ def list_models(self, raw=False):
return result['models']

def list_conversations(self, offset, limit, raw=False):
force = True
url = 'https://apps.openai.com/api/conversations?offset={}&limit={}'.format(offset, limit)
resp = self.session.get(url=url, headers=self.basic_headers, **self.req_kwargs)

if resp.status_code != 200 or '"items":{}' in resp.text.replace(' ', ''):
if resp.status_code != 200 or force:
my_list = ConversationOfficial.wrap_conversation_list(offset, limit)
return self.__wrap_response(my_list) if raw else my_list

Expand Down

0 comments on commit 641148e

Please sign in to comment.