From 365b8a488c3a0854a6e7054d95d36387e0764aac Mon Sep 17 00:00:00 2001 From: pengGgxp <98072271+pengGgxp@users.noreply.github.com> Date: Thu, 1 May 2025 18:14:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BA=86LLM=E7=9A=84?= =?UTF-8?q?=E9=80=82=E9=85=8D=EF=BC=8CDIfy=E6=9A=82=E6=97=B6=E4=B8=8D?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pywxdump/analyzer/utils.py | 2 +- pywxdump/api/api_utils/__init__.py | 0 pywxdump/api/api_utils/dify.py | 14 + pywxdump/api/api_utils/html.py | 939 ++++++++++++++ pywxdump/api/api_utils/llm.py | 1003 +++++++++++++++ pywxdump/api/export/exportJSON.py | 6 +- pywxdump/api/remote_server.py | 99 +- pywxdump/api/utils.py | 2 +- pywxdump/db/utils/__init__.py | 2 +- pywxdump/ui/src/assets/base.css | 14 + .../components/chatBackup/ChatExportMain.vue | 6 + .../components/chatBackup/ExportJSONMini.vue | 65 + pywxdump/ui/src/router/index.ts | 5 + pywxdump/ui/src/views/Chat2UiView.vue | 1091 +++++++++++++++++ pywxdump/wx_core/utils/common_utils.py | 2 +- setup.py | 8 +- temp.md | 5 + test.html | 634 ++++++---- test.py | 40 +- tests/build_exe.py | 2 +- text.html | 1078 ++++++++++++++++ 21 files changed, 4757 insertions(+), 260 deletions(-) create mode 100644 pywxdump/api/api_utils/__init__.py create mode 100644 pywxdump/api/api_utils/dify.py create mode 100644 pywxdump/api/api_utils/html.py create mode 100644 pywxdump/api/api_utils/llm.py create mode 100644 pywxdump/ui/src/components/chatBackup/ExportJSONMini.vue create mode 100644 pywxdump/ui/src/views/Chat2UiView.vue create mode 100644 temp.md create mode 100644 text.html diff --git a/pywxdump/analyzer/utils.py b/pywxdump/analyzer/utils.py index 5de07ed..8f1d285 100644 --- a/pywxdump/analyzer/utils.py +++ b/pywxdump/analyzer/utils.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*-# # ------------------------------------------------------------------------------- -# Name: utils.py +# Name: api_utils.py # Description: # Author: xaoyaoo # Date: 2023/12/03 diff --git a/pywxdump/api/api_utils/__init__.py b/pywxdump/api/api_utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pywxdump/api/api_utils/dify.py b/pywxdump/api/api_utils/dify.py new file mode 100644 index 0000000..f43a193 --- /dev/null +++ b/pywxdump/api/api_utils/dify.py @@ -0,0 +1,14 @@ +# 接入dify工作流,用来制作微信聊天记录可视化 + +class Dify(object): + def __init__(self): + api_key = "" + api_base_url = "" + + #TODO: 文件上传 + def file_upload(self): + pass + + #TODO: 运行工作流 + def run_workflows(self): + pass \ No newline at end of file diff --git a/pywxdump/api/api_utils/html.py b/pywxdump/api/api_utils/html.py new file mode 100644 index 0000000..a1df3c1 --- /dev/null +++ b/pywxdump/api/api_utils/html.py @@ -0,0 +1,939 @@ +# 创建html可视化页面 +import json +import re + + +class HtmlController(object): + def __init__(self): + pass + + # 根据json返回html + def create_html(self,json_data) -> str: + json_data = r"```json\n{\n\"header\": {\n\"title\": \"群聊报告\",\n\"date\": \"2025-04-29\",\n\"metaInfo\": {\n\"totalMessages\": \"35\",\n\"activeUsers\": \"12\",\n\"timeRange\": \"07:03:10 - 15:36:25\"\n}\n},\n\"sections\": {\n\"hotTopics\": {\n\"items\": [\n{\n\"name\": \"AI技术讨论\",\n\"category\": \"科技\",\n\"summary\": \"群内围绕Qwen3开源、Vidu Q1体验、夸克AI相机等AI技术展开热烈讨论,涉及模型性能、应用场景和开发者体验。多位成员分享了相关技术文章和体验报告。\",\n\"keywords\": [\"Qwen3\", \"Vidu\", \"AI相机\"],\n\"mentions\": \"15\"\n},\n{\n\"name\": \"熬夜与工作压力\",\n\"category\": \"生活\",\n\"summary\": \"成员们讨论熬夜工作现象,分享各自熬夜经历,对比互联网大厂与普通开发者的工作强度差异,引发关于工作生活平衡的思考。\",\n\"keywords\": [\"熬夜\", \"加班\", \"工作强度\"],\n\"mentions\": \"8\"\n}\n]\n},\n\"tutorials\": {\n\"items\": [\n{\n\"type\": \"TUTORIAL\",\n\"title\": \"体验完刚上线的Vidu Q1,后劲有点大(附AI视频创作教程)\",\n\"sharedBy\": \"苍何\",\n\"time\": \"2025-04-29 09:39:42\",\n\"summary\": \"分享Vidu Q1 AI视频创作工具的体验和教程,介绍其清晰度和一致性的提升。\",\n\"keyPoints\": [\"AI视频清晰度提升\", \"一致性改进\"],\n\"url\": \"http://mp.weixin.qq.com/s?__biz=MzU4NTE1Mjg4MA==&mid=2247493267&idx=1&sn=0189fb501578ce8e27142fbe2f590d03&chksm=fc9a946728c367005c19cb5a335300d05d51a441f9f20424a0a72c904a47bdf003252576318a&mpshare=1&scene=1&srcid=04297l70B2zsuypDfjUh0rh5&sharer_shareinfo=181efb947f938ab90786c776bf7bbda7&sharer_shareinfo_first=181efb947f938ab90786c776bf7bbda7#rd\",\n\"domain\": \"mp.weixin.qq.com\",\n\"category\": \"AI工具\"\n},\n{\n\"type\": \"TUTORIAL\",\n\"title\": \"阿里新出的夸克AI相机,强大到我有点陌生\",\n\"sharedBy\": \"苍何\",\n\"time\": \"2025-04-29 09:42:38\",\n\"summary\": \"介绍夸克AI相机的新奇玩法和功能,展示其强大的AI图像处理能力。\",\n\"keyPoints\": [\"新奇玩法\", \"抽象功能\"],\n\"url\": \"http://mp.weixin.qq.com/s?__biz=MzU4NTE1Mjg4MA==&mid=2247493275&idx=1&sn=93556ddd1da7fb8733a23a7c4adbb76b&chksm=fc2a2d25774cce23c75acd8850b85c585c0bcf78d14b810e157efaec5106abf563cf58e26aef&mpshare=1&scene=1&srcid=0429vDf8NbEzNLBQQyFlABmU&sharer_shareinfo=28b94477ec8201b88aa30338e82e8999&sharer_shareinfo_first=28b94477ec8201b88aa30338e82e8999#rd\",\n\"domain\": \"mp.weixin.qq.com\",\n\"category\": \"AI应用\"\n},\n{\n\"type\": \"RESOURCE\",\n\"title\": \"仅2MB,Windows瞬间超级丝滑!\",\n\"sharedBy\": \"AHapi²⁰²⁵\",\n\"time\": \"2025-04-29 11:13:38\",\n\"summary\": \"分享一款轻量级Windows优化工具,声称能显著提升系统运行速度。\",\n\"keyPoints\": [\"2MB大小\", \"系统优化\"],\n\"url\": \"https://mp.weixin.qq.com/s/es77Jc6Du03ppJD5XJeQUg\",\n\"domain\": \"mp.weixin.qq.com\",\n\"category\": \"系统工具\"\n}\n]\n},\n\"importantMessages\": {\n\"items\": [\n{\n\"time\": \"2025-04-29 10:00:18\",\n\"sender\": \"苍何\",\n\"type\": \"NEWS\",\n\"priority\": \"高\",\n\"content\": \"2025年04月29日 AI科技早报:阿里开源8款Qwen3模型,腾讯开源Kuikly跨端框架,OpenAI推出ChatGPT购物功能等11条重要新闻。\",\n\"fullContent\": \"2025年04月29日 AI科技早报1、阿里开源8款Qwen3模型,集成MCP,性能超DeepSeek-R1、OpenAI o1。2、Qafind Labs发布ChatDLM扩散语言模型,推理速度高达2800 tokens/s。3、腾讯开源Kuikly跨端框架,基于Kotlin支持多平台开发,已应用于QQ。4、OpenAI 推出 ChatGPT 购物功能,用户可通过 ChatGPT 便捷购物。5、字节Seed团队提出PHD-Transformer,突破预训练长度扩展瓶颈。6、百度发布文心快码3.5版本与多模态AI智能体Zulu,助力工程师提效。7、Kimi与财新传媒合作,提供专业财经内容,推动AI+传统媒体融合。8、苹果加速「N50」智能眼镜项目,融合AI技术预计2027年亮相。9、研究显示OpenAI o3在病毒学领域超越94%人类专家,生物安全引关注。10、华为测试自研AI芯片Ascend 910D,旨在替代英伟达H100芯片。11、🔥【记得收藏】早报同步更新到开源 AI 知识库:https://u55dyuejxc.feishu.cn/wiki/FkmNwxYHDigJ3akIUGHc8MSTn4d\"\n}\n]\n},\n\"dialogues\": {\n\"items\": [\n{\n\"type\": \"DIALOGUE\",\n\"messages\": [\n{\n\"speaker\": \"好名字\",\n\"time\": \"2025-04-29 08:16:23\",\n\"content\": \"这个我弄完,ai做的小程序有bug,流程走不通,还改不了[捂脸]\"\n},\n{\n\"speaker\": \"贾👦🏻\",\n\"time\": \"2025-04-29 08:54:33\",\n\"content\": \"可以微调 不过源码需要买的\"\n},\n{\n\"speaker\": \"好名字\",\n\"time\": \"2025-04-29 09:13:32\",\n\"content\": \"微调一次,然后再想调就需要开会员了\"\n},\n{\n\"speaker\": \"贾👦🏻\",\n\"time\": \"2025-04-29 09:14:09\",\n\"content\": \"需求变更一个字 就需要重新购买[破涕为笑]\"\n}\n],\n\"highlight\": \"AI小程序开发中的商业化模式讨论\",\n\"relatedTopic\": \"AI开发工具\"\n},\n{\n\"type\": \"DIALOGUE\",\n\"messages\": [\n{\n\"speaker\": \"苍何\",\n\"time\": \"2025-04-29 09:26:49\",\n\"content\": \"我熬不动\"\n},\n{\n\"speaker\": \"AHapi²⁰²⁵\",\n\"time\": \"2025-04-29 09:27:25\",\n\"content\": \"不要卷别人[旺柴]别人写了 就不卷他们了\"\n},\n{\n\"speaker\": \"苍何\",\n\"time\": \"2025-04-29 09:27:55\",\n\"content\": \"新闻得第一时间,做不到写了也没啥用\"\n},\n{\n\"speaker\": \"苍何\",\n\"time\": \"2025-04-29 09:28:03\",\n\"content\": \"还不如写些应用\"\n},\n{\n\"speaker\": \"大风(Wind)\",\n\"time\": \"2025-04-29 09:28:23\",\n\"content\": \"看看哪些是5-7点发推文的,基本都是卷王了\"\n},\n{\n\"speaker\": \"沉默王二\",\n\"time\": \"2025-04-29 09:28:44\",\n\"content\": \"身体能扛住确实离谱\"\n},\n{\n\"speaker\": \"苍何\",\n\"time\": \"2025-04-29 09:29:03\",\n\"content\": \"是啊,太肝了\"\n}\n],\n\"highlight\": \"关于工作强度和熬夜文化的讨论\",\n\"relatedTopic\": \"工作生活平衡\"\n}\n]\n},\n\"qa\": {\n\"items\": [\n{\n\"question\": {\n\"asker\": \"银色子弹-捷\",\n\"time\": \"2025-04-29 11:10:26\",\n\"content\": \"问一下win11电脑,你长时间没清理,运行慢,一般用什么来清理电脑? 不要360啊,那个太流氓了,想知道各位大佬有没有优秀的软件推荐一下\",\n\"tags\": [\"Windows优化\", \"系统清理\"]\n},\n\"answers\": [\n{\n\"responder\": \"昏沉沉的\",\n\"time\": \"2025-04-29 11:11:59\",\n\"content\": \"ccclean\",\n\"isAccepted\": false\n},\n{\n\"responder\": \"🤑程序儒\",\n\"time\": \"2025-04-29 11:13:07\",\n\"content\": \"360极速版、Wise Care 365\",\n\"isAccepted\": false\n},\n{\n\"responder\": \"AHapi²⁰²⁵\",\n\"time\": \"2025-04-29 11:13:38\",\n\"content\": \"仅2MB,Windows瞬间超级丝滑!这才是,真神器!\",\n\"isAccepted\": true\n}\n]\n},\n{\n\"question\": {\n\"asker\": \"ಠ_ಠ 闲鱼一条ಠ_ಠ\",\n\"time\": \"2025-04-29 11:37:49\",\n\"content\": \"请问哪位哥还有扣子的邀请码吗?\",\n\"tags\": [\"邀请码\", \"扣子空间\"]\n},\n\"answers\": [\n{\n\"responder\": \"贾👦🏻\",\n\"time\": \"2025-04-29 11:40:37\",\n\"content\": \"RootUser_2105656329 邀请你体验扣子空间,快来和 Agent 一起开始你的工作吧!https://www.coze.cn/space-preview?invite_code=SCL7DAL0\",\n\"isAccepted\": true\n},\n{\n\"responder\": \"9527\",\n\"time\": \"2025-04-29 11:47:43\",\n\"content\": \"RootUser_2106519373 邀请你体验扣子空间,快来和 Agent 一起开始你的工作吧!https://www.coze.cn/space-preview?invite_code=A8IT4MUE\",\n\"isAccepted\": false\n}\n]\n}\n]\n},\n\"analytics\": {\n\"heatmap\": [\n{\n\"topic\": \"AI技术\",\n\"percentage\": \"45%\",\n\"color\": \"#3da9fc\",\n\"count\": \"16\"\n},\n{\n\"topic\": \"工作讨论\",\n\"percentage\": \"25%\",\n\"color\": \"#4361ee\",\n\"count\": \"9\"\n},\n{\n\"topic\": \"工具推荐\",\n\"percentage\": \"15%\",\n\"color\": \"#00b4d8\",\n\"count\": \"5\"\n},\n{\n\"topic\": \"其他\",\n\"percentage\": \"15%\",\n\"color\": \"#7209b7\",\n\"count\": \"5\"\n}\n],\n\"chattyRanking\": [\n{\n\"rank\": 1,\n\"name\": \"苍何\",\n\"count\": \"7\",\n\"characteristics\": [\"技术分享\", \"新闻发布\"],\n\"commonWords\": [\"AI\", \"开源\", \"熬夜\"]\n},\n{\n\"rank\": 2,\n\"name\": \"AHapi²⁰²⁵\",\n\"count\": \"6\",\n\"characteristics\": [\"幽默评论\", \"资源分享\"],\n\"commonWords\": [\"旺柴\", \"加班\", \"神器\"]\n},\n{\n\"rank\": 3,\n\"name\": \"贾👦🏻\",\n\"count\": \"3\",\n\"characteristics\": [\"问题解答\", \"邀请码分享\"],\n\"commonWords\": [\"源码\", \"购买\", \"邀请\"]\n}\n],\n\"nightOwl\": {\n\"name\": \"苍何\",\n\"title\": \"熬夜冠军\",\n\"latestTime\": \"09:42:54\",\n\"messageCount\": \"7\",\n\"lastMessage\": \"我熬夜写了这一篇[旺柴]\"\n}\n},\n\"wordCloud\": {\n\"words\": [\n{\n\"text\": \"AI\",\n\"size\": 42,\n\"color\": \"#00b4d8\",\n\"rotation\": 0\n},\n{\n\"text\": \"熬夜\",\n\"size\": 36,\n\"color\": \"#4361ee\",\n\"rotation\": -15\n},\n{\n\"text\": \"开源\",\n\"size\": 32,\n\"color\": \"#00b4d8\",\n\"rotation\": 15\n},\n{\n\"text\": \"Qwen3\",\n\"size\": 28,\n\"color\": \"#3da9fc\",\n\"rotation\": -10\n},\n{\n\"text\": \"Vidu\",\n\"size\": 26,\n\"color\": \"#3da9fc\",\n\"rotation\": 10\n},\n{\n\"text\": \"清理\",\n\"size\": 24,\n\"color\": \"#7209b7\",\n\"rotation\": -5\n},\n{\n\"text\": \"邀请码\",\n\"size\": 22,\n\"color\": \"#7209b7\",\n\"rotation\": 5\n}\n],\n\"legend\": [\n{\"color\": \"#00b4d8\", \"label\": \"技术 相关词汇\"},\n{\"color\": \"#4361ee\", \"label\": \"生活 相关词汇\"},\n{\"color\": \"#7209b7\", \"label\": \"工具 相关词汇\"}\n]\n}\n},\n\"footer\": {\n\"dataSource\": \"群聊聊天记录\",\n\"generationTime\": \"2025-04-29 16:00:00\",\n\"statisticalPeriod\": \"2025-04-29 07:03:10 - 15:36:25\",\n\"disclaimer\": \"本报告内容基于群聊公开讨论,如有不当内容或侵权问题请联系管理员处理。\"\n}\n}\n```" + + # 加载模板 + html = """ + + + + + [群/用户名称]日报 - [日期] + + + +
+

[群/用户名称]日报

+

[日期]

+
+ 总消息数:[数量] + 活跃用户:[数量] + 时间范围:[时间范围] +
+
+ + + + +
+

今日讨论热点

+
+ + + + +
+
+ + +
+

实用教程与资源分享

+
+ + + + +
+
+ + +
+

重要消息汇总

+
+ + + + +
+
+ + +
+

有趣对话或金句

+
+ + + + +
+
+ + +
+

问题与解答

+
+ + + + +
+
+ + +
+

群内数据可视化

+ + +

话题热度

+
+ + + + + + +
+ + + +
+

话唠榜

+
+ + +
+
+ + + +

熬夜冠军

+
+ + + +
+
+ + +
+

热门词云

+
+ +
+ + + + + +
+ +
+ + + +
+
+
+ + + + + + + + """ + + json_data = json_data[7:-3] + # 清洗json_data + # 判断是否是转义的换行符 + if '\n' in json_data: + json_data = json_data.replace('\n', '\n') + + + else: + json_data = json_data.replace(r'\"', '"').replace(r"\n", '\n') + + # print(json_data) + + # 使用正则表达式查找json字符串 + pattern = re.compile('{.*}', flags=re.IGNORECASE | re.MULTILINE | re.S) + print(pattern.search(json_data).group()) + + json_data = json.loads(pattern.search(json_data).group()) + # json_data = json.loads(json_data) + + # print(json_data) + + # print(json.dumps(json_data,indent=4, ensure_ascii=False)) + + # 替换头部信息 + header = json_data['header'] + html = html.replace('[群/用户名称]日报', f"{header['title']}报告") + html = html.replace('[日期]', header['date']) + html = html.replace('总消息数:[数量]', f"总消息数:{header['metaInfo']['totalMessages']}") + html = html.replace('活跃用户:[数量]', f"活跃用户:{header['metaInfo']['activeUsers']}") + html = html.replace('时间范围:[时间范围]', f"时间范围:{header['metaInfo']['timeRange']}") + + # 处理热点话题 + hot_topics = [] + for topic in json_data['sections']['hotTopics']['items']: + keywords = ''.join([f'{kw}' for kw in topic['keywords']]) + hot_topics.append(f""" +
+

{topic['name']}

+
{topic['category']}
+

{topic['summary']}

+
+ {keywords} +
+
提及次数:{topic['mentions']}
+
""") + html = html.replace('', '\n'.join(hot_topics)) + + # 处理教程资源 + tutorials = [] + for tut in json_data['sections']['tutorials']['items']: + points = ''.join([f'
  • {p}
  • ' for p in tut['keyPoints']]) + tutorials.append(f""" +
    +
    {tut['type']}
    +

    {tut['title']}

    +
    + 分享者:{tut['sharedBy']} + +
    +

    {tut['summary']}

    +
    +

    要点:

    + +
    + +
    分类:{tut['category']}
    +
    """) + html = html.replace('', '\n'.join(tutorials)) + + # 处理重要消息 + messages = [] + for msg in json_data['sections']['importantMessages']['items']: + messages.append(f""" +
    +
    + {msg['time']} + {msg['sender']} + {msg['type']} + 优先级:{msg['priority']} +
    +

    {msg['content']}

    +
    +

    {msg['fullContent']}

    +
    +
    """) + html = html.replace('', '\n'.join(messages)) + + # 处理对话 + dialogues = [] + for dia in json_data['sections']['dialogues']['items']: + messages = ''.join([f""" +
    +
    + {m['speaker']} + {m['time']} +
    +

    {m['content']}

    +
    """ for m in dia['messages']]) + dialogues.append(f""" +
    +
    {dia['type']}
    +
    + {messages} +
    +
    {dia['highlight']}
    +
    相关话题:{dia['relatedTopic']}
    +
    """) + html = html.replace('', '\n'.join(dialogues)) + + # 处理问答 + qas = [] + for qa in json_data['sections']['qa']['items']: + tags = ''.join([f'{tag}' for tag in qa['question']['tags']]) + answers = ''.join([f""" +
    +
    + {ans['responder']} + {ans['time']} + {"最佳回答" if ans['isAccepted'] else ""} +
    +

    {ans['content']}

    +
    """ for ans in qa['answers']]) + qas.append(f""" +
    +
    +
    + {qa['question']['asker']} + {qa['question']['time']} +
    +

    {qa['question']['content']}

    +
    + {tags} +
    +
    +
    + {answers} +
    +
    """) + html = html.replace('', '\n'.join(qas)) + + # 处理数据可视化 + heatmap = [] + colors = ['#3da9fc', '#f25f4c', '#7209b7', '#e53170', '#00b4d8', '#4cc9f0'] + for i, topic in enumerate(json_data['sections']['analytics']['heatmap']): + color = colors[i % len(colors)] + heatmap.append(f""" +
    +
    {topic['topic']}
    +
    {topic['percentage']}%
    +
    +
    +
    +
    {topic['count']}条消息
    +
    """) + html = html.replace('', '\n'.join(heatmap)) + + # 处理话唠榜 + chatty = [] + for rank in json_data['sections']['analytics']['chattyRanking']: + words = ''.join([f'{w}' for w in rank['commonWords']]) + characteristics = ''.join([f'{c}' for c in rank['characteristics']]) + chatty.append(f""" +
    +
    {rank['rank']}
    +
    +
    {rank['name']}
    +
    发言数:{rank['count']}
    +
    + {characteristics} +
    +
    + {words} +
    +
    +
    """) + html = html.replace('', '\n'.join(chatty)) + + # 处理熬夜冠军 + nightOwl = json_data['sections']['analytics']['nightOwl'] + + f = f""" +
    +
    👑
    +
    +
    {nightOwl['name']}
    +
    {nightOwl['title']}
    +
    最晚活跃时间:{nightOwl['latestTime']}
    +
    深夜消息数:{nightOwl['messageCount']}
    +
    {nightOwl['lastMessage']}
    +
    注:熬夜时段定义为23:00-06:00,已考虑不同时区
    +
    """ + + html = html.replace('', '\n' + f + '\n') + + # 处理词云 + words = [] + for word in json_data['sections']['wordCloud']['words']: + words.append(f""" + {word['text']}""") + html = html.replace('', '\n'.join(words)) + + # 处理词云的分类 + types = [] + for typ in json_data['sections']['wordCloud']['legend']: + types.append(f"""
    + + {typ['label']} +
    + """ + ) + + html = html.replace('', '\n'.join(types)) + + # 处理页脚 + footer = json_data['footer'] + html = html.replace('[群名称]', footer['dataSource']) + html = html.replace('[当前时间]', footer['generationTime']) + html = html.replace('[日期] [时间范围]', footer['statisticalPeriod']) + + return html \ No newline at end of file diff --git a/pywxdump/api/api_utils/llm.py b/pywxdump/api/api_utils/llm.py new file mode 100644 index 0000000..faf4c8b --- /dev/null +++ b/pywxdump/api/api_utils/llm.py @@ -0,0 +1,1003 @@ +# LLM api相关 +import enum +import json +import os +import re + +import httpx +from openai import OpenAI + +from pywxdump.api.remote_server import gc + + + + +class BaseLLMApi(object): + def __init__(self,api_key,base_url=None): + # 设置名字,以供其他函数使用 !!!不使用, + # self.api_key_string = "API_KEY" + # self.base_url_string = "BASE_URL" + # self.env_api_key_string = self.__class__.__name__ + "_" + self.api_key_string + # self.env_base_url_string = self.__class__.__name__ + "_" + self.base_url_string + # self.setting_string = self.__class__.__name__ + "_setting" + + + self.API_KEY = api_key + self.BASE_URL = base_url + + self.module = ( + + )#模型列表 + + + self.HTTP_CLIENT = None + self.isReady = False + self.message = [] + + + # 执行初始化方法 + self.set_default_fn() + + + + + def set_default_fn(self): + if not self.module: + self.set_default_module() + if not self.BASE_URL: + self.set_default_base_url() + if not self.message: + self.set_default_message() + + def set_default_module(self): + self.module = () + + def set_default_base_url(self): + self.BASE_URL = "" + + def set_default_message(self): + self.message = [ + {"role": "system", "content": "You are a helpful assistant"}, + {"role": "user", "content": "Hello"}, + ] + + + + def set_module(self, module): + self.module = module + + def set_api_key(self, api_key): + self.API_KEY = api_key + + def set_base_url(self, base_url): + self.BASE_URL = base_url + + + def set_message(self, message): + self.message = message + + + + + + # def ready(self): + # if not self.API_KEY: + # # 从配置中获取,这个功能必须配合网页API开启后才能使用 + # self.API_KEY = gc.get_conf(gc.at,self.setting_string)[self.api_key_string] + # if not self.API_KEY: + # raise RuntimeError("API_KEY must be set") + # # 设置环境变量 + # os.environ[self.env_api_key_string] = self.API_KEY + # os.environ[self.env_base_url_string] = self.BASE_URL + # + # self.isReady = True + # return + + + def ready(self): + if not self.BASE_URL and not self.API_KEY: + raise RuntimeError("API_KEY or BASE_URL must be set") + self.isReady = True + + + + @property + def http_client(self): + if not self.isReady: + self.ready() + try: + self.HTTP_CLIENT = OpenAI(api_key=self.API_KEY, base_url=self.BASE_URL) + return self.HTTP_CLIENT + except: + raise RuntimeError("HTTP_CLIENT set not successfully,please check!") + + + + + + + + def send_msg(self, message=None, module=None, stream=False): + """ + 向大模型发送信息 + 如果非流式返回,则直接输出内容, + 否则使用openai文档规定格式输出 + """ + + if message is None: + message = self.message + + response = self.http_client.chat.completions.create( + model=self.module[module], + messages=message, + stream=stream + ) + if not stream: + return self.process_msg(response.choices[0].message.content) + else: + return self.process_msg(response.response.read().decode("utf-8")) + + def process_msg(self,x): + return x + +class DeepSeekApi(BaseLLMApi): + + + def set_default_module(self): + self.module = ( + "deepseek-chat", + "deepseek-reasoner" + ) + + def set_default_base_url(self): + self.BASE_URL = "https://api.deepseek.com" + + def set_default_message(self): + self.message = [ + {"role": "system", "content": """从内容中提取出以下信息,可以根据内容多少进行列表扩展或增加,请仔细思索怎么填充内容,如果没有给到合理的名称或其他内容,就以合理的方式思考并添加。 + + - 最后的输出值使用严格的json格式 + + - 不要私自添加json块或减少json块 + + - 内容中不要使用换行符,如果内容原本有多个换行符,删掉原本多余的的换行符,只保留一个换行符再加入进去。 + + - 内容中如果有很奇怪的字符,比如''\''或''\\''影响代码编译的字符,删除原本的字符再加入进去。 + + + + { + + "header": { + + "title": "[群名称]报告", + + "date": "[日期]", + + "metaInfo": { + + "totalMessages": "[数量]", + + "activeUsers": "[数量]", + + "timeRange": "[时间范围]" + + } + + }, + + "sections": { + + "hotTopics": { + + "items": [ + + { + + "name": "[热点话题名称]", + + "category": "[话题分类]", + + "summary": "[简要总结(50-100字)]", + + "keywords": ["[关键词1]", "[关键词2]"], + + "mentions": "[次数]" + + } + + ] + + }, + + "tutorials": { + + "items": [ + + { + + "type": "[TUTORIAL | NEWS | RESOURCE]", + + "title": "[分享的教程或资源标题]", + + "sharedBy": "[昵称]", + + "time": "[时间]", + + "summary": "[内容简介]", + + "keyPoints": ["[要点1]", "[要点2]"], + + "url": "[URL]", + + "domain": "[域名]", + + "category": "[分类]" + + } + + ] + + }, + + "importantMessages": { + + "items": [ + + { + + "time": "[消息时间]", + + "sender": "[发送者昵称]", + + "type": "[NOTICE | EVENT | ANNOUNCEMENT | OTHER]", + + "priority": "[高|中|低]", + + "content": "[消息内容]", + + "fullContent": "[完整通知内容]" + + } + + ] + + }, + + "dialogues": { + + "items": [ + + { + + "type": "[DIALOGUE | QUOTE]", + + "messages": [ + + { + + "speaker": "[说话者昵称]", + + "time": "[发言时间]", + + "content": "[消息内容]" + + } + + ], + + "highlight": "[对话中的金句或亮点]", + + "relatedTopic": "[某某话题]" + + } + + ] + + }, + + "qa": { + + "items": [ + + { + + "question": { + + "asker": "[提问者昵称]", + + "time": "[提问时间]", + + "content": "[问题内容]", + + "tags": ["[相关标签1]", "[相关标签2]"] + + }, + + "answers": [ + + { + + "responder": "[回答者昵称]", + + "time": "[回答时间]", + + "content": "[回答内容]", + + "isAccepted": true + + } + + ] + + } + + ] + + }, + + "analytics": { + + "heatmap": [ + + { + + "topic": "[话题名称]", + + "percentage": "[百分比]", + + "color": "#3da9fc", + + "count": "[数量]" + + } + + ], + + "chattyRanking": [ + + { + + "rank": 1, + + "name": "[群友昵称]", + + "count": "[数量]", + + "characteristics": ["[特点1]", "[特点2]"], + + "commonWords": ["[常用词1]", "[常用词2]"] + + } + + ], + + "nightOwl": { + + "name": "[熬夜冠军昵称]", + + "title": "[熬夜冠军称号]", + + "latestTime": "[时间]", + + "messageCount": "[数量]", + + "lastMessage": "[最后一条深夜消息内容]" + + } + + }, + + "wordCloud": { + + "words": [ + + { + + "text": "[关键词1]", + + "size": 38, + + "color": "#00b4d8", + + "rotation": -15 + + } + + ], + + "legend": [ + + {"color": "#00b4d8", "label": "[分类1] 相关词汇"}, + + {"color": "#4361ee", "label": "[分类2] 相关词汇"} + + ] + + } + + }, + + "footer": { + + "dataSource": "[群名称]聊天记录", + + "generationTime": "[当前时间]", + + "statisticalPeriod": "[日期] [时间范围]", + + "disclaimer": "本报告内容基于群聊公开讨论,如有不当内容或侵权问题请联系管理员处理。" + + } + + }"""}, + {"role": "user", "content": """你好,以下是我要提取的内容: [ + { + "sender": "ಠ_ಠ 闲鱼一条ಠ_ಠ", + "content": "[强]", + "timestamp": "2025-04-29 07:03:10" + }, + { + "sender": "JustinZ", + "content": "OK", + "timestamp": "2025-04-29 07:59:23" + }, + { + "sender": "AHapi²⁰²⁵", + "content": "[旺柴]贿赂三星 这词", + "timestamp": "2025-04-29 08:01:17" + }, + { + "sender": "好名字", + "content": "这个我弄完,ai做的小程序有bug,流程走不通,还改不了[捂脸]\n\n[引用](2025-04-28 12:02:27)苍何:用AI一句话开发了个名片制作微信小程序,前后台系统都有,还能一键发布!", + "timestamp": "2025-04-29 08:16:23" + }, + { + "sender": "贾👦🏻", + "content": "可以微调 不过源码需要买的\n\n[引用](2025-04-29 08:16:23)好名字:这个我弄完,ai做的小程序有bug,流程走不通,还改不了[捂脸]", + "timestamp": "2025-04-29 08:54:33" + }, + { + "sender": "好名字", + "content": "微调一次,然后再想调就需要开会员了", + "timestamp": "2025-04-29 09:13:32" + }, + { + "sender": "贾👦🏻", + "content": "需求变更一个字 就需要重新购买[破涕为笑]", + "timestamp": "2025-04-29 09:14:09" + }, + { + "sender": "AHapi²⁰²⁵", + "content": "表情", + "timestamp": "2025-04-29 09:14:22" + }, + { + "sender": "苍何", + "content": "Qwen3深夜正式开源,小尺寸也能大力出奇迹。\n欢迎来到这个荒诞又灿烂的时代。\n\n点击查看详情", + "timestamp": "2025-04-29 09:20:23" + }, + { + "sender": "沙皮狗的忧伤", + "content": "苍老师,没写一篇", + "timestamp": "2025-04-29 09:26:19" + }, + { + "sender": "苍何", + "content": "我熬不动", + "timestamp": "2025-04-29 09:26:49" + }, + { + "sender": "AHapi²⁰²⁵", + "content": "不要卷别人[旺柴]别人写了 就不卷他们了", + "timestamp": "2025-04-29 09:27:25" + }, + { + "sender": "苍何", + "content": "新闻得第一时间,做不到写了也没啥用", + "timestamp": "2025-04-29 09:27:55" + }, + { + "sender": "苍何", + "content": "还不如写些应用", + "timestamp": "2025-04-29 09:28:03" + }, + { + "sender": "大风(Wind)", + "content": "看看哪些是5-7点发推文的,基本都是卷王了", + "timestamp": "2025-04-29 09:28:23" + }, + { + "sender": "沉默王二", + "content": "身体能扛住确实离谱", + "timestamp": "2025-04-29 09:28:44" + }, + { + "sender": "苍何", + "content": "是啊,太肝了", + "timestamp": "2025-04-29 09:29:03" + }, + { + "sender": "苍何", + "content": "我前天熬夜测vidu,人已经废了好几天", + "timestamp": "2025-04-29 09:29:39" + }, + { + "sender": "AHapi²⁰²⁵", + "content": "5-7点还好 早点睡也还行", + "timestamp": "2025-04-29 09:30:02" + }, + { + "sender": "大风(Wind)", + "content": "效果咋样\n\n[引用](2025-04-29 09:29:39)苍何:\n我前天熬夜测vidu,人已经废了好几天", + "timestamp": "2025-04-29 09:30:14" + }, + { + "sender": "大风(Wind)", + "content": "5点发布的\n\n[引用](2025-04-29 09:30:02)AHapi²⁰²⁵:\n5-7点还好 早点睡也还行", + "timestamp": "2025-04-29 09:30:21" + }, + { + "sender": "大风(Wind)", + "content": "2小时内出文", + "timestamp": "2025-04-29 09:30:52" + }, + { + "sender": "沉默王二", + "content": "意味着阿里的 coder 们也在加班和熬夜", + "timestamp": "2025-04-29 09:31:00" + }, + { + "sender": "苍何", + "content": "体验完刚上线的Vidu Q1,后劲有点大(附AI视频创作教程)\nAI视频清晰度,一致性都上了一个台阶\n\n点击查看详情", + "timestamp": "2025-04-29 09:39:42" + }, + { + "sender": "苍何", + "content": "@大风(Wind) 你看看,效果还可以", + "timestamp": "2025-04-29 09:40:01" + }, + { + "sender": "AHapi²⁰²⁵", + "content": "他们加班熬夜 赚的还是多啊[Facepalm]我们加班熬夜 就一点屁钱\n\n[引用](2025-04-29 09:31:00)沉默王二:意味着阿里的 coder 们也在加班和熬夜", + "timestamp": "2025-04-29 09:40:18" + }, + { + "sender": "苍何", + "content": "阿里新出的夸克AI相机,强大到我有点陌生。\n夸克AI相机超多新奇的玩法,太抽象了。\n\n点击查看详情", + "timestamp": "2025-04-29 09:42:38" + }, + { + "sender": "苍何", + "content": "我熬夜写了这一篇[旺柴]", + "timestamp": "2025-04-29 09:42:54" + }, + { + "sender": "AHapi²⁰²⁵", + "content": "成功还得肝啊", + "timestamp": "2025-04-29 09:43:15" + }, + { + "sender": "苍何", + "content": "2025年04月29日 AI科技早报\n\n1、阿里开源8款Qwen3模型,集成MCP,性能超DeepSeek-R1、OpenAI o1。\n\n2、Qafind Labs发布ChatDLM扩散语言模型,推理速度高达2800 tokens/s。\n\n3、腾讯开源Kuikly跨端框架,基于Kotlin支持多平台开发,已应用于QQ。\n\n4、OpenAI 推出 ChatGPT 购物功能,用户可通过 ChatGPT 便捷购物。\n\n5、字节Seed团队提出PHD-Transformer,突破预训练长度扩展瓶颈。\n\n6、百度发布文心快码3.5版本与多模态AI智能体Zulu,助力工程师提效。\n\n7、Kimi与财新传媒合作,提供专业财经内容,推动AI+传统媒体融合。\n\n8、苹果加速「N50」智能眼镜项目,融合AI技术预计2027年亮相。\n\n9、研究显示OpenAI o3在病毒学领域超越94%人类专家,生物安全引关注。\n\n10、华为测试自研AI芯片Ascend 910D,旨在替代英伟达H100芯片。\n\n11、🔥【记得收藏】早报同步更新到开源 AI 知识库:https://u55dyuejxc.feishu.cn/wiki/FkmNwxYHDigJ3akIUGHc8MSTn4d", + "timestamp": "2025-04-29 10:00:18" + }, + { + "sender": "银色子弹-捷", + "content": "问一下win11电脑,你长时间没清理,运行慢,一般用什么来清理电脑? 不要360啊,那个太流氓了,想知道各位大佬有没有优秀的软件推荐一下", + "timestamp": "2025-04-29 11:10:26" + }, + { + "sender": "昏沉沉的", + "content": "ccclean", + "timestamp": "2025-04-29 11:11:59" + }, + { + "sender": "昏沉沉的", + "content": "我拍了拍\"银色子弹-捷\"[炸弹]", + "timestamp": "2025-04-29 11:12:04" + }, + { + "sender": "🤑程序儒", + "content": "360极速版、Wise Care 365", + "timestamp": "2025-04-29 11:13:07" + }, + { + "sender": "AHapi²⁰²⁵", + "content": "仅2MB,Windows瞬间超级丝滑!\n这才是,真神器!\n\n点击查看详情", + "timestamp": "2025-04-29 11:13:38" + }, + { + "sender": "银色子弹-捷", + "content": "好的,我去尝试一下", + "timestamp": "2025-04-29 11:21:41" + }, + { + "sender": "银色子弹-捷", + "content": "感谢", + "timestamp": "2025-04-29 11:21:53" + }, + { + "sender": "ಠ_ಠ 闲鱼一条ಠ_ಠ", + "content": "请问哪位哥还有扣子的邀请码吗?", + "timestamp": "2025-04-29 11:37:49" + }, + { + "sender": "贾👦🏻", + "content": "RootUser_2105656329 邀请你体验扣子空间,快来和 Agent 一起开始你的工作吧!\nhttps://www.coze.cn/space-preview?invite_code=SCL7DAL0", + "timestamp": "2025-04-29 11:40:37" + }, + { + "sender": "ಠ_ಠ 闲鱼一条ಠ_ಠ", + "content": "感谢[抱拳]", + "timestamp": "2025-04-29 11:42:45" + }, + { + "sender": "9527", + "content": "RootUser_2106519373 邀请你体验扣子空间,快来和 Agent 一起开始你的工作吧!\nhttps://www.coze.cn/space-preview?invite_code=A8IT4MUE", + "timestamp": "2025-04-29 11:47:43" + }, + { + "sender": "9527", + "content": "RootUser_2106519373 邀请你体验扣子空间,快来和 Agent 一起开始你的工作吧!\nhttps://www.coze.cn/space-preview?invite_code=7QUCYZKC", + "timestamp": "2025-04-29 11:47:53" + }, + { + "sender": "AHapi²⁰²⁵", + "content": "Qwen3:心性\n可与之「坐而论道」\n\n点击查看详情", + "timestamp": "2025-04-29 15:36:25" + }, + { + "sender": "苍何", + "content": "(分享)视频号视频", + "timestamp": "2025-04-29 21:08:34" + }, + { + "sender": "维金", + "content": "挺牛的", + "timestamp": "2025-04-29 21:10:30" + }, + { + "sender": "NowIsFuture", + "content": "表情", + "timestamp": "2025-04-29 21:15:45" + }, + { + "sender": "昏沉沉的", + "content": "群里有没有做智能体开发的小伙伴 我现在有个问题", + "timestamp": "2025-04-29 21:20:53" + }, + { + "sender": "昏沉沉的", + "content": "还有没有coze邀请码啊?", + "timestamp": "2025-04-29 21:27:15" + }, + { + "sender": "昏沉沉的", + "content": "大佬们", + "timestamp": "2025-04-29 21:27:18" + }, + { + "sender": "Angora", + "content": "HT2QP13K 这个你试试\n\n[引用](2025-04-29 21:27:16)昏沉沉的:还有没有coze邀请码啊?", + "timestamp": "2025-04-29 21:28:38" + }, + { + "sender": "昏沉沉的", + "content": "感谢", + "timestamp": "2025-04-29 21:29:36" + }, + { + "sender": "Angora", + "content": "表情", + "timestamp": "2025-04-29 21:30:03" + }, + { + "sender": "虫虫", + "content": "新手学习神经网络", + "timestamp": "2025-04-29 23:38:02" + }, + { + "sender": "虫虫", + "content": "RNN|什么是循环神经网络?为什么它能“记住”过去?\nRNN(卷积神经网络)\n\n点击查看详情", + "timestamp": "2025-04-29 23:38:02" + }, + { + "sender": "苍何", + "content": "2025年04月30日 AI科技早报\n\n1、习近平总书记调研上海 “模速空间” ,关注人工智能发展。\n\n2、通义App及网页版新增开源模型 Qwen3,用户可体验智能对话功能。\n\n3、马斯克将发Grok 3.5早期测试版,仅限订阅用户,专攻专业领域解答。\n\n4、Meta推AI助手Meta AI APP,融合社交,支持文字语音互动及图像生成。\n\n5、ChatGPT被指对未成年生成色情内容,OpenAI确认并将紧急修复。\n\n6、宇树科技G1机器人完成13.2公里长跑,118分钟续航回应马拉松摔倒质疑。\n\n7、微软与OpenAI因算力、模型权限及 AGI 开发等问题分歧加剧,关系趋紧。\n\n8、智象未来HiDream-I1模型被谷歌收录,多项指标超GPT-4o与Flux1.1。\n\n9、联合包裹计划与 Figure AI 合作部署人形机器人,提升物流效率。\n\n10、星纪魅族与蚂蚁国际将推智能眼镜线下支付功能,预计第三季度落地。\n\n11、🔥【记得收藏】早报同步更新到开源 AI 知识库:https://u55dyuejxc.feishu.cn/wiki/FkmNwxYHDigJ3akIUGHc8MSTn4d", + "timestamp": "2025-04-30 10:00:20" + }, + { + "sender": "苍何", + "content": "手搓完字节AI硬件,我做了个五一智能旅行小装置(附万字沉浸式教程)\n用AI硬件做了个智能旅行小装置\n\n点击查看详情", + "timestamp": "2025-04-30 11:05:21" + }, + { + "sender": "枫哥 Prompter", + "content": "[强]牛气冲天\n\n[引用](2025-04-30 11:05:21)苍何:手搓完字节AI硬件,我做了个五一智能旅行小装置(附万字沉浸式教程)", + "timestamp": "2025-04-30 12:59:03" + }, + { + "sender": "听说", + "content": "塞到玩偶里,出门你走路上都是最靓的仔\n\n[引用](2025-04-30 11:05:21)苍何:手搓完字节AI硬件,我做了个五一智能旅行小装置(附万字沉浸式教程)", + "timestamp": "2025-04-30 13:02:39" + }, + { + "sender": "兔子先生", + "content": "定制女友角色\n\n[引用](2025-04-30 11:05:21)苍何:手搓完字节AI硬件,我做了个五一智能旅行小装置(附万字沉浸式教程)", + "timestamp": "2025-04-30 13:13:35" + }, + { + "sender": "银色子弹-捷", + "content": "图片", + "timestamp": "2025-04-30 15:13:20" + }, + { + "sender": "银色子弹-捷", + "content": "@苍何 这个设备相当于是语音话筒吗? 真正大模型在云端高的是吗?", + "timestamp": "2025-04-30 15:13:57" + }, + { + "sender": "银色子弹-捷", + "content": "那这样的话手机本身也能做为这个终端啊,未什么要这个设备呢? 请教一下", + "timestamp": "2025-04-30 15:14:27" + }, + { + "sender": "昏沉沉的", + "content": "产品\n\n[引用](2025-04-30 15:14:27):那这样的话手机本身也能做为这个终端啊,未什么要这个设备呢? 请教一下", + "timestamp": "2025-04-30 15:17:57" + }, + { + "sender": "昏沉沉的", + "content": "可以嵌入到其他东西里面", + "timestamp": "2025-04-30 15:18:10" + }, + { + "sender": "昏沉沉的", + "content": "比如娃娃", + "timestamp": "2025-04-30 15:18:14" + }, + { + "sender": "银色子弹-捷", + "content": "各种高端玩具倒是可以啊", + "timestamp": "2025-04-30 15:32:42" + }, + { + "sender": "银色子弹-捷", + "content": "这样的玩具需要联网是必要的,wifi 或者蓝牙 或4G", + "timestamp": "2025-04-30 15:33:43" + }, + { + "sender": "tina  ", + "content": "是天猫精灵或者小度的迷你版?", + "timestamp": "2025-04-30 15:49:02" + }, + { + "sender": "向波", + "content": "嗯嗯,比较贵的是电池、大模型云服务、BOM材料、代工费几个部分", + "timestamp": "2025-04-30 15:50:52" + }, + { + "sender": "向波", + "content": "物联网卡一年几块钱,还好", + "timestamp": "2025-04-30 15:51:04" + }, + { + "sender": "银色子弹-捷", + "content": "其他都还好,大模型云服务这个可能贵", + "timestamp": "2025-04-30 15:52:12" + }, + { + "sender": "虫虫", + "content": "想想可能也还好 一个设备 一年能对话多少次 总共tokens消耗量有限 \n\n[引用](2025-04-30 15:52:12)银色子弹-捷:其他都还好,大模型云服务这个可能贵", + "timestamp": "2025-04-30 15:57:56" + }, + { + "sender": "tina  ", + "content": "这装置,应用在什么上?", + "timestamp": "2025-04-30 15:58:56" + }, + { + "sender": "虫虫", + "content": "比如毛茸茸玩具[机智]", + "timestamp": "2025-04-30 15:59:52" + }, + { + "sender": "兔子先生", + "content": "AI小智", + "timestamp": "2025-04-30 16:00:44" + }, + { + "sender": "兔子先生", + "content": "前段时间非常火", + "timestamp": "2025-04-30 16:00:50" + }, + { + "sender": "兔子先生", + "content": "卖的非常好", + "timestamp": "2025-04-30 16:00:58" + }, + { + "sender": "虫虫", + "content": "小智用户还是爱好者", + "timestamp": "2025-04-30 16:01:19" + }, + { + "sender": "虫虫", + "content": "还没有到终端产品形态", + "timestamp": "2025-04-30 16:01:30" + }, + { + "sender": "tina  ", + "content": "玩具的用户越来越少,市场也会越来越小\n\n[引用](2025-04-30 15:59:52)虫虫:比如毛茸茸玩具[机智]", + "timestamp": "2025-04-30 16:02:14" + }, + { + "sender": "虫虫", + "content": "宏观上判断不太准 但是现在市场还是有的", + "timestamp": "2025-04-30 16:07:36" + }, + { + "sender": "兔子先生", + "content": "不是玩具少,而是你不是他的用户,玩具市场目前逐年上升\n\n[引用](2025-04-30 16:02:14)苏州跨境财务:玩具的用户越来越少,市场也会越来越小", + "timestamp": "2025-04-30 16:21:28" + }, + { + "sender": "兔子先生", + "content": "图片", + "timestamp": "2025-04-30 16:30:30" + }, + { + "sender": "兔子先生", + "content": "日不落直播间即将来临[旺柴]", + "timestamp": "2025-04-30 16:30:48" + }, + { + "sender": "银色子弹-捷", + "content": "我是觉得玩具 接入蓝牙 的方式更实在,其他物联网卡的,我角度看是小众的小众了", + "timestamp": "2025-04-30 16:33:08" + }, + { + "sender": "银色子弹-捷", + "content": "最大的玩具就是AI家庭机器人,如果这个发展壮大,其他的小玩具就安然失色了", + "timestamp": "2025-04-30 16:34:07" + }, + { + "sender": "昏沉沉的", + "content": "是的 我了解的也是这样\n\n[引用](2025-04-30 16:21:28):不是玩具少,而是你不是他的用户,玩具市场目前逐年上升", + "timestamp": "2025-04-30 16:51:17" + }, + { + "sender": "🌕风林火山.培哲", + "content": "Manus邀请码现在还有人要吗", + "timestamp": "2025-04-30 17:10:54" + }, + { + "sender": "沙皮狗的忧伤", + "content": "有嘛", + "timestamp": "2025-04-30 17:11:10" + }, + { + "sender": "🌕风林火山.培哲", + "content": "要有魔法上网才行", + "timestamp": "2025-04-30 17:11:38" + }, + { + "sender": "🌕风林火山.培哲", + "content": "为了激活我科学上网买了一个月", + "timestamp": "2025-04-30 17:12:15" + }, + { + "sender": "沙皮狗的忧伤", + "content": "🔮我有", + "timestamp": "2025-04-30 17:13:06" + }, + { + "sender": "沙皮狗的忧伤", + "content": "我填了申请,就没信了", + "timestamp": "2025-04-30 17:13:31" + }, + { + "sender": "沙皮狗的忧伤", + "content": "去官网", + "timestamp": "2025-04-30 17:13:35" + }, + { + "sender": "贾👦🏻", + "content": "图片", + "timestamp": "2025-04-30 17:13:54" + }, + { + "sender": "贾👦🏻", + "content": "来\n\n[引用](2025-04-30 17:10:54)深圳-电脑厂家-培哲:Manus邀请码现在还有人要吗", + "timestamp": "2025-04-30 17:13:59" + }, + { + "sender": "贾👦🏻", + "content": "\"贾👦🏻\" 拍了拍 \"深圳-电脑厂家-培哲\" 看[胜利]烟花[烟花]", + "timestamp": "2025-04-30 17:16:56" + }, + { + "sender": "蜗牛", + "content": "我也需要", + "timestamp": "2025-04-30 17:17:03" + }, + { + "sender": "贾👦🏻", + "content": "扔出来 拼手速 哈哈", + "timestamp": "2025-04-30 17:17:18" + }, + { + "sender": "蜗牛", + "content": "@深圳-电脑厂家-培哲", + "timestamp": "2025-04-30 17:20:05" + }, + { + "sender": "苍何", + "content": "视频", + "timestamp": "2025-04-30 17:49:27" + }, + { + "sender": "AHapi²⁰²⁵", + "content": "图片", + "timestamp": "2025-04-30 17:54:37" + }, + { + "sender": "苍何", + "content": "这个是显眼包", + "timestamp": "2025-04-30 17:57:48" + }, + { + "sender": "昏沉沉的", + "content": "hhh", + "timestamp": "2025-04-30 17:58:28" + }, + { + "sender": "翟朗博369 ᯤ⁹ᴳ", + "content": "@深圳-电脑厂家-培哲 还有吗", + "timestamp": "2025-04-30 18:01:03" + }, + { + "sender": "梦ㄆ宇", + "content": "[憨笑]", + "timestamp": "2025-04-30 18:14:12" + }, + { + "sender": "昏沉沉的", + "content": "图片", + "timestamp": "2025-04-30 22:24:10" + } + ]"""}, + + ] + + + def process_msg(self,x): + """ + 识别json格式,并返回字典 + """ + pattern = re.compile('{.*}', flags=re.IGNORECASE | re.MULTILINE | re.S) + # print(pattern.search(json_data).group()) + + json_data = json.loads(pattern.search(x).group()) + return json_data + + + + +if __name__ == "__main__": + deepseek_api = DeepSeekApi("sk-2ed4377a895d4ce18e086258c254fc8e") + + response = deepseek_api.send_msg(module=0) + print(response) + + + + + + + + + + + diff --git a/pywxdump/api/export/exportJSON.py b/pywxdump/api/export/exportJSON.py index 06cf47c..c20a0e3 100644 --- a/pywxdump/api/export/exportJSON.py +++ b/pywxdump/api/export/exportJSON.py @@ -161,12 +161,12 @@ def export_json_mini_time_limit(wxid, outpath, db_config, my_wxid="我", start_part = start_createtime.replace(" ", "_").replace(":", "-") if start_createtime else "all" end_part = end_createtime.replace(" ", "_").replace(":", "-") if end_createtime else "now" time_suffix = f"_{start_part}_to_{end_part}" - - save_path = os.path.join(outpath, f"{wxid}_mini{time_suffix}.json") + filename = f"{wxid}_mini{time_suffix}.json" + save_path = os.path.join(outpath, filename) with open(save_path, "w", encoding="utf-8") as f: json.dump(mini_data, f, ensure_ascii=False, indent=indent) - return True, f"导出成功: {save_path}" + return True, f"导出成功: {save_path}", filename diff --git a/pywxdump/api/remote_server.py b/pywxdump/api/remote_server.py index 9aa8d49..58025ce 100644 --- a/pywxdump/api/remote_server.py +++ b/pywxdump/api/remote_server.py @@ -13,6 +13,7 @@ from collections import Counter from urllib.parse import quote, unquote from typing import List, Optional +import fastapi.requests from pydantic import BaseModel from fastapi import APIRouter, Response, Body, Query, Request from starlette.responses import StreamingResponse, FileResponse @@ -21,12 +22,15 @@ import pywxdump from pywxdump import decrypt_merge, get_core_db from pywxdump.db import DBHandler from pywxdump.db.utils import download_file, dat2img +from .api_utils.html import HtmlController from .export import export_csv, export_json, export_html from .export.exportJSON import export_json_mini, export_json_mini_time_limit from .rjson import ReJson, RqJson from .utils import error9999, gc, asyncError9999, rs_loger + + rs_api = APIRouter() @@ -466,13 +470,49 @@ def get_export_json(wxid: str = Body(..., embed=True)): if not os.path.exists(outpath): os.makedirs(outpath) - code, ret = export_json_mini_time_limit(wxid, outpath, db_config, my_wxid=my_wxid,start_createtime="2025-4-29 00:00:00", end_createtime="2025-4-30 00:00:00") + code, ret = export_json(wxid, outpath, db_config, my_wxid=my_wxid) if code: return ReJson(0, ret) else: return ReJson(2001, body=ret) +class ExportJsonMiniRequest(BaseModel): + start_createtime: str + end_createtime: str + +@rs_api.api_route('/export_json_mini_select_time', methods=["GET", 'POST']) +def get_export_json(wxid: str = Body(..., embed=True),time: ExportJsonMiniRequest = Body(..., embed=True)): + """ + 导出json,选择时间,迷你版本 + :return: + """ + my_wxid = gc.get_conf(gc.at, "last") + if not my_wxid: return ReJson(1001, body="my_wxid is required") + db_config = gc.get_conf(my_wxid, "db_config") + + if not wxid: + return ReJson(1002, body=f"username is required: {wxid}") + + outpath = os.path.join(gc.work_path, "export", my_wxid, "json", wxid) + if not os.path.exists(outpath): + os.makedirs(outpath) + + start_createtime = time.start_createtime # 格式为 "2025-05-01 18:06:00" + end_createtime = time.end_createtime + + code, ret,filename = export_json_mini_time_limit(wxid, outpath, db_config, my_wxid=my_wxid,start_createtime=start_createtime, end_createtime=end_createtime) + if code: + # 成功创建,执行生成可视化页面的逻辑 + # with open(os.path.join(gc.work_path, "export", my_wxid, "html", wxid, filename), "w", encoding="utf-8") as f: + # f.write( + # #现在是fake + # HtmlController().create_html(json_data=None) + # ) + return ReJson(0, ret) + + else: + return ReJson(2001, body=ret) @@ -671,4 +711,61 @@ def get_readme(): else: return ReJson(2001, body="status_code is not 200") + +class DifyApiModel(BaseModel): + api_key:str + base_url:str + + +@rs_api.api_route('/dify_setting', methods=["GET", 'POST']) +@error9999 +def dify_setting(request: Request = None, dify: DifyApiModel = Body(None, embed=True)): + """ + dify设置 + """ + + if request.method == "GET": + my_wxid = gc.get_conf(gc.at, "last") + if not my_wxid: return ReJson(1001, body="my_wxid is required") + gc.get_conf(my_wxid, "dify_setting") + + return ReJson(0, body=gc.get_conf(my_wxid, "dify_setting")) + + elif request.method == "POST": + my_wxid = gc.get_conf(gc.at, "last") + if not my_wxid: return ReJson(1001, body="my_wxid is required") + if not dify.api_key and not dify.base_url: + return ReJson(1002, body="dify_setting is required") + + gc.set_conf(my_wxid, "dify_setting", {"API_KEY": dify.api_key, "BASE_URL": dify.base_url}) + return ReJson(0, body=gc.get_conf(my_wxid, "dify_setting")) + return ReJson(2001, body="status_code is not 200") + +class DeepSeekApiModel(BaseModel): + api_key:str + + +@rs_api.api_route('/deepseek_setting', methods=["GET", 'POST']) +@error9999 +def deepseek_setting(request: Request = None, deepseek: DeepSeekApiModel = Body(None, embed=True)): + """ + deepseek设置 + """ + if request.method == "GET": + my_wxid = gc.get_conf(gc.at, "last") + if not my_wxid: return ReJson(1001, body="my_wxid is required") + gc.get_conf(my_wxid, "deepseek_setting") + + return ReJson(0, body=gc.get_conf(my_wxid, "deepseek_setting")) + + elif request.method == "POST": + my_wxid = gc.get_conf(gc.at, "last") + if not my_wxid: return ReJson(1001, body="my_wxid is required") + if not deepseek or not deepseek.api_key: + return ReJson(1002, body="deepseek_setting is required") + + gc.set_conf(my_wxid, "deepseek_setting", {"API_KEY": deepseek.api_key}) + return ReJson(0, body=gc.get_conf(my_wxid, "deepseek_setting")) + return ReJson(2001, body="status_code is not 200") + # END 关于、帮助、设置 *************************************************************************************************** diff --git a/pywxdump/api/utils.py b/pywxdump/api/utils.py index a1200a3..a44e01e 100644 --- a/pywxdump/api/utils.py +++ b/pywxdump/api/utils.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*-# # ------------------------------------------------------------------------------- -# Name: utils.py +# Name: api_utils.py # Description: # Author: xaoyaoo # Date: 2024/01/16 diff --git a/pywxdump/db/utils/__init__.py b/pywxdump/db/utils/__init__.py index ecbb005..90ce641 100644 --- a/pywxdump/db/utils/__init__.py +++ b/pywxdump/db/utils/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*-# # ------------------------------------------------------------------------------- # Name: __init__.py.py -# Description: db.utils +# Description: db.api_utils # Author: xaoyaoo # Date: 2024/07/23 # ------------------------------------------------------------------------------- diff --git a/pywxdump/ui/src/assets/base.css b/pywxdump/ui/src/assets/base.css index 8fc1c0c..351033c 100644 --- a/pywxdump/ui/src/assets/base.css +++ b/pywxdump/ui/src/assets/base.css @@ -35,6 +35,20 @@ --section-gap: 160px; } +/* 可视化页面的css*/ +:root { + --bg-ui-s-primary: #0f0e17; + --bg-ui-s-secondary: #1a1925; + --bg-ui-s-tertiary: #252336; + --text-ui-s-primary: #fffffe; + --text-ui-s-secondary: #a7a9be; + --accent-ui-s-primary: #ff8906; + --accent-ui-s-secondary: #f25f4c; + --accent-ui-s-tertiary: #e53170; + --accent-ui-s-blue: #3da9fc; + --accent-ui-s-purple: #7209b7; + --accent-ui-s-cyan: #00b4d8; +} /* @media (prefers-color-scheme: dark) { :root { diff --git a/pywxdump/ui/src/components/chatBackup/ChatExportMain.vue b/pywxdump/ui/src/components/chatBackup/ChatExportMain.vue index d6122d0..99edabb 100644 --- a/pywxdump/ui/src/components/chatBackup/ChatExportMain.vue +++ b/pywxdump/ui/src/components/chatBackup/ChatExportMain.vue @@ -11,6 +11,7 @@ import ExportJSON from "@/components/chatBackup/ExportJSON.vue"; import ExportHTML from "@/components/chatBackup/ExportHTML.vue"; import ExportPDF from "@/components/chatBackup/ExportPDF.vue"; import ExportDOCX from "@/components/chatBackup/ExportDOCX.vue"; +import ExportJSONMini from './ExportJSONMini.vue'; const props = defineProps({ wxid: { @@ -44,6 +45,10 @@ const setting = { brief: 'json', detail: "只包含文本,可用于数据分析,情感分析等方面。", }, + 'json-mini': { + brief: 'json-mini', + detail: "只包含文本,只有最小化的json格式。支持选择时间,注意不要选择太多时间,会导致导出数据过大影响AI分析。", + }, 'html': { brief: 'html-测试中', detail: "主要用于浏览器可视化查看。", @@ -91,6 +96,7 @@ const setting = { + diff --git a/pywxdump/ui/src/components/chatBackup/ExportJSONMini.vue b/pywxdump/ui/src/components/chatBackup/ExportJSONMini.vue new file mode 100644 index 0000000..53e7061 --- /dev/null +++ b/pywxdump/ui/src/components/chatBackup/ExportJSONMini.vue @@ -0,0 +1,65 @@ + + + + + \ No newline at end of file diff --git a/pywxdump/ui/src/router/index.ts b/pywxdump/ui/src/router/index.ts index e6b2c2f..95c8f8b 100644 --- a/pywxdump/ui/src/router/index.ts +++ b/pywxdump/ui/src/router/index.ts @@ -23,6 +23,11 @@ const router = createRouter({ name: 'chat', component: () => import((`@/views/ChatView.vue`)) }, + { + path: '/chat2ui', + name: 'chat2ui', + component: () => import((`@/views/Chat2UiView.vue`)) + }, { path: '/contacts', name: 'contacts', diff --git a/pywxdump/ui/src/views/Chat2UiView.vue b/pywxdump/ui/src/views/Chat2UiView.vue new file mode 100644 index 0000000..feab24a --- /dev/null +++ b/pywxdump/ui/src/views/Chat2UiView.vue @@ -0,0 +1,1091 @@ + + + + + \ No newline at end of file diff --git a/pywxdump/wx_core/utils/common_utils.py b/pywxdump/wx_core/utils/common_utils.py index 7b899e3..4456e7c 100644 --- a/pywxdump/wx_core/utils/common_utils.py +++ b/pywxdump/wx_core/utils/common_utils.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*-# # ------------------------------------------------------------------------------- -# Name: utils.py +# Name: api_utils.py # Description: # Author: xaoyaoo # Date: 2023/12/25 diff --git a/setup.py b/setup.py index cd81282..c7cfde2 100644 --- a/setup.py +++ b/setup.py @@ -45,17 +45,17 @@ setup( license='MIT', # packages=find_packages(exclude=[]), - packages=['pywxdump', 'pywxdump.ui', 'pywxdump.wx_core', 'pywxdump.wx_core.utils', 'pywxdump.analyzer', - 'pywxdump.api', 'pywxdump.api.export', 'pywxdump.db', 'pywxdump.db.utils'], + packages=['pywxdump', 'pywxdump.ui', 'pywxdump.wx_core', 'pywxdump.wx_core.api_utils', 'pywxdump.analyzer', + 'pywxdump.api', 'pywxdump.api.export', 'pywxdump.db', 'pywxdump.db.api_utils'], package_dir={'pywxdump': 'pywxdump', 'pywxdump.wx_core': 'pywxdump/wx_core', - 'pywxdump.wx_core.utils': 'pywxdump/wx_core/utils', + 'pywxdump.wx_core.api_utils': 'pywxdump/wx_core/api_utils', 'pywxdump.analyzer': 'pywxdump/analyzer', 'pywxdump.ui': 'pywxdump/ui', 'pywxdump.api': 'pywxdump/api', 'pywxdump.api.export': 'pywxdump/api/export', 'pywxdump.db': 'pywxdump/db', - 'pywxdump.db.utils': 'pywxdump/db/utils' + 'pywxdump.db.api_utils': 'pywxdump/db/api_utils' }, # include_package_data=True, package_data={ diff --git a/temp.md b/temp.md new file mode 100644 index 0000000..30d8dac --- /dev/null +++ b/temp.md @@ -0,0 +1,5 @@ +- 导出json,可选时间 +- 单独导航栏 Ai可视化 +- 可以进行可视化的文件列表 +- 已经可视化的列表 +- 查看 diff --git a/test.html b/test.html index 5a69d38..e2700e6 100644 --- a/test.html +++ b/test.html @@ -1,8 +1,9 @@ - + + - aaaaaaaaaa紧急事件报告日报 - 2025-04-27至2025-04-29 + 恋爱报告报告 - 2025-04-29 至 2025-04-30
    -

    aaaaaaaaaa紧急事件报告日报

    -

    2025-04-27至2025-04-29

    +

    恋爱报告报告

    +

    2025-04-29 至 2025-04-30

    - 总消息数:302 - 活跃用户:4 - 时间范围:2025-04-27 11:33:20至2025-04-29 19:25:36 + 总消息数:500+ + 活跃用户:2 + 时间范围:00:05:04 至 22:20:26
    - + + +

    今日讨论热点

    -
    -

    计算机设计大赛项目准备

    -
    学术竞赛
    -

    群成员围绕中国大学生计算机设计大赛参赛作品《文书宝典——智能公文库与写作平台》展开密集讨论,涉及文档编写、PPT制作、答辩视频准备等工作。

    -
    - PPT制作 - 技术展示 - 文档格式 -
    -
    提及次数:287
    + + +
    +

    恋爱沟通

    +
    情感交流
    +

    双方围绕情感需求、沟通方式和相互理解展开多次对话,涉及'控制欲''陪伴需求''表达方式'等核心矛盾点。典型对话如'你就不能说话吗'-'不困了,跟我聊聊天',体现双方对沟通频率的认知差异。

    +
    + 控制陪伴理解
    +
    提及次数:30+
    +
    + +
    +

    项目合作

    +
    学业协作
    +

    4月29日上午集中讨论服务设计项目开发事宜,涉及原型设计、比赛规划、老师对接等具体内容。昏沉沉的提出开发支持意愿,要哄宝宝开心则负责团队协调,双方就'高保真原型''互联网+大赛'等专业概念进行多次确认。

    +
    + 原型开发比赛 +
    +
    提及次数:50+
    +
    + +
    - +

    实用教程与资源分享

    -
    -
    RESOURCE
    -

    CSDN技术博客:计算机大赛经验

    -
    - 分享者:昏沉沉的 - -
    -

    关于计算机设计大赛的技术实现参考文章

    -
    -

    要点:

    -
      -
    • 获奖项目技术分析
    • -
    • 功能实现方案
    • -
    -
    - -
    分类:技术参考
    + + +
    +
    RESOURCE
    +

    产品设计开发流程

    +
    + 分享者:昏沉沉的 +
    -
    -
    TUTORIAL
    -

    在线文档:技术要点整理

    -
    - 分享者:昏沉沉的 - -
    -

    项目核心技术要点汇总文档

    -
    -

    要点:

    -
      -
    • 前端技术
    • -
    • 后端架构
    • -
    • AI应用
    • -
    -
    - -
    分类:技术文档
    +

    讨论软件产品开发各阶段要点,强调从调研到高保真原型的设计闭环

    +
    +

    要点:

    +
    • 功能闭环
    • UI完善
    • 比赛适配
    + +
    分类:产品设计
    +
    + +
    - +

    重要消息汇总

    -
    -
    - 2025-04-28 21:18:13 - 杨莅沅老师 - NOTICE - 优先级:高 -
    -

    秦大拿,现在进度怎么样了,今晚能交上吗

    + + +
    +
    + 2025-04-29 00:29:04 + 要哄宝宝开心,宝宝开心我就开心 + OTHER + 优先级:高
    -
    -
    - 2025-04-29 17:06:55 - 杨莅沅老师 - ANNOUNCEMENT - 优先级:高 -
    -

    秦大拿看一遍ppt内容还有要修正的吗

    +

    只要你做的不论是我,还是外人看来是爱我的

    +
    +

    完整情感需求表达

    + +
    +
    + 2025-04-29 10:15:17 + 昏沉沉的 + EVENT + 优先级:中 +
    +

    你说你男朋友做开发的 做出来原型的话可以让你男朋友看一下 可以开发

    +
    +

    项目合作具体提案

    +
    +
    + + +
    - +

    有趣对话或金句

    -
    -
    DIALOGUE
    -
    -
    -
    - 杨莅沅老师 - 2025-04-29 06:15:34 -
    -

    那你硬拖着,看我挨骂啊

    -
    -
    -
    - 数媒技术春季班冯圣磊 - 2025-04-29 06:16:08 -
    -

    [呲牙]

    -
    -
    -
    关于PPT制作进度的幽默对峙
    -
    相关话题:项目时间管理
    + + +
    +
    DIALOGUE
    +
    + +
    +
    + 要哄宝宝开心,宝宝开心我就开心 + 2025-04-29 00:07:44
    +

    不困了,跟我聊聊天

    +
    +
    +
    + 昏沉沉的 + 2025-04-29 00:07:42 +
    +

    不能跟你说话吗

    +
    +
    +
    沟通需求 vs 陪伴需求
    +
    相关话题:情感表达差异
    +
    + +
    - +

    问题与解答

    -
    -
    -
    - 昏沉沉的 - 2025-04-29 08:26:44 -
    -

    你用ai直接生成的吗

    -
    - PPT制作 - AI应用 -
    + + +
    +
    +
    + 要哄宝宝开心,宝宝开心我就开心 + 2025-04-29 10:33:25
    -
    -
    -
    - 数媒技术春季班冯圣磊 - 2025-04-29 08:27:21 - 最佳回答 -
    -

    不完全是,有些是昨晚提取的,今早列上

    -
    +

    你开发要钱吗

    +
    + 项目费用
    +
    + +
    +
    + 昏沉沉的 + 2025-04-29 10:45:18 + 最佳回答 +
    +

    那不就完了

    +
    +
    +
    + +
    - +

    群内数据可视化

    - + +

    话题热度

    -
    -
    文档修改
    -
    35%
    -
    -
    -
    -
    42条消息
    -
    -
    -
    PPT制作
    -
    30%
    -
    -
    -
    -
    36条消息
    + + + + +
    +
    情感交流
    +
    45%%
    +
    +
    +
    200+条消息
    +
    +
    项目讨论
    +
    30%%
    +
    +
    +
    +
    150+条消息
    +
    + + +
    + + + +

    话唠榜

    -
    -
    1
    -
    -
    昏沉沉的
    -
    128 条消息
    -
    - 技术主导 - 进度督促 -
    + +
    +
    1
    +
    +
    要哄宝宝开心,宝宝开心我就开心
    +
    发言数:300+
    +
    + 情感表达细节追问
    -
    -
    -
    2
    -
    -
    杨莅沅老师
    -
    87 条消息
    -
    - 质量把控 - 格式要求 -
    +
    + OK
    - -

    熬夜冠军

    -
    -
    -
    👑
    -
    -
    刘蕴萱
    -
    深夜文档侠
    -
    最晚活跃时间:2025-04-28 04:01:13
    -
    深夜消息数:5
    -
    注:熬夜时段定义为23:00-06:00,已考虑不同时区
    -
    -
    +
    - + + +

    熬夜冠军

    +
    + + + +
    +
    👑
    +
    +
    昏沉沉的
    +
    深夜程序员
    +
    最晚活跃时间:01:42:38
    +
    深夜消息数:50+
    +
    对不起
    +
    注:熬夜时段定义为23:00-06:00,已考虑不同时区
    +
    + + +
    +
    + +

    热门词云

    +
    - PPT - 文档 + + + + 开发 + + 睡觉 + +
    +
    -
    + +
    - 项目材料 相关词汇 + 项目 相关词汇
    -
    + +
    - 技术术语 相关词汇 + 情感 相关词汇
    + +
    +
    -

    数据来源:aaaaaaaaaa紧急事件聊天记录

    -

    生成时间:2025-04-30 10:00:00

    -

    统计周期:2025-04-27 11:33:20 至 2025-04-29 19:25:36

    +

    数据来源:恋爱私聊记录聊天记录

    +

    生成时间:2025-05-01 10:00:00

    +

    统计周期:2025-04-29 至 2025-04-30 [时间范围]

    免责声明:本报告内容基于群聊公开讨论,如有不当内容或侵权问题请联系管理员处理。

    - \ No newline at end of file + + + + \ No newline at end of file diff --git a/test.py b/test.py index dfb8074..3410376 100644 --- a/test.py +++ b/test.py @@ -667,7 +667,41 @@ def main(json_data):

    免责声明:本报告内容基于群聊公开讨论,如有不当内容或侵权问题请联系管理员处理。

    - + """ @@ -690,7 +724,7 @@ def main(json_data): # 使用正则表达式查找json字符串 pattern = re.compile('{.*}', flags=re.IGNORECASE | re.MULTILINE | re.S) - print(pattern.search(json_data).group()) + # print(pattern.search(json_data).group()) json_data = json.loads(pattern.search(json_data).group()) # json_data = json.loads(json_data) @@ -916,6 +950,6 @@ def main(json_data): if __name__ == '__main__': - json_data = r"```json\n{\n\"header\": {\n\"title\": \"群聊报告\",\n\"date\": \"2025-04-29\",\n\"metaInfo\": {\n\"totalMessages\": \"30\",\n\"activeUsers\": \"12\",\n\"timeRange\": \"07:03:10 - 15:36:25\"\n}\n},\n\"sections\": {\n\"hotTopics\": {\n\"items\": [\n{\n\"name\": \"AI技术讨论\",\n\"category\": \"科技\",\n\"summary\": \"群内围绕AI技术进行了深入讨论,包括Qwen3模型的开源、Vidu Q1的体验、夸克AI相机等话题。\",\n\"keywords\": [\"Qwen3\", \"Vidu Q1\", \"夸克AI相机\"],\n\"mentions\": \"10\"\n},\n{\n\"name\": \"熬夜与加班\",\n\"category\": \"生活\",\n\"summary\": \"群成员讨论了熬夜和加班的现象,尤其是科技行业的加班文化及其对身体的影响。\",\n\"keywords\": [\"熬夜\", \"加班\", \"卷王\"],\n\"mentions\": \"8\"\n}\n]\n},\n\"tutorials\": {\n\"items\": [\n{\n\"type\": \"TUTORIAL\",\n\"title\": \"Qwen3深夜正式开源\",\n\"sharedBy\": \"苍何\",\n\"time\": \"2025-04-29 09:20:23\",\n\"summary\": \"Qwen3小尺寸也能大力出奇迹,欢迎来到这个荒诞又灿烂的时代。\",\n\"keyPoints\": [\"开源\", \"小尺寸\", \"高性能\"],\n\"url\": \"http://mp.weixin.qq.com/s?__biz=MzIyMzA5NjEyMA==&mid=2647670717&idx=1&sn=edec1f6cda0c1227e72cd07abf4228ff&chksm=f19a699bb993eb9ed2850ba329f382668bc7edc8a2d7d4a94de2d29c15cf87aa05bf6b48dc6d&mpshare=1&scene=1&srcid=0429TzXAJtS5jA2QI9hLEroV&sharer_shareinfo=7fd7493f3ccf9923f55b48a05619ce1b&sharer_shareinfo_first=fc872ba73c219b858d700a9db530b5b1#rd\",\n\"domain\": \"mp.weixin.qq.com\",\n\"category\": \"AI\"\n},\n{\n\"type\": \"TUTORIAL\",\n\"title\": \"体验完刚上线的Vidu Q1\",\n\"sharedBy\": \"苍何\",\n\"time\": \"2025-04-29 09:39:42\",\n\"summary\": \"AI视频清晰度,一致性都上了一个台阶。\",\n\"keyPoints\": [\"Vidu Q1\", \"AI视频\", \"清晰度\"],\n\"url\": \"http://mp.weixin.qq.com/s?__biz=MzU4NTE1Mjg4MA==&mid=2247493267&idx=1&sn=0189fb501578ce8e27142fbe2f590d03&chksm=fc9a946728c367005c19cb5a335300d05d51a441f9f20424a0a72c904a47bdf003252576318a&mpshare=1&scene=1&srcid=04297l70B2zsuypDfjUh0rh5&sharer_shareinfo=181efb947f938ab90786c776bf7bbda7&sharer_shareinfo_first=181efb947f938ab90786c776bf7bbda7#rd\",\n\"domain\": \"mp.weixin.qq.com\",\n\"category\": \"AI\"\n},\n{\n\"type\": \"TUTORIAL\",\n\"title\": \"阿里新出的夸克AI相机\",\n\"sharedBy\": \"苍何\",\n\"time\": \"2025-04-29 09:42:38\",\n\"summary\": \"夸克AI相机超多新奇的玩法,太抽象了。\",\n\"keyPoints\": [\"夸克AI相机\", \"新奇玩法\", \"抽象\"],\n\"url\": \"http://mp.weixin.qq.com/s?__biz=MzU4NTE1Mjg4MA==&mid=2247493275&idx=1&sn=93556ddd1da7fb8733a23a7c4adbb76b&chksm=fc2a2d25774cce23c75acd8850b85c585c0bcf78d14b810e157efaec5106abf563cf58e26aef&mpshare=1&scene=1&srcid=0429vDf8NbEzNLBQQyFlABmU&sharer_shareinfo=28b94477ec8201b88aa30338e82e8999&sharer_shareinfo_first=28b94477ec8201b88aa30338e82e8999#rd\",\n\"domain\": \"mp.weixin.qq.com\",\n\"category\": \"AI\"\n},\n{\n\"type\": \"TUTORIAL\",\n\"title\": \"仅2MB,Windows瞬间超级丝滑!\",\n\"sharedBy\": \"AHapi²⁰²⁵\",\n\"time\": \"2025-04-29 11:13:38\",\n\"summary\": \"这才是,真神器!\",\n\"keyPoints\": [\"Windows优化\", \"2MB\", \"神器\"],\n\"url\": \"https://mp.weixin.qq.com/s/es77Jc6Du03ppJD5XJeQUg\",\n\"domain\": \"mp.weixin.qq.com\",\n\"category\": \"工具\"\n}\n]\n},\n\"importantMessages\": {\n\"items\": [\n{\n\"time\": \"2025-04-29 10:00:18\",\n\"sender\": \"苍何\",\n\"type\": \"NEWS\",\n\"priority\": \"高\",\n\"content\": \"2025年04月29日 AI科技早报\",\n\"fullContent\": \"1、阿里开源8款Qwen3模型,集成MCP,性能超DeepSeek-R1、OpenAI o1。\\\\n\\\\n2、Qafind Labs发布ChatDLM扩散语言模型,推理速度高达2800 tokens/s。\\\\n\\\\n3、腾讯开源Kuikly跨端框架,基于Kotlin支持多平台开发,已应用于QQ。\\\\n\\\\n4、OpenAI 推出 ChatGPT 购物功能,用户可通过 ChatGPT 便捷购物。\\\\n\\\\n5、字节Seed团队提出PHD-Transformer,突破预训练长度扩展瓶颈。\\\\n\\\\n6、百度发布文心快码3.5版本与多模态AI智能体Zulu,助力工程师提效。\\\\n\\\\n7、Kimi与财新传媒合作,提供专业财经内容,推动AI+传统媒体融合。\\\\n\\\\n8、苹果加速「N50」智能眼镜项目,融合AI技术预计2027年亮相。\\\\n\\\\n9、研究显示OpenAI o3在病毒学领域超越94%人类专家,生物安全引关注。\\\\n\\\\n10、华为测试自研AI芯片Ascend 910D,旨在替代英伟达H100芯片。\\\\n\\\\n11、🔥【记得收藏】早报同步更新到开源 AI 知识库:https://u55dyuejxc.feishu.cn/wiki/FkmNwxYHDigJ3akIUGHc8MSTn4d\"\n}\n]\n},\n\"dialogues\": {\n\"items\": [\n{\n\"type\": \"DIALOGUE\",\n\"messages\": [\n{\n\"speaker\": \"好名字\",\n\"time\": \"2025-04-29 08:16:23\",\n\"content\": \"这个我弄完,ai做的小程序有bug,流程走不通,还改不了[捂脸]\"\n},\n{\n\"speaker\": \"贾👦🏻\",\n\"time\": \"2025-04-29 08:54:33\",\n\"content\": \"可以微调 不过源码需要买的\"\n},\n{\n\"speaker\": \"好名字\",\n\"time\": \"2025-04-29 09:13:32\",\n\"content\": \"微调一次,然后再想调就需要开会员了\"\n},\n{\n\"speaker\": \"贾👦🏻\",\n\"time\": \"2025-04-29 09:14:09\",\n\"content\": \"需求变更一个字 就需要重新购买[破涕为笑]\"\n}\n],\n\"highlight\": \"需求变更一个字 就需要重新购买[破涕为笑]\",\n\"relatedTopic\": \"AI小程序开发\"\n},\n{\n\"type\": \"DIALOGUE\",\n\"messages\": [\n{\n\"speaker\": \"苍何\",\n\"time\": \"2025-04-29 09:26:49\",\n\"content\": \"我熬不动\"\n},\n{\n\"speaker\": \"AHapi²⁰²⁵\",\n\"time\": \"2025-04-29 09:27:25\",\n\"content\": \"不要卷别人[旺柴]别人写了 就不卷他们了\"\n},\n{\n\"speaker\": \"苍何\",\n\"time\": \"2025-04-29 09:27:55\",\n\"content\": \"新闻得第一时间,做不到写了也没啥用\"\n},\n{\n\"speaker\": \"苍何\",\n\"time\": \"2025-04-29 09:28:03\",\n\"content\": \"还不如写些应用\"\n},\n{\n\"speaker\": \"大风(Wind)\",\n\"time\": \"2025-04-29 09:28:23\",\n\"content\": \"看看哪些是5-7点发推文的,基本都是卷王了\"\n},\n{\n\"speaker\": \"沉默王二\",\n\"time\": \"2025-04-29 09:28:44\",\n\"content\": \"身体能扛住确实离谱\"\n},\n{\n\"speaker\": \"苍何\",\n\"time\": \"2025-04-29 09:29:03\",\n\"content\": \"是啊,太肝了\"\n},\n{\n\"speaker\": \"苍何\",\n\"time\": \"2025-04-29 09:29:39\",\n\"content\": \"我前天熬夜测vidu,人已经废了好几天\"\n},\n{\n\"speaker\": \"AHapi²⁰²⁵\",\n\"time\": \"2025-04-29 09:30:02\",\n\"content\": \"5-7点还好 早点睡也还行\"\n},\n{\n\"speaker\": \"大风(Wind)\",\n\"time\": \"2025-04-29 09:30:14\",\n\"content\": \"效果咋样\"\n},\n{\n\"speaker\": \"大风(Wind)\",\n\"time\": \"2025-04-29 09:30:21\",\n\"content\": \"5点发布的\"\n},\n{\n\"speaker\": \"大风(Wind)\",\n\"time\": \"2025-04-29 09:30:52\",\n\"content\": \"2小时内出文\"\n},\n{\n\"speaker\": \"沉默王二\",\n\"time\": \"2025-04-29 09:31:00\",\n\"content\": \"意味着阿里的 coder 们也在加班和熬夜\"\n},\n{\n\"speaker\": \"AHapi²⁰²⁵\",\n\"time\": \"2025-04-29 09:40:18\",\n\"content\": \"他们加班熬夜 赚的还是多啊[Facepalm]我们加班熬夜 就一点屁钱\"\n}\n],\n\"highlight\": \"他们加班熬夜 赚的还是多啊[Facepalm]我们加班熬夜 就一点屁钱\",\n\"relatedTopic\": \"加班文化\"\n}\n]\n},\n\"qa\": {\n\"items\": [\n{\n\"question\": {\n\"asker\": \"银色子弹-捷\",\n\"time\": \"2025-04-29 11:10:26\",\n\"content\": \"问一下win11电脑,你长时间没清理,运行慢,一般用什么来清理电脑? 不要360啊,那个太流氓了,想知道各位大佬有没有优秀的软件推荐一下\",\n\"tags\": [\"Windows优化\", \"清理工具\"]\n},\n\"answers\": [\n{\n\"responder\": \"昏沉沉的\",\n\"time\": \"2025-04-29 11:11:59\",\n\"content\": \"ccclean\",\n\"isAccepted\": false\n},\n{\n\"responder\": \"🤑程序儒\",\n\"time\": \"2025-04-29 11:13:07\",\n\"content\": \"360极速版、Wise Care 365\",\n\"isAccepted\": false\n},\n{\n\"responder\": \"AHapi²⁰²⁵\",\n\"time\": \"2025-04-29 11:13:38\",\n\"content\": \"仅2MB,Windows瞬间超级丝滑!\\\\n这才是,真神器!\\\\n\\\\n点击查看详情\",\n\"isAccepted\": false\n}\n]\n},\n{\n\"question\": {\n\"asker\": \"ಠ_ಠ 闲鱼一条ಠ_ಠ\",\n\"time\": \"2025-04-29 11:37:49\",\n\"content\": \"请问哪位哥还有扣子的邀请码吗?\",\n\"tags\": [\"邀请码\", \"扣子\"]\n},\n\"answers\": [\n{\n\"responder\": \"贾👦🏻\",\n\"time\": \"2025-04-29 11:40:37\",\n\"content\": \"RootUser_2105656329 邀请你体验扣子空间,快来和 Agent 一起开始你的工作吧!\\\\nhttps://www.coze.cn/space-preview?invite_code=SCL7DAL0\",\n\"isAccepted\": true\n},\n{\n\"responder\": \"9527\",\n\"time\": \"2025-04-29 11:47:43\",\n\"content\": \"RootUser_2106519373 邀请你体验扣子空间,快来和 Agent 一起开始你的工作吧!\\\\nhttps://www.coze.cn/space-preview?invite_code=A8IT4MUE\",\n\"isAccepted\": false\n},\n{\n\"responder\": \"9527\",\n\"time\": \"2025-04-29 11:47:53\",\n\"content\": \"RootUser_2106519373 邀请你体验扣子空间,快来和 Agent 一起开始你的工作吧!\\\\nhttps://www.coze.cn/space-preview?invite_code=7QUCYZKC\",\n\"isAccepted\": false\n}\n]\n}\n]\n},\n\"analytics\": {\n\"heatmap\": [\n{\n\"topic\": \"AI技术\",\n\"percentage\": \"40%\",\n\"color\": \"#3da9fc\",\n\"count\": \"12\"\n},\n{\n\"topic\": \"熬夜与加班\",\n\"percentage\": \"30%\",\n\"color\": \"#4361ee\",\n\"count\": \"9\"\n},\n{\n\"topic\": \"工具推荐\",\n\"percentage\": \"20%\",\n\"color\": \"#00b4d8\",\n\"count\": \"6\"\n},\n{\n\"topic\": \"邀请码\",\n\"percentage\": \"10%\",\n\"color\": \"#4895ef\",\n\"count\": \"3\"\n}\n],\n\"chattyRanking\": [\n{\n\"rank\": 1,\n\"name\": \"苍何\",\n\"count\": \"7\",\n\"characteristics\": [\"技术分享\", \"熬夜达人\"],\n\"commonWords\": [\"AI\", \"熬夜\", \"开源\"]\n},\n{\n\"rank\": 2,\n\"name\": \"AHapi²⁰²⁵\",\n\"count\": \"6\",\n\"characteristics\": [\"幽默\", \"工具推荐\"],\n\"commonWords\": [\"旺柴\", \"神器\", \"加班\"]\n},\n{\n\"rank\": 3,\n\"name\": \"大风(Wind)\",\n\"count\": \"4\",\n\"characteristics\": [\"提问\", \"互动\"],\n\"commonWords\": [\"效果\", \"发布\", \"卷王\"]\n}\n],\n\"nightOwl\": {\n\"name\": \"苍何\",\n\"title\": \"熬夜冠军\",\n\"latestTime\": \"2025-04-29 09:42:54\",\n\"messageCount\": \"7\",\n\"lastMessage\": \"我熬夜写了这一篇[旺柴]\"\n}\n},\n\"wordCloud\": {\n\"words\": [\n{\n\"text\": \"AI\",\n\"size\": 38,\n\"color\": \"#00b4d8\",\n\"rotation\": -15\n},\n{\n\"text\": \"熬夜\",\n\"size\": 32,\n\"color\": \"#4361ee\",\n\"rotation\": 0\n},\n{\n\"text\": \"开源\",\n\"size\": 28,\n\"color\": \"#00b4d8\",\n\"rotation\": 15\n},\n{\n\"text\": \"加班\",\n\"size\": 24,\n\"color\": \"#4361ee\",\n\"rotation\": -10\n},\n{\n\"text\": \"Qwen3\",\n\"size\": 22,\n\"color\": \"#00b4d8\",\n\"rotation\": 10\n},\n{\n\"text\": \"Vidu Q1\",\n\"size\": 20,\n\"color\": \"#4361ee\",\n\"rotation\": -5\n},\n{\n\"text\": \"夸克AI相机\",\n\"size\": 18,\n\"color\": \"#00b4d8\",\n\"rotation\": 5\n},\n{\n\"text\": \"卷王\",\n\"size\": 16,\n\"color\": \"#4361ee\",\n\"rotation\": 0\n}\n],\n\"legend\": [\n{\"color\": \"#00b4d8\", \"label\": \"AI 相关词汇\"},\n{\"color\": \"#4361ee\", \"label\": \"生活 相关词汇\"}\n]\n}\n},\n\"footer\": {\n\"dataSource\": \"群聊聊天记录\",\n\"generationTime\": \"2025-04-29 16:00:00\",\n\"statisticalPeriod\": \"2025-04-29 07:03:10 - 15:36:25\",\n\"disclaimer\": \"本报告内容基于群聊公开讨论,如有不当内容或侵权问题请联系管理员处理。\"\n}\n}\n```" + json_data = r"```json\n{\n\"header\": {\n\"title\": \"群聊报告\",\n\"date\": \"2025-04-29\",\n\"metaInfo\": {\n\"totalMessages\": \"35\",\n\"activeUsers\": \"12\",\n\"timeRange\": \"07:03:10 - 15:36:25\"\n}\n},\n\"sections\": {\n\"hotTopics\": {\n\"items\": [\n{\n\"name\": \"AI技术讨论\",\n\"category\": \"科技\",\n\"summary\": \"群内围绕Qwen3开源、Vidu Q1体验、夸克AI相机等AI技术展开热烈讨论,涉及模型性能、应用场景和开发者体验。多位成员分享了相关技术文章和体验报告。\",\n\"keywords\": [\"Qwen3\", \"Vidu\", \"AI相机\"],\n\"mentions\": \"15\"\n},\n{\n\"name\": \"熬夜与工作压力\",\n\"category\": \"生活\",\n\"summary\": \"成员们讨论熬夜工作现象,分享各自熬夜经历,对比互联网大厂与普通开发者的工作强度差异,引发关于工作生活平衡的思考。\",\n\"keywords\": [\"熬夜\", \"加班\", \"工作强度\"],\n\"mentions\": \"8\"\n}\n]\n},\n\"tutorials\": {\n\"items\": [\n{\n\"type\": \"TUTORIAL\",\n\"title\": \"体验完刚上线的Vidu Q1,后劲有点大(附AI视频创作教程)\",\n\"sharedBy\": \"苍何\",\n\"time\": \"2025-04-29 09:39:42\",\n\"summary\": \"分享Vidu Q1 AI视频创作工具的体验和教程,介绍其清晰度和一致性的提升。\",\n\"keyPoints\": [\"AI视频清晰度提升\", \"一致性改进\"],\n\"url\": \"http://mp.weixin.qq.com/s?__biz=MzU4NTE1Mjg4MA==&mid=2247493267&idx=1&sn=0189fb501578ce8e27142fbe2f590d03&chksm=fc9a946728c367005c19cb5a335300d05d51a441f9f20424a0a72c904a47bdf003252576318a&mpshare=1&scene=1&srcid=04297l70B2zsuypDfjUh0rh5&sharer_shareinfo=181efb947f938ab90786c776bf7bbda7&sharer_shareinfo_first=181efb947f938ab90786c776bf7bbda7#rd\",\n\"domain\": \"mp.weixin.qq.com\",\n\"category\": \"AI工具\"\n},\n{\n\"type\": \"TUTORIAL\",\n\"title\": \"阿里新出的夸克AI相机,强大到我有点陌生\",\n\"sharedBy\": \"苍何\",\n\"time\": \"2025-04-29 09:42:38\",\n\"summary\": \"介绍夸克AI相机的新奇玩法和功能,展示其强大的AI图像处理能力。\",\n\"keyPoints\": [\"新奇玩法\", \"抽象功能\"],\n\"url\": \"http://mp.weixin.qq.com/s?__biz=MzU4NTE1Mjg4MA==&mid=2247493275&idx=1&sn=93556ddd1da7fb8733a23a7c4adbb76b&chksm=fc2a2d25774cce23c75acd8850b85c585c0bcf78d14b810e157efaec5106abf563cf58e26aef&mpshare=1&scene=1&srcid=0429vDf8NbEzNLBQQyFlABmU&sharer_shareinfo=28b94477ec8201b88aa30338e82e8999&sharer_shareinfo_first=28b94477ec8201b88aa30338e82e8999#rd\",\n\"domain\": \"mp.weixin.qq.com\",\n\"category\": \"AI应用\"\n},\n{\n\"type\": \"RESOURCE\",\n\"title\": \"仅2MB,Windows瞬间超级丝滑!\",\n\"sharedBy\": \"AHapi²⁰²⁵\",\n\"time\": \"2025-04-29 11:13:38\",\n\"summary\": \"分享一款轻量级Windows优化工具,声称能显著提升系统运行速度。\",\n\"keyPoints\": [\"2MB大小\", \"系统优化\"],\n\"url\": \"https://mp.weixin.qq.com/s/es77Jc6Du03ppJD5XJeQUg\",\n\"domain\": \"mp.weixin.qq.com\",\n\"category\": \"系统工具\"\n}\n]\n},\n\"importantMessages\": {\n\"items\": [\n{\n\"time\": \"2025-04-29 10:00:18\",\n\"sender\": \"苍何\",\n\"type\": \"NEWS\",\n\"priority\": \"高\",\n\"content\": \"2025年04月29日 AI科技早报:阿里开源8款Qwen3模型,腾讯开源Kuikly跨端框架,OpenAI推出ChatGPT购物功能等11条重要新闻。\",\n\"fullContent\": \"2025年04月29日 AI科技早报1、阿里开源8款Qwen3模型,集成MCP,性能超DeepSeek-R1、OpenAI o1。2、Qafind Labs发布ChatDLM扩散语言模型,推理速度高达2800 tokens/s。3、腾讯开源Kuikly跨端框架,基于Kotlin支持多平台开发,已应用于QQ。4、OpenAI 推出 ChatGPT 购物功能,用户可通过 ChatGPT 便捷购物。5、字节Seed团队提出PHD-Transformer,突破预训练长度扩展瓶颈。6、百度发布文心快码3.5版本与多模态AI智能体Zulu,助力工程师提效。7、Kimi与财新传媒合作,提供专业财经内容,推动AI+传统媒体融合。8、苹果加速「N50」智能眼镜项目,融合AI技术预计2027年亮相。9、研究显示OpenAI o3在病毒学领域超越94%人类专家,生物安全引关注。10、华为测试自研AI芯片Ascend 910D,旨在替代英伟达H100芯片。11、🔥【记得收藏】早报同步更新到开源 AI 知识库:https://u55dyuejxc.feishu.cn/wiki/FkmNwxYHDigJ3akIUGHc8MSTn4d\"\n}\n]\n},\n\"dialogues\": {\n\"items\": [\n{\n\"type\": \"DIALOGUE\",\n\"messages\": [\n{\n\"speaker\": \"好名字\",\n\"time\": \"2025-04-29 08:16:23\",\n\"content\": \"这个我弄完,ai做的小程序有bug,流程走不通,还改不了[捂脸]\"\n},\n{\n\"speaker\": \"贾👦🏻\",\n\"time\": \"2025-04-29 08:54:33\",\n\"content\": \"可以微调 不过源码需要买的\"\n},\n{\n\"speaker\": \"好名字\",\n\"time\": \"2025-04-29 09:13:32\",\n\"content\": \"微调一次,然后再想调就需要开会员了\"\n},\n{\n\"speaker\": \"贾👦🏻\",\n\"time\": \"2025-04-29 09:14:09\",\n\"content\": \"需求变更一个字 就需要重新购买[破涕为笑]\"\n}\n],\n\"highlight\": \"AI小程序开发中的商业化模式讨论\",\n\"relatedTopic\": \"AI开发工具\"\n},\n{\n\"type\": \"DIALOGUE\",\n\"messages\": [\n{\n\"speaker\": \"苍何\",\n\"time\": \"2025-04-29 09:26:49\",\n\"content\": \"我熬不动\"\n},\n{\n\"speaker\": \"AHapi²⁰²⁵\",\n\"time\": \"2025-04-29 09:27:25\",\n\"content\": \"不要卷别人[旺柴]别人写了 就不卷他们了\"\n},\n{\n\"speaker\": \"苍何\",\n\"time\": \"2025-04-29 09:27:55\",\n\"content\": \"新闻得第一时间,做不到写了也没啥用\"\n},\n{\n\"speaker\": \"苍何\",\n\"time\": \"2025-04-29 09:28:03\",\n\"content\": \"还不如写些应用\"\n},\n{\n\"speaker\": \"大风(Wind)\",\n\"time\": \"2025-04-29 09:28:23\",\n\"content\": \"看看哪些是5-7点发推文的,基本都是卷王了\"\n},\n{\n\"speaker\": \"沉默王二\",\n\"time\": \"2025-04-29 09:28:44\",\n\"content\": \"身体能扛住确实离谱\"\n},\n{\n\"speaker\": \"苍何\",\n\"time\": \"2025-04-29 09:29:03\",\n\"content\": \"是啊,太肝了\"\n}\n],\n\"highlight\": \"关于工作强度和熬夜文化的讨论\",\n\"relatedTopic\": \"工作生活平衡\"\n}\n]\n},\n\"qa\": {\n\"items\": [\n{\n\"question\": {\n\"asker\": \"银色子弹-捷\",\n\"time\": \"2025-04-29 11:10:26\",\n\"content\": \"问一下win11电脑,你长时间没清理,运行慢,一般用什么来清理电脑? 不要360啊,那个太流氓了,想知道各位大佬有没有优秀的软件推荐一下\",\n\"tags\": [\"Windows优化\", \"系统清理\"]\n},\n\"answers\": [\n{\n\"responder\": \"昏沉沉的\",\n\"time\": \"2025-04-29 11:11:59\",\n\"content\": \"ccclean\",\n\"isAccepted\": false\n},\n{\n\"responder\": \"🤑程序儒\",\n\"time\": \"2025-04-29 11:13:07\",\n\"content\": \"360极速版、Wise Care 365\",\n\"isAccepted\": false\n},\n{\n\"responder\": \"AHapi²⁰²⁵\",\n\"time\": \"2025-04-29 11:13:38\",\n\"content\": \"仅2MB,Windows瞬间超级丝滑!这才是,真神器!\",\n\"isAccepted\": true\n}\n]\n},\n{\n\"question\": {\n\"asker\": \"ಠ_ಠ 闲鱼一条ಠ_ಠ\",\n\"time\": \"2025-04-29 11:37:49\",\n\"content\": \"请问哪位哥还有扣子的邀请码吗?\",\n\"tags\": [\"邀请码\", \"扣子空间\"]\n},\n\"answers\": [\n{\n\"responder\": \"贾👦🏻\",\n\"time\": \"2025-04-29 11:40:37\",\n\"content\": \"RootUser_2105656329 邀请你体验扣子空间,快来和 Agent 一起开始你的工作吧!https://www.coze.cn/space-preview?invite_code=SCL7DAL0\",\n\"isAccepted\": true\n},\n{\n\"responder\": \"9527\",\n\"time\": \"2025-04-29 11:47:43\",\n\"content\": \"RootUser_2106519373 邀请你体验扣子空间,快来和 Agent 一起开始你的工作吧!https://www.coze.cn/space-preview?invite_code=A8IT4MUE\",\n\"isAccepted\": false\n}\n]\n}\n]\n},\n\"analytics\": {\n\"heatmap\": [\n{\n\"topic\": \"AI技术\",\n\"percentage\": \"45%\",\n\"color\": \"#3da9fc\",\n\"count\": \"16\"\n},\n{\n\"topic\": \"工作讨论\",\n\"percentage\": \"25%\",\n\"color\": \"#4361ee\",\n\"count\": \"9\"\n},\n{\n\"topic\": \"工具推荐\",\n\"percentage\": \"15%\",\n\"color\": \"#00b4d8\",\n\"count\": \"5\"\n},\n{\n\"topic\": \"其他\",\n\"percentage\": \"15%\",\n\"color\": \"#7209b7\",\n\"count\": \"5\"\n}\n],\n\"chattyRanking\": [\n{\n\"rank\": 1,\n\"name\": \"苍何\",\n\"count\": \"7\",\n\"characteristics\": [\"技术分享\", \"新闻发布\"],\n\"commonWords\": [\"AI\", \"开源\", \"熬夜\"]\n},\n{\n\"rank\": 2,\n\"name\": \"AHapi²⁰²⁵\",\n\"count\": \"6\",\n\"characteristics\": [\"幽默评论\", \"资源分享\"],\n\"commonWords\": [\"旺柴\", \"加班\", \"神器\"]\n},\n{\n\"rank\": 3,\n\"name\": \"贾👦🏻\",\n\"count\": \"3\",\n\"characteristics\": [\"问题解答\", \"邀请码分享\"],\n\"commonWords\": [\"源码\", \"购买\", \"邀请\"]\n}\n],\n\"nightOwl\": {\n\"name\": \"苍何\",\n\"title\": \"熬夜冠军\",\n\"latestTime\": \"09:42:54\",\n\"messageCount\": \"7\",\n\"lastMessage\": \"我熬夜写了这一篇[旺柴]\"\n}\n},\n\"wordCloud\": {\n\"words\": [\n{\n\"text\": \"AI\",\n\"size\": 42,\n\"color\": \"#00b4d8\",\n\"rotation\": 0\n},\n{\n\"text\": \"熬夜\",\n\"size\": 36,\n\"color\": \"#4361ee\",\n\"rotation\": -15\n},\n{\n\"text\": \"开源\",\n\"size\": 32,\n\"color\": \"#00b4d8\",\n\"rotation\": 15\n},\n{\n\"text\": \"Qwen3\",\n\"size\": 28,\n\"color\": \"#3da9fc\",\n\"rotation\": -10\n},\n{\n\"text\": \"Vidu\",\n\"size\": 26,\n\"color\": \"#3da9fc\",\n\"rotation\": 10\n},\n{\n\"text\": \"清理\",\n\"size\": 24,\n\"color\": \"#7209b7\",\n\"rotation\": -5\n},\n{\n\"text\": \"邀请码\",\n\"size\": 22,\n\"color\": \"#7209b7\",\n\"rotation\": 5\n}\n],\n\"legend\": [\n{\"color\": \"#00b4d8\", \"label\": \"技术 相关词汇\"},\n{\"color\": \"#4361ee\", \"label\": \"生活 相关词汇\"},\n{\"color\": \"#7209b7\", \"label\": \"工具 相关词汇\"}\n]\n}\n},\n\"footer\": {\n\"dataSource\": \"群聊聊天记录\",\n\"generationTime\": \"2025-04-29 16:00:00\",\n\"statisticalPeriod\": \"2025-04-29 07:03:10 - 15:36:25\",\n\"disclaimer\": \"本报告内容基于群聊公开讨论,如有不当内容或侵权问题请联系管理员处理。\"\n}\n}\n```" with open('text.html', 'w', encoding='utf-8') as f: f.write(main(json_data)) \ No newline at end of file diff --git a/tests/build_exe.py b/tests/build_exe.py index 209fc42..74106db 100644 --- a/tests/build_exe.py +++ b/tests/build_exe.py @@ -153,7 +153,7 @@ if package_path: hidden_imports = f.read().splitlines() hidden_imports = [i.replace('-', '_').split("=")[0].split("~")[0] for i in hidden_imports if i and i not in ["setuptools", "wheel"]] # 去掉setuptools、wheel - hidden_imports += ["pywxdump", "pywxdump.db", "pywxdump.db.__init__.utils"] + hidden_imports += ["pywxdump", "pywxdump.db", "pywxdump.db.__init__.api_utils"] # 获取 ui 文件夹下的所有文件 用于打包 root_path = os.path.join(package_path, 'pywxdump') diff --git a/text.html b/text.html new file mode 100644 index 0000000..8490700 --- /dev/null +++ b/text.html @@ -0,0 +1,1078 @@ + + + + + + 群聊报告报告 - 2025-04-29 + + + +
    +

    群聊报告报告

    +

    2025-04-29

    +
    + 总消息数:35 + 活跃用户:12 + 时间范围:07:03:10 - 15:36:25 +
    +
    + + + + +
    +

    今日讨论热点

    +
    + + +
    +

    AI技术讨论

    +
    科技
    +

    群内围绕Qwen3开源、Vidu Q1体验、夸克AI相机等AI技术展开热烈讨论,涉及模型性能、应用场景和开发者体验。多位成员分享了相关技术文章和体验报告。

    +
    + Qwen3ViduAI相机 +
    +
    提及次数:15
    +
    + +
    +

    熬夜与工作压力

    +
    生活
    +

    成员们讨论熬夜工作现象,分享各自熬夜经历,对比互联网大厂与普通开发者的工作强度差异,引发关于工作生活平衡的思考。

    +
    + 熬夜加班工作强度 +
    +
    提及次数:8
    +
    + + +
    +
    + + +
    +

    实用教程与资源分享

    +
    + + +
    +
    TUTORIAL
    +

    体验完刚上线的Vidu Q1,后劲有点大(附AI视频创作教程)

    +
    + 分享者:苍何 + +
    +

    分享Vidu Q1 AI视频创作工具的体验和教程,介绍其清晰度和一致性的提升。

    +
    +

    要点:

    +
    • AI视频清晰度提升
    • 一致性改进
    +
    + +
    分类:AI工具
    +
    + +
    +
    TUTORIAL
    +

    阿里新出的夸克AI相机,强大到我有点陌生

    +
    + 分享者:苍何 + +
    +

    介绍夸克AI相机的新奇玩法和功能,展示其强大的AI图像处理能力。

    +
    +

    要点:

    +
    • 新奇玩法
    • 抽象功能
    +
    + +
    分类:AI应用
    +
    + +
    +
    RESOURCE
    +

    仅2MB,Windows瞬间超级丝滑!

    +
    + 分享者:AHapi²⁰²⁵ + +
    +

    分享一款轻量级Windows优化工具,声称能显著提升系统运行速度。

    +
    +

    要点:

    +
    • 2MB大小
    • 系统优化
    +
    + +
    分类:系统工具
    +
    + + +
    +
    + + +
    +

    重要消息汇总

    +
    + + +
    +
    + 2025-04-29 10:00:18 + 苍何 + NEWS + 优先级:高 +
    +

    2025年04月29日 AI科技早报:阿里开源8款Qwen3模型,腾讯开源Kuikly跨端框架,OpenAI推出ChatGPT购物功能等11条重要新闻。

    +
    +

    2025年04月29日 AI科技早报1、阿里开源8款Qwen3模型,集成MCP,性能超DeepSeek-R1、OpenAI o1。2、Qafind Labs发布ChatDLM扩散语言模型,推理速度高达2800 tokens/s。3、腾讯开源Kuikly跨端框架,基于Kotlin支持多平台开发,已应用于QQ。4、OpenAI 推出 ChatGPT 购物功能,用户可通过 ChatGPT 便捷购物。5、字节Seed团队提出PHD-Transformer,突破预训练长度扩展瓶颈。6、百度发布文心快码3.5版本与多模态AI智能体Zulu,助力工程师提效。7、Kimi与财新传媒合作,提供专业财经内容,推动AI+传统媒体融合。8、苹果加速「N50」智能眼镜项目,融合AI技术预计2027年亮相。9、研究显示OpenAI o3在病毒学领域超越94%人类专家,生物安全引关注。10、华为测试自研AI芯片Ascend 910D,旨在替代英伟达H100芯片。11、🔥【记得收藏】早报同步更新到开源 AI 知识库:https://u55dyuejxc.feishu.cn/wiki/FkmNwxYHDigJ3akIUGHc8MSTn4d

    +
    +
    + + +
    +
    + + +
    +

    有趣对话或金句

    +
    + + +
    +
    DIALOGUE
    +
    + +
    +
    + 好名字 + 2025-04-29 08:16:23 +
    +

    这个我弄完,ai做的小程序有bug,流程走不通,还改不了[捂脸]

    +
    +
    +
    + 贾👦🏻 + 2025-04-29 08:54:33 +
    +

    可以微调 不过源码需要买的

    +
    +
    +
    + 好名字 + 2025-04-29 09:13:32 +
    +

    微调一次,然后再想调就需要开会员了

    +
    +
    +
    + 贾👦🏻 + 2025-04-29 09:14:09 +
    +

    需求变更一个字 就需要重新购买[破涕为笑]

    +
    +
    +
    AI小程序开发中的商业化模式讨论
    +
    相关话题:AI开发工具
    +
    + +
    +
    DIALOGUE
    +
    + +
    +
    + 苍何 + 2025-04-29 09:26:49 +
    +

    我熬不动

    +
    +
    +
    + AHapi²⁰²⁵ + 2025-04-29 09:27:25 +
    +

    不要卷别人[旺柴]别人写了 就不卷他们了

    +
    +
    +
    + 苍何 + 2025-04-29 09:27:55 +
    +

    新闻得第一时间,做不到写了也没啥用

    +
    +
    +
    + 苍何 + 2025-04-29 09:28:03 +
    +

    还不如写些应用

    +
    +
    +
    + 大风(Wind) + 2025-04-29 09:28:23 +
    +

    看看哪些是5-7点发推文的,基本都是卷王了

    +
    +
    +
    + 沉默王二 + 2025-04-29 09:28:44 +
    +

    身体能扛住确实离谱

    +
    +
    +
    + 苍何 + 2025-04-29 09:29:03 +
    +

    是啊,太肝了

    +
    +
    +
    关于工作强度和熬夜文化的讨论
    +
    相关话题:工作生活平衡
    +
    + + +
    +
    + + +
    +

    问题与解答

    +
    + + +
    +
    +
    + 银色子弹-捷 + 2025-04-29 11:10:26 +
    +

    问一下win11电脑,你长时间没清理,运行慢,一般用什么来清理电脑? 不要360啊,那个太流氓了,想知道各位大佬有没有优秀的软件推荐一下

    +
    + Windows优化系统清理 +
    +
    +
    + +
    +
    + 昏沉沉的 + 2025-04-29 11:11:59 + +
    +

    ccclean

    +
    +
    +
    + 🤑程序儒 + 2025-04-29 11:13:07 + +
    +

    360极速版、Wise Care 365

    +
    +
    +
    + AHapi²⁰²⁵ + 2025-04-29 11:13:38 + 最佳回答 +
    +

    仅2MB,Windows瞬间超级丝滑!这才是,真神器!

    +
    +
    +
    + +
    +
    +
    + ಠ_ಠ 闲鱼一条ಠ_ಠ + 2025-04-29 11:37:49 +
    +

    请问哪位哥还有扣子的邀请码吗?

    +
    + 邀请码扣子空间 +
    +
    +
    + +
    +
    + 贾👦🏻 + 2025-04-29 11:40:37 + 最佳回答 +
    +

    RootUser_2105656329 邀请你体验扣子空间,快来和 Agent 一起开始你的工作吧!https://www.coze.cn/space-preview?invite_code=SCL7DAL0

    +
    +
    +
    + 9527 + 2025-04-29 11:47:43 + +
    +

    RootUser_2106519373 邀请你体验扣子空间,快来和 Agent 一起开始你的工作吧!https://www.coze.cn/space-preview?invite_code=A8IT4MUE

    +
    +
    +
    + + +
    +
    + + +
    +

    群内数据可视化

    + + +

    话题热度

    +
    + + + + +
    +
    AI技术
    +
    45%%
    +
    +
    +
    +
    16条消息
    +
    + +
    +
    工作讨论
    +
    25%%
    +
    +
    +
    +
    9条消息
    +
    + +
    +
    工具推荐
    +
    15%%
    +
    +
    +
    +
    5条消息
    +
    + +
    +
    其他
    +
    15%%
    +
    +
    +
    +
    5条消息
    +
    + + +
    + + + +
    +

    话唠榜

    +
    + +
    +
    1
    +
    +
    苍何
    +
    发言数:7
    +
    + 技术分享新闻发布 +
    +
    + AI开源熬夜 +
    +
    +
    + +
    +
    2
    +
    +
    AHapi²⁰²⁵
    +
    发言数:6
    +
    + 幽默评论资源分享 +
    +
    + 旺柴加班神器 +
    +
    +
    + +
    +
    3
    +
    +
    贾👦🏻
    +
    发言数:3
    +
    + 问题解答邀请码分享 +
    +
    + 源码购买邀请 +
    +
    +
    + +
    +
    + + + +

    熬夜冠军

    +
    + + + +
    +
    👑
    +
    +
    苍何
    +
    熬夜冠军
    +
    最晚活跃时间:09:42:54
    +
    深夜消息数:7
    +
    我熬夜写了这一篇[旺柴]
    +
    注:熬夜时段定义为23:00-06:00,已考虑不同时区
    +
    + + +
    +
    + + +
    +

    热门词云

    +
    + +
    + + + + AI + + 熬夜 + + 开源 + + Qwen3 + + Vidu + + 清理 + + 邀请码 + + +
    + +
    + +
    + + 技术 相关词汇 +
    + +
    + + 生活 相关词汇 +
    + +
    + + 工具 相关词汇 +
    + + +
    +
    +
    + + +
    +

    数据来源:群聊聊天记录聊天记录

    +

    生成时间:2025-04-29 16:00:00

    +

    统计周期:2025-04-29 [时间范围]

    +

    免责声明:本报告内容基于群聊公开讨论,如有不当内容或侵权问题请联系管理员处理。

    +
    + + + + + \ No newline at end of file