MCPcopy Index your code
hub / github.com/bingryan/WeChatAI

github.com/bingryan/WeChatAI @WeChatAI-v1.0.10

Chat with this repo
repository ↗ · DeepWiki ↗ · release WeChatAI-v1.0.10 ↗ · + Follow
248 symbols 453 edges 76 files 30 documented · 12% updated 2y agoWeChatAI-v1.0.10 · 2023-11-23★ 993 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

image

WeChatAI

打造一个All in One的个人AI聊天助手

macOS Windows Linux

中文介绍 | <a href="https://github.com/bingryan/WeChatAI/raw/WeChatAI-v1.0.10/README.md">English</a>

本项目不为打赏与获利, 仅供参考与学习,只用于个人用户.

https://user-images.githubusercontent.com/41174435/235090423-62082481-1565-4ef6-889e-79f3dceebdba.mp4

https://user-images.githubusercontent.com/41174435/237418023-d62da302-1ffe-4efd-ae25-63f036edc078.mp4

prompt模版中的参数首字母为命令参数:(template: {{{format}}}->command: -f)

Screenshot

Supported Service

For User

Install

请访问Windows, Mac(M1, intel), Linux下载对应的版本

Mac 用户

出现以下问题的解决方案:

image

第一步: 打开系统偏好设置 -> 安全性与隐私 -> 通用 -> 允许任何来源 实在不行执行下面代码:

sudo spctl --master-disable

第二步: xattr -cr /Applications/xxx.app

终端先输入: xattr -cr , 然后把应用拖拽到终端

Features and Setting

左侧设置拦作为全局的设置, 包含了语言,自定义头像,主题设置, 用户聊天背景,助手聊天背景, 用户markdown和raw, 助手markdown和raw,全局Chatgpt配置,

  • [x] 语言设置: 中文和英文
  • [x] 主题设置: 包含了浅色和深色两种主题
  • [x] 自定义头像: 任何图片格式(包括 gif)
  • [x] 用户聊天背景: 自定义聊天背景颜色
  • [x] 助手聊天背景: 自定义聊天背景颜色
  • [x] 用户内容格式: 支持 markdown 和 raw(默认), chatgpt 支持 markdown 形式提问
  • [x] 助手内容格式: 支持 markdown(默认)和 raw, 推荐使用 markdown, 便于阅读
  • [x] 全局 Chatgpt 配置: 新建聊天界面都会从全局配置读取作为默认配置 -> 生成自己 Open AI Key
  • [x] contextSize: 上下文聊天信息, 默认为 2, 既上下文聊天信息的 2 条都作为 chatgpt 的输出依据
  • [x] 系统层设置
  • [x] 快捷键: CommandOrControl+Shift+K
  • [x] 开机自启动: 默认不启动, 需要手动开启
  • [x] 页面操作
  • [x] 拖动头像可以调整位置
  • [x] 点击头像可以编辑和删除
  • [x] 点击"+"可以新建聊天窗口,默认配置信息会从全局配置读取
  • [ ] 集成模型
  • [x] chatgpt
  • [ ] ...
  • [x] 导入聊天记录
  • [ ] 历史聊天内容导出和检索
  • [ ] 图片处理
  • [ ] 文件处理(比如论文总结, 书籍总结)
  • [ ] more...

For Developers

Development

# install dependencies
pnpm install

# web
pnpm dev

# desktop
pnpm tauri dev

Build(Production)

pnpm install
pnpm build
pnpm tauri build

对于任何形式的 PR 都是欢迎的(文档, UI, 代码)

Q: 1. 为什么 server 层还有一个没用上的 chatgpt 的后端服务

A: 1. 编码之初是希望在 server 层统一接口请求,避免跨域问题, 调试测试逻辑已经完成,但是某些区域需要科学上网才可以访问 OpenAI 的 API,而且 tauri proxy 没有成熟的proxy settings, 没有想到好的方案把 proxy 给 spawn 出来的 server,所以暂时还是在前端直接请求了. 代码暂时不移除,希望给他人对用 rust 实现,提供一个参考.

Q: 2. server 除了现在的静态资源的上传和展示之外,还希望做什么?

A: 2. 有了 server,在处理上就更加具有灵活性, 希望集成在本地 AI Model 和服务,作为个人工具提供更多多样性和可能性

Q: 3. 输入框上面还有很多无效的点击图标, 为什么不去掉?

A: 3. 这些图标后面功能会慢慢加入功能, 比如图片处理, 文件处理(比如论文总结,书籍总结), 以及历史聊天内容导出和检索等等

Technology Stack and Credits

Extension points exported contracts — how you extend this code

KVStorage (Interface)
KVStorage trait [1 implementers]
src-tauri/src/storage/mod.rs
GlobalComponents (Interface)
(no doc)
components.d.ts
PromptTemplate (Interface)
(no doc)
src/types/app.d.ts
ScrollReturn (Interface)
(no doc)
src/views/chat/hooks/useScroll.ts
StreamingFormat (Interface)
(no doc)
src-tauri/src/server/extractor.rs
Prompt (Interface)
(no doc)
src/types/app.d.ts
Content (Interface)
(no doc)
src/types/app.d.ts
chatgptInfo (Interface)
(no doc)
src/types/app.d.ts

Core symbols most depended-on inside this repo

send_message
called by 20
crates/chatgpt_rs/src/client.rs
as_ref
called by 14
crates/chatgpt_rs/src/config.rs
setState
called by 9
src/hooks/useLocalStorage.ts
map_err
called by 7
src-tauri/src/error.rs
json
called by 6
src-tauri/src/server/extractor.rs
new_conversation
called by 6
crates/chatgpt_rs/src/client.rs
send_message_streaming
called by 5
crates/chatgpt_rs/src/client.rs
add
called by 4
src-tauri/src/storage/mod.rs

Shape

Function 116
Method 83
Class 30
Interface 11
Enum 8

Languages

Rust62%
TypeScript38%

Modules by API surface

src/store/chat.ts17 symbols
src-tauri/src/config/app.rs15 symbols
src-tauri/src/server/helper/chatgpt.rs14 symbols
crates/chatgpt_rs/src/types.rs14 symbols
src/utils/is/index.ts13 symbols
src-tauri/src/server/extractor.rs13 symbols
src-tauri/src/error.rs11 symbols
crates/chatgpt_rs/src/client.rs11 symbols
src-tauri/src/storage/mod.rs10 symbols
src-tauri/src/core/handle.rs10 symbols
crates/chatgpt_rs/src/converse.rs8 symbols
crates/chatgpt_rs/src/chatgpt.rs8 symbols

For agents

$ claude mcp add WeChatAI \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page