From aec0a250989f905a730b9f509c023a77f4c435f7 Mon Sep 17 00:00:00 2001 From: Zylan Date: Tue, 1 Apr 2025 08:26:43 +0800 Subject: [PATCH] rdm --- README.md | 312 ++++++++++++++++++++++++++--------------- README_EN.md | 151 -------------------- server/instance/app.db | Bin 0 -> 16384 bytes 3 files changed, 201 insertions(+), 262 deletions(-) delete mode 100644 README_EN.md create mode 100644 server/instance/app.db diff --git a/README.md b/README.md index cf7e9b9..c6433db 100644 --- a/README.md +++ b/README.md @@ -1,151 +1,241 @@ -[English](README_EN.md) | 中文 +

Snap-Solver 版本

-# 📚 Snap-Solver - AI笔试测评工具 -> 🔍 一键识别,自动解答 +

+ 🔍 一键截屏,自动解题 - 线上考试,从未如此简单 +

-## ✨ 项目简介 +

+ Python + Flask + AI + License +

-Snap-Solver 是一个强大的AI笔试测评工具,只需**按下快捷键**,即可自动截取您电脑屏幕上的题目,通过 AI 进行识别并给出详细解答。无论是数学题、物理题、化学题、编程问题还是其他学术问题,Snap-Solver 都能为您提供专业的解答。 -Snap-Solver 截图 +

+ 核心特性 • + 快速开始 • + 使用指南 • + 技术架构 • + 高级配置 • + 常见问题 • + 获取帮助 +

-### 📞 代部署支持 +

+ Snap-Solver 截图 +

-如果您不擅长编程,需要该软件的**代部署服务**,可发送邮件至:[zylanjian@outlook.com](mailto:zylanjian@outlook.com) +## 💫 项目简介 -## 🌟 核心功能 +**Snap-Solver** 是一个革命性的AI笔试测评工具,专为学生、考生和自学者设计。只需**按下快捷键**,即可自动截取屏幕上的任何题目,通过AI进行分析并提供详细解答。 -- 🖼️ **一键截图**:在手机上使用**截屏**按钮,即可远程监控电脑屏幕 -- 🌐 **局域网共享**:一处部署,多处使用,同一网络下**所有设备**均可监控电脑 -- 🔍 **OCR 文字识别**:支持 Mathpix API 识别数学公式和图片中的文字 -- 🧠 **多模型支持**:同时支持 GPT、o3、Claude 和 DeepSeek 等多种 AI 模型 -- 🔐 **VPN 代理支持**:可自定义 VPN 代理,支持国内用户通过代理访问 -- 💻 **全平台支持**:Windows、MacOS(暂未调试)、Linux 系统可用,手机端可通过浏览器访问 +无论是复杂的数学公式、物理难题、编程问题,还是其他学科的挑战,Snap-Solver都能提供清晰、准确、有条理的解决方案,帮助您更好地理解和掌握知识点。 -## 🛠️ 技术架构 +
+ + + + +
+ 📞 代部署支持
+ 如果您不擅长编程,需要专业的代部署服务
+ 请联系:zylanjian@outlook.com +
+
-- **后端**:Flask + SocketIO,提供 Web 服务和 WebSocket 实时通信 -- **前端**:HTML + CSS + JavaScript,提供直观的用户界面 -- **AI 接口**: +## ✨ 核心特性 - OpenAI: - - GPT-4o - - o3-mini - - Anthropic: - - Claude-3.7-Sonnet - - DeepSeek: - - DeepSeek-r1 - - DeepSeek-v3 - - Mathpix: - - Mathpix OCR - -## 📋 使用前准备 - -1. **API Keys**: - - [OpenAI API Key](https://openai.com)(可选) - - [Anthropic API Key](https://anthropic.com)(可选,推荐✅) - - [DeepSeek API Key](https://deepseek.com)(可选,不推荐❌) - - [Mathpix API Key](https://mathpix.com)(推荐✅) - -2. **运行环境**: - - [Python](https://www.python.org/downloads/) 3.x 版本 - - 必要的 Python 依赖包 + + + + + + + + + + + + + +
+

📱 跨设备协同

+
    +
  • 一键截图:按下快捷键,即可在移动设备上查看和分析电脑屏幕
  • +
  • 局域网共享:一处部署,多设备访问,提升学习效率
  • +
+
+

🧠 多模型AI支持

+
    +
  • GPT-4o/o3-mini:OpenAI强大的推理能力
  • +
  • Claude-3.7:Anthropic的高级理解与解释
  • +
  • DeepSeek-v3/r1:专为中文场景优化的模型
  • +
+
+

🔍 精准识别

+
    +
  • OCR文字识别:准确捕捉图片中的文本
  • +
  • 数学公式支持:通过Mathpix精确识别复杂数学符号
  • +
+
+

🌐 全球无障碍

+
    +
  • VPN代理支持:自定义代理设置,解决网络访问限制
  • +
  • 多语言响应:支持定制AI回复语言
  • +
+
+

💻 全平台兼容

+
    +
  • 桌面支持:Windows、MacOS、Linux
  • +
  • 移动访问:手机、平板通过浏览器直接使用
  • +
+
+

⚙️ 高度可定制

+
    +
  • 思考深度控制:调整AI的分析深度
  • +
  • 自定义提示词:针对特定学科优化提示
  • +
+
## 🚀 快速开始 -1. **启动应用**: - ```bash - python app.py - ``` +### 📋 前置要求 -2. **访问服务**: - - 💻 本机访问: - 打开浏览器,访问 http://localhost:5000 - - 📱 移动设备访问: - 使用同一局域网内的手机、平板等设备访问 `http://[服务器IP]:5000` +- Python 3.x +- 至少以下一个API Key(详见[获取API密钥指南](#-获取api密钥)): + - OpenAI API Key + - Anthropic API Key (推荐✅) + - DeepSeek API Key + - Mathpix API Key (推荐OCR识别✅) -## 💡 使用指南 +### 📥 开始使用 -### 1. 首次配置 +```bash +# 启动应用 +python app.py +``` -首次使用时,点击右上角的⚙️设置图标,配置: -- AI 模型 API 密钥(至少需要一个) -- OCR 识别设置(可选;为节约token成本,强烈推荐) -- 代理设置(如需) -- 系统提示词(可自定义) +### 📱 访问方式 -### 2. 截图解题 +- **本机访问**:打开浏览器,访问 http://localhost:5000 +- **局域网设备访问**:在同一网络的任何设备上访问 `http://[电脑IP]:5000` -1. 按下手机或平板上的 `截屏` 按钮键 -2. 在手机或平板上,会自动显示您的电脑屏幕截图 -3. 在移动设备上裁剪您想解答的题目区域 -4. 选择"发送图片至 AI"(直接分析图片)或"提取图中文本"(先识别文字再分析) -5. 等待系统处理并查看详细解答 +## 📖 使用指南 -### 3. 文本解题 + + + + + + +
+

1️⃣ 首次配置

+

点击右上角⚙️设置图标,配置API密钥和首选项

+
+

2️⃣ 截图解题

+

点击"截图"按钮 → 裁剪题目区域 → 选择分析方式

+
+

3️⃣ 查看解答

+

实时查看AI分析过程和详细解答,包含思考路径

