Skip to content

Commit

Permalink
'Refactored by Sourcery' (#756)
Browse files Browse the repository at this point in the history
Co-authored-by: Sourcery AI <>
  • Loading branch information
sourcery-ai[bot] authored May 5, 2023
1 parent 000902a commit b449276
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
3 changes: 0 additions & 3 deletions framework/llm/quora/poe_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ async def rollback(self):
async def on_destoryed(self):
"""当会话被重置时,此函数被调用"""
self.client.send_chat_break(self.bot_name.value)
if self.custom_bot:
# TODO: delete the bot
pass

async def preset_ask(self, role: str, prompt: str):
if role.endswith('bot') or role in {'assistant', 'poe'}:
Expand Down
4 changes: 1 addition & 3 deletions framework/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ def __init__(self, alt: str = None, **kwargs):
super().__init__(**kwargs)

def __str__(self):
if self.alt:
return f"[图: {self.alt}]"
return super().__str__()
return f"[图: {self.alt}]" if self.alt else super().__str__()

async def get_bytes(self) -> bytes:
"""尝试获取消息元素的 bytes, 注意, 你无法获取并不包含 url 且不包含 base64 属性的本元素的 bytes.
Expand Down

0 comments on commit b449276

Please sign in to comment.