Go to file
2026-01-08 21:48:24 +08:00
__pycache__ Initial commit with all project files 2026-01-08 21:48:24 +08:00
agents Initial commit with all project files 2026-01-08 21:48:24 +08:00
code_explanation_fixer.egg-info Initial commit with all project files 2026-01-08 21:48:24 +08:00
models Initial commit with all project files 2026-01-08 21:48:24 +08:00
services Initial commit with all project files 2026-01-08 21:48:24 +08:00
static Initial commit with all project files 2026-01-08 21:48:24 +08:00
utils Initial commit with all project files 2026-01-08 21:48:24 +08:00
.env Initial commit with all project files 2026-01-08 21:48:24 +08:00
app.py Initial commit with all project files 2026-01-08 21:48:24 +08:00
config.py Initial commit with all project files 2026-01-08 21:48:24 +08:00
gui_app.py Initial commit with all project files 2026-01-08 21:48:24 +08:00
pyproject.toml Initial commit with all project files 2026-01-08 21:48:24 +08:00
README.md Initial commit with all project files 2026-01-08 21:48:24 +08:00
streamlit_app.py Initial commit with all project files 2026-01-08 21:48:24 +08:00
test_code_with_bugs.py Initial commit with all project files 2026-01-08 21:48:24 +08:00

代码解释与修复助手 - AI编程学习工具

一个智能代码解释与修复工具,帮助编程学习者理解代码并提供修复建议。

功能特点

  • 代码解释: 对代码进行逐行或分段的详细解释
  • Bug修复: 识别代码问题并提供修复建议
  • 多语言支持: 支持 Python、JavaScript、Java、C++、Go、Rust 等多种编程语言
  • 图形界面: 简洁美观的界面参考豆包AI问答方式

快速开始

安装依赖

# 安装核心依赖
pip install -r requirements.txt

# 安装图形界面依赖
pip install -r requirements_gui.txt

运行应用

图形界面版本(推荐)

python gui_app.py

Web API 版本

python app.py

访问 http://localhost:8000 查看 API 文档

图形界面使用说明

  1. 启动 gui_app.py 后,会弹出一个窗口
  2. 在代码输入框中粘贴或输入您的代码
  3. 选择任务类型:
    • 📖 代码解释:获取代码的详细解释
    • 🔧 代码修复:分析并修复代码问题
  4. 选择编程语言(可选择 auto 自动检测)
  5. EnterCtrl+Enter 发送请求
  6. 等待 AI 分析,结果会显示在下方

配置说明

在项目根目录创建 .env 文件:

# 硅基流动 API Key必需
SILICONFLOW_API_KEY=your_api_key_here

# 可选配置
SILICONFLOW_MODEL=deepseek-ai/DeepSeek-V2.5

获取 API Key访问 https://cloud.siliconflow.cn 注册账号

项目结构

code-explainer-fixer/
├── gui_app.py              # 图形界面版本(推荐使用)
├── app.py                  # Web API 版本
├── config.py               # 配置文件
├── requirements.txt        # 核心依赖
├── requirements_gui.txt    # GUI 依赖
├── .env                    # API 配置(需手动创建)
├── agents/                 # 智能体模块
├── services/               # 服务层
├── models/                 # 数据模型
└── utils/                  # 工具函数

技术栈

  • 图形界面: CustomTkinter现代化Tkinter
  • AI 服务: 硅基流动OpenAI 兼容 API
  • Web 框架: FastAPI + Uvicorn