Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: 全新预设系统、插件系统,实现多模态支持高度可自定义化的 AI 助手 (Sourcery refactored) #756

Merged
merged 1 commit into from
May 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Comment on lines -76 to -78
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function PoeAdapter.on_destoryed refactored with the following changes:

This removes the following comments ( why? ):

# TODO: delete the bot


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__()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ImageElement.__str__ refactored with the following changes:


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