feat: 支持通过指令下载插件 /plugin get

This commit is contained in:
Soulter
2025-03-26 14:33:45 +08:00
parent a604b4943c
commit a156b1af14
2 changed files with 4 additions and 13 deletions
+4 -1
View File
@@ -332,7 +332,10 @@ class PluginManager:
)
# 绑定 llm_tool handler
for func_tool in llm_tools.func_list:
if func_tool.handler.__module__ == metadata.module_path:
if (
func_tool.handler
and func_tool.handler.__module__ == metadata.module_path
):
func_tool.handler_module_path = metadata.module_path
func_tool.handler = functools.partial(
func_tool.handler, metadata.star_cls
-12
View File
@@ -53,13 +53,6 @@ class ConversationRoute(Route):
exclude_platforms.split(",") if exclude_platforms else []
)
logger.info(
f"获取对话列表: page={page}, page_size={page_size}, "
f"platforms={platform_list}, message_types={message_type_list}, "
f"search={search_query}, exclude_ids={exclude_id_list}, "
f"exclude_platforms={exclude_platform_list}"
)
# 限制页面大小,防止请求过大数据
if page < 1:
page = 1
@@ -79,7 +72,6 @@ class ConversationRoute(Route):
exclude_ids=exclude_id_list,
exclude_platforms=exclude_platform_list,
)
logger.info(f"获取到 {len(conversations)} 条对话,总数: {total_count}")
except Exception as e:
logger.error(f"数据库查询出错: {str(e)}\n{traceback.format_exc()}")
return Response().error(f"数据库查询出错: {str(e)}").__dict__
@@ -98,10 +90,6 @@ class ConversationRoute(Route):
"total_pages": total_pages,
},
}
logger.info(
f"返回对话列表成功: {json.dumps(result, ensure_ascii=False)[:200]}..."
)
return Response().ok(result).__dict__
except Exception as e: