mirror of
https://github.com/RockChinQ/QChatGPT.git
synced 2024-11-16 11:42:44 +08:00
perf: 细节优化
This commit is contained in:
parent
91e23b8c11
commit
a3706bfe21
|
@ -42,7 +42,7 @@ class ListOperator(operator.CommandOperator):
|
|||
using_conv_index = index
|
||||
|
||||
if index >= page * record_per_page and index < (page + 1) * record_per_page:
|
||||
content += f"{index} {time_str}: {conv.messages[0].content if len(conv.messages) > 0 else '无内容'}\n"
|
||||
content += f"{index} {time_str}: {conv.messages[0].readable_str() if len(conv.messages) > 0 else '无内容'}\n"
|
||||
index += 1
|
||||
|
||||
if content == '':
|
||||
|
@ -51,6 +51,6 @@ class ListOperator(operator.CommandOperator):
|
|||
if context.session.using_conversation is None:
|
||||
content += "\n当前处于新会话"
|
||||
else:
|
||||
content += f"\n当前会话: {using_conv_index} {context.session.using_conversation.create_time.strftime('%Y-%m-%d %H:%M:%S')}: {context.session.using_conversation.messages[0].content if len(context.session.using_conversation.messages) > 0 else '无内容'}"
|
||||
content += f"\n当前会话: {using_conv_index} {context.session.using_conversation.create_time.strftime('%Y-%m-%d %H:%M:%S')}: {context.session.using_conversation.messages[0].readable_str() if len(context.session.using_conversation.messages) > 0 else '无内容'}"
|
||||
|
||||
yield entities.CommandReturn(text=f"第 {page + 1} 页 (时间倒序):\n{content}")
|
||||
|
|
|
@ -31,13 +31,6 @@ class EnableStage(enum.Enum):
|
|||
"""后处理"""
|
||||
|
||||
|
||||
class AcceptContent(enum.Enum):
|
||||
"""过滤器接受的内容模态"""
|
||||
|
||||
TEXT = enum.auto()
|
||||
|
||||
IMAGE_URL = enum.auto()
|
||||
|
||||
class FilterResult(pydantic.BaseModel):
|
||||
level: ResultLevel
|
||||
"""结果等级
|
||||
|
|
|
@ -57,16 +57,6 @@ class ContentFilter(metaclass=abc.ABCMeta):
|
|||
entities.EnableStage.PRE,
|
||||
entities.EnableStage.POST
|
||||
]
|
||||
|
||||
@property
|
||||
def accept_content(self):
|
||||
"""本过滤器接受的模态
|
||||
|
||||
默认仅接受纯文本
|
||||
"""
|
||||
return [
|
||||
entities.AcceptContent.TEXT
|
||||
]
|
||||
|
||||
async def initialize(self):
|
||||
"""初始化过滤器
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"enable-chat": true,
|
||||
"enable-vision": false,
|
||||
"enable-vision": true,
|
||||
"keys": {
|
||||
"openai": [
|
||||
"sk-1234567890"
|
||||
|
|
Loading…
Reference in New Issue
Block a user