perf(methods): 通过移除不必要的 self 参数优化方法签名
在包括 chat、plugin_system、schedule 和 mais4u 在内的多个模块中,消除冗余的实例引用。此次改动将无需访问实例状态的实用函数转换为静态方法,从而提升了内存效率,并使方法依赖关系更加清晰。
This commit is contained in:
@@ -125,7 +125,8 @@ class ScheduleLLMGenerator:
|
||||
logger.info("继续重试...")
|
||||
await asyncio.sleep(3)
|
||||
|
||||
def _validate_schedule_with_pydantic(self, schedule_data) -> bool:
|
||||
@staticmethod
|
||||
def _validate_schedule_with_pydantic(schedule_data) -> bool:
|
||||
try:
|
||||
ScheduleData(schedule=schedule_data)
|
||||
logger.info("日程数据Pydantic验证通过")
|
||||
@@ -204,7 +205,8 @@ class MonthlyPlanLLMGenerator:
|
||||
logger.error(" 所有尝试都失败,无法生成月度计划")
|
||||
return []
|
||||
|
||||
def _parse_plans_response(self, response: str) -> List[str]:
|
||||
@staticmethod
|
||||
def _parse_plans_response(response: str) -> List[str]:
|
||||
try:
|
||||
response = response.strip()
|
||||
lines = [line.strip() for line in response.split("\n") if line.strip()]
|
||||
|
||||
Reference in New Issue
Block a user