+
-如果已有题目文本,或者想要修改识别出的文字: -1. 使用"提取图中文本"功能 -2. 编辑文本框中的内容 -3. 点击"发送文本至 AI"获取解答 +### 🎯 使用场景示例 + +- **课后习题**:截取教材或作业中的难题,获取步骤详解 +- **编程调试**:截取代码错误信息,获取修复建议 +- **考试复习**:分析错题并理解解题思路 +- **文献研究**:截取复杂论文段落,获取简化解释 + +## 🔧 技术架构 + +```mermaid +graph TD + A[用户界面] --> B[Flask Web服务] + B --> C{API路由} + C --> D[截图服务] + C --> E[OCR识别] + C --> F[AI分析] + E --> |Mathpix API| G[文本提取] + F --> |模型选择| H1[OpenAI] + F --> |模型选择| H2[Anthropic] + F --> |模型选择| H3[DeepSeek] + D --> I[Socket.IO实时通信] + I --> A +``` + +### 🧩 组件详情 + +- **前端**:响应式HTML/CSS/JS界面,支持移动设备 +- **后端**:Flask + SocketIO,提供RESTful API和WebSocket +- **AI接口**:多模型支持,统一接口标准 +- **图像处理**:高效的截图和裁剪功能 ## ⚙️ 高级配置 -您可以在设置面板中自定义多项参数: +### 模型选择与优化 -- **AI 模型**:选择不同的 AI 模型(GPT-4o、o3-mini、Claude-3.7、DeepSeek-r1 等) -- **语言**:设置 AI 回答的首选语言 -- **温度**:调整 AI 回答的随机性(较低值更精确,较高值更创意) -- **思考深度**: Claude专属参数,可调整思维模式 -- **系统提示词**:自定义 AI 的基础行为指令 -- **代理设置**:配置 HTTP 代理,便于国内用户访问 +| 模型 | 优势 | 适用场景 | +|------|------|----------| +| **GPT-4o** | 综合能力强,多模态支持 | 复杂学科问题,图像理解 | +| **o3-mini** | 速度快,成本低 | 简单问题,快速反馈 | +| **Claude-3.7** | 详细思考过程,推理透明 | 数学证明,深度分析 | +| **DeepSeek** | 中文优化,低延迟 | 中文习题,语文分析 | -## 📞 获取帮助 +### 🛠️ 可调参数 -- 如有 bug 问题:请在本仓库提交 Issue -- 如需**部署帮助**,可联系:[zylanjian@outlook.com](mailto:zylanjian@outlook.com) +- **温度**:调整回答的创造性与确定性(0.1-1.0) +- **最大输出Token**:控制回答长度 +- **推理深度**:标准模式(快速)或深度思考(详细) +- **思考预算占比**:平衡思考过程与最终答案的详细程度 +- **系统提示词**:自定义AI的基础行为与专业领域 -## 🔧 常见问题 +## ❓ 常见问题 -### 1. 截图功能无响应? -- 确保以管理员权限运行应用 -- 检查是否授予了屏幕录制权限 -- 确认 Python 进程正在运行 +
+如何获得最佳识别效果? +

+确保截图清晰,包含完整题目和必要上下文。对于数学公式,建议使用Mathpix OCR以获得更准确的识别结果。 +

+
-### 2. 无法连接服务? -- 检查防火墙设置 -- 确认移动设备与电脑在同一局域网 -- 验证服务器 IP 地址是否正确 +
+无法连接到服务怎么办? +

+1. 检查防火墙设置是否允许5000端口
+2. 确认设备在同一局域网内
+3. 尝试重启应用程序
+4. 查看控制台日志获取错误信息 +

+
-### 3. API 调用失败? -- 检查 API Key 是否正确设置 -- 确认网络连接是否正常 -- 如使用代理,检查代理设置是否正确 +
+API调用失败的原因? +

+1. API密钥可能无效或余额不足
+2. 网络连接问题,特别是国际API
+3. 代理设置不正确
+4. API服务可能临时不可用 +

+
-## 🔐 安全提示 +
+如何优化AI回答质量? +

+1. 调整系统提示词,添加特定学科的指导
+2. 根据问题复杂度选择合适的模型
+3. 对于复杂题目,使用"深度思考"模式
+4. 确保截取的题目包含完整信息 +

