mirror of
https://github.com/Nezumi-2711/astrbot_plugin_qq_group_daily_analysis.git
synced 2026-09-22 20:01:04 +00:00
[feat] 将 InfoUtils 类迁移至分析模块,并实现获取用户昵称的方法
This commit is contained in:
@@ -9,7 +9,7 @@ from astrbot.api import logger
|
||||
from ...models.data_models import GoldenQuote, TokenUsage
|
||||
from .base_analyzer import BaseAnalyzer
|
||||
from ..utils.json_utils import extract_golden_quotes_with_regex
|
||||
from ...utils import InfoUtils
|
||||
from ..utils import InfoUtils
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ from astrbot.api import logger
|
||||
from ...models.data_models import SummaryTopic, TokenUsage
|
||||
from .base_analyzer import BaseAnalyzer
|
||||
from ..utils.json_utils import extract_topics_with_regex
|
||||
from ...utils import InfoUtils
|
||||
from ..utils import InfoUtils
|
||||
|
||||
|
||||
class TopicAnalyzer(BaseAnalyzer):
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
from datetime import datetime
|
||||
from typing import List, Dict
|
||||
from collections import defaultdict
|
||||
from ..utils import InfoUtils
|
||||
from .utils import InfoUtils
|
||||
|
||||
|
||||
class UserAnalyzer:
|
||||
|
||||
@@ -17,6 +17,8 @@ from .llm_utils import (
|
||||
extract_response_text
|
||||
)
|
||||
|
||||
from .info_utils import InfoUtils
|
||||
|
||||
__all__ = [
|
||||
# JSON处理工具
|
||||
'fix_json',
|
||||
@@ -28,5 +30,8 @@ __all__ = [
|
||||
# LLM工具
|
||||
'call_provider_with_retry',
|
||||
'extract_token_usage',
|
||||
'extract_response_text'
|
||||
'extract_response_text',
|
||||
|
||||
# 信息工具
|
||||
'InfoUtils'
|
||||
]
|
||||
@@ -4,7 +4,7 @@ class InfoUtils:
|
||||
"""
|
||||
获取用户昵称
|
||||
|
||||
优先使用nickname字段,如果为空则使用card(群名片)字段
|
||||
优先使用nickname字段,如果为空则使用card(群名片)字段
|
||||
"""
|
||||
enable_user_card = config_manager.get_enable_user_card()
|
||||
if enable_user_card:
|
||||
@@ -5,10 +5,8 @@
|
||||
|
||||
from .pdf_utils import PDFInstaller
|
||||
from .helpers import MessageAnalyzer
|
||||
from .info_utils import InfoUtils
|
||||
|
||||
__all__ = [
|
||||
'PDFInstaller',
|
||||
'MessageAnalyzer',
|
||||
'InfoUtils'
|
||||
'MessageAnalyzer'
|
||||
]
|
||||
Reference in New Issue
Block a user