+
-- 您的 API 密钥存储在本地,不会上传到任何服务器 -- 建议只在可信任的局域网中使用本服务 -- 定期更新系统和依赖包以保障安全 +## 🤝 获取帮助 -## 🤝 参与贡献 - -欢迎提交 Issue 和 Pull Request! - -1. Fork 本仓库 -2. 创建功能分支 (`git checkout -b feature/AmazingFeature`) -3. 提交更改 (`git commit -m 'Add some AmazingFeature'`) -4. 推送到分支 (`git push origin feature/AmazingFeature`) -5. 提交 Pull Request +- **代部署服务**:如果您不擅长编程,需要代部署服务,请联系 [zylanjian@outlook.com](mailto:zylanjian@outlook.com) +- **问题报告**:在GitHub仓库提交Issue +- **功能建议**:欢迎通过Issue或邮件提供改进建议 ## 📜 开源协议 本项目采用 [Apache 2.0](LICENSE) 协议。 - ---- - -⭐ 如果这个项目对您有帮助,请给个 Star!感谢支持! diff --git a/README_EN.md b/README_EN.md deleted file mode 100644 index 5e12532..0000000 --- a/README_EN.md +++ /dev/null @@ -1,151 +0,0 @@ -English | [中文](README.md) - -# 📚 Snap-Solver - AI Exam Assistance Tool - -> 🔍 One-click recognition, automatic solving - -## ✨ Project Introduction - -Snap-Solver is a powerful AI exam assistance tool that can automatically capture questions on your computer screen with just a **press of a hotkey**, recognize them through AI, and provide detailed solutions. Whether it's mathematics, physics, chemistry, programming problems, or other academic questions, Snap-Solver can provide professional answers. - -> For **deployment services**, please contact: [zylanjian@outlook.com](mailto:zylanjian@outlook.com) - -Snap-Solver screenshot - -## 🌟 Core Features - -- 🖼️ **One-click Screenshot**: Use a hotkey (Alt+Ctrl+S, customizable) to remotely monitor your computer screen -- 🌐 **LAN Sharing**: Deploy once, use everywhere — all devices on the same network can access -- 🔍 **OCR Text Recognition**: Support for Mathpix API to recognize mathematical formulas and text in images -- 🧠 **Multiple Model Support**: Simultaneous support for GPT-4o, Claude-3.7, DeepSeek, and other AI models -- 🔐 **VPN Proxy Support**: Customizable VPN proxy, supports users in regions with limited access to AI models -- 🌓 **Theme Switching**: Light and dark theme support to protect your eyes -- 💻 **Cross-Platform Support**: Works on Windows, MacOS, Linux, with mobile access through browsers - -## 🛠️ Technical Architecture - -- **Backend**: Flask + SocketIO, providing Web services and WebSocket real-time communication -- **Frontend**: HTML + CSS + JavaScript, providing an intuitive user interface -- **AI Interfaces**: - - GPT-4o: OpenAI's image and text understanding model (without reasoning) - - Claude-3.7: Anthropic's advanced thinking model (includes reasoning by default) - - DeepSeek: Alternative model support - - Mathpix: Professional mathematical formula and text recognition service - -## 📋 Prerequisites - -1. **API Keys**: - - [OpenAI API Key](https://openai.com) (for GPT-4o) - - [Anthropic API Key](https://anthropic.com) (for Claude-3.7, optional) - - [Mathpix API Key](https://mathpix.com) (for OCR text recognition, optional) - -2. **Running Environment**: - - [Python](https://www.python.org/downloads/) 3.x version - - Required Python dependencies - -## 🚀 Quick Start - -1. **Clone the project**: - ```bash - git clone https://github.com/zippland/Snap-Solver.git - ``` - -2. **Activate virtual environment**: - ```bash - .venv/Scripts/activate - ``` - -3. **Install dependencies**: - ```bash - pip install -r requirements.txt - ``` - -4. **Start the application**: - ```bash - python app.py - ``` - -5. **Access the service**: - - Local access: Open browser, visit http://localhost:5000 - - Mobile device access: Use phones/tablets on the same LAN to visit http://[server-IP]:5000 - -## 💡 Usage Guide - -### 1. First-time Setup - -When using for the first time, click the ⚙️ settings icon in the top right corner to configure: -- AI model API keys (at least one required) -- OCR recognition settings (optional) -- Proxy settings (if needed) -- System prompt (customizable) - -### 2. Screenshot-based Problem Solving - -1. Press the `Screenshot` button on your phone or tablet -2. Your computer screen will automatically display on your mobile device -3. Crop the problem area you want to solve on your mobile device -4. Choose "Send image to AI" (direct image analysis) or "Extract text from image" (OCR then analysis) -5. Wait for the system to process and view the detailed solution - -### 3. Text-based Problem Solving - -If you already have the problem text, or want to modify the recognized text: -1. Use the "Extract text from image" feature -2. Edit the content in the text box -3. Click "Send text to AI" to get the solution - -## ⚙️ Advanced Configuration - -You can customize multiple parameters in the settings panel: - -- **AI Model**: Choose different AI models (GPT-4o, Claude-3.7, DeepSeek, etc.) -- **Language**: Set the preferred language for AI responses -- **Temperature**: Adjust the randomness of AI responses (lower values are more precise, higher values more creative) -- **System Prompt**: Customize basic instructional prompts for the AI -- **Proxy Settings**: Configure HTTP proxy for users in regions with limited access - -## 📞 Get Help - -- For bug issues: Please submit an Issue in this repository -- For **deployment help**, contact: [zylanjian@outlook.com](mailto:zylanjian@outlook.com) - -## 🔧 Common Issues - -### 1. Screenshot function not responding? -- Ensure the application is run with administrator privileges -- Check if screen recording permissions have been granted -- Confirm that the Python process is running - -### 2. Cannot connect to the service? -- Check firewall settings -- Confirm mobile devices are on the same network as the computer -- Verify the server IP address is correct - -### 3. API call failed? -- Check if API Keys are correctly set -- Confirm network connection is normal -- If using a proxy, check if proxy settings are correct - -## 🔐 Security Tips - -- Your API keys are stored locally and not uploaded to any server -- Only use this service on trusted local networks -- Regularly update the system and dependencies to ensure security - -## 🤝 Contribution - -Welcome to submit Issues and Pull Requests! - -1. Fork this repository -2. Create a feature branch (`git checkout -b feature/AmazingFeature`) -3. Commit your changes (`git commit -m 'Add some AmazingFeature'`) -4. Push to the branch (`git push origin feature/AmazingFeature`) -5. Submit a Pull Request - -## 📜 License - -This project is licensed under the [Apache](LICENSE) license. - ---- - -⭐ If this project helps you, please give it a Star! Thanks for your support! \ No newline at end of file diff --git a/server/instance/app.db b/server/instance/app.db new file mode 100644 index 0000000000000000000000000000000000000000..2ae6bb8b97bc7232b1004075c3e9e144260cb273 GIT binary patch literal 16384 zcmeI&&u-f`7yxidE*i&Js$Bw~3J7h6#lY&46e&{PVRJJzGwM2v;uOm+1}RdF*Z9wD zCChG0ivk1o4#Q4+f&shi9r^$RcI!~|1-9cTZz+7m>a=)CQ?uJd6KIF7Sq>m^%Hi)VMv9=oR-3ue*;n3#krFF_YuD%!=V;d}jC3Mw+zy zNziZK>L$UpGdBh(Hbe$m7DEmH1J9pdZUT`Pb3)Y8v(RO<) zO*)&svTgnEi8O*Vxt*j*ZzI_W%C<#tt#LATm+Gsl?xPPD1Z7WIy>m(b75~~?$8uy| z%uS%iIgF{C&%d0^^k84k_g_R27M%}M@<5I=a|%;tH=GZo9u3FAt*xzY((aXQ+04ko z=z(30pGA5V#BQ&%y_*CJgmQ+BTH{^sa{c{P*BOqrIi7!UVAu8od00#q$AdD{0WN>5jgzGGir4dAFm60rGL@**XQ!=(`AkHz5VjN4&WgIFR z>WDEVOc+rrxy=R}jtpT2(U^rwVQ%xX(JE9ZicpS?ZDm+d7NbZ=6;+Bn}KmGdWo8AQj><0;qG;K7(^xOdV;sG>n5>$RGaCX3-cHvUO literal 0 HcmV?d00001