docs: 添加项目 README 文档#77
docs: 添加项目 README 文档#77WhiteElephantIsNotARobot wants to merge 2 commits intoWhiteElephant-abc:mainfrom
Conversation
创建了完整的 README.md 文件,包含: - 项目概述和核心功能 - 架构概览图 - 项目结构说明 - 核心组件详解(智能截断算法、双 Token 架构、上下文模型) - 环境变量配置说明 - GitHub Actions 工作流介绍 - API 端点文档 - 特性列表和使用方式 Co-Authored-By: Claude (mimo-v2-flash) <[email protected]>
Summary of ChangesHello @WhiteElephantIsNotARobot, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 本次拉取请求旨在通过添加一个全面且详细的 Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
README.md
Outdated
| class TaskContext(BaseModel): | ||
| # 基础信息 | ||
| repo: str # 仓库名 (owner/repo) | ||
| event_type: str # 事件类型 (pr/issue/discussion) | ||
| event_id: str # 通知 ID | ||
|
|
||
| # 内容 | ||
| pr_title/pr_body: str # PR 标题和正文 | ||
| issue_body: str # Issue 正文 | ||
| discussion_title/discussion_body: str | ||
|
|
||
| # 历史记录 | ||
| comments_history: List[Dict] # 普通评论 | ||
| reviews_history: List[Dict] # 审核记录 | ||
| review_comments_batch: List[Dict] # 行内代码评论 | ||
|
|
||
| # 代码上下文 | ||
| diff_content: str # PR diff | ||
| clone_url: str # SSH 克隆地址 | ||
| head_ref/base_ref: str # 分支信息 | ||
| head_repo/base_repo: str # repo:branch 格式 |
There was a problem hiding this comment.
TaskContext 数据模型的示例代码中包含一些无效的 Python 语法(例如 pr_title/pr_body: str),这可能会误导开发者。建议将这些合并的属性拆分为独立的、符合语法的行,以提高文档的准确性和可读性。
class TaskContext(BaseModel):
# 基础信息
repo: str # 仓库名 (owner/repo)
event_type: str # 事件类型 (pr/issue/discussion)
event_id: str # 通知 ID
# 内容
pr_title: str # PR 标题
pr_body: str # PR 正文
issue_body: str # Issue 正文
discussion_title: str # Discussion 标题
discussion_body: str # Discussion 正文
# 历史记录
comments_history: List[Dict] # 普通评论
reviews_history: List[Dict] # 审核记录
review_comments_batch: List[Dict] # 行内代码评论
# 代码上下文
diff_content: str # PR diff
clone_url: str # SSH 克隆地址
head_ref: str # head 分支
base_ref: str # base 分支
head_repo: str # head repo:branch 格式
base_repo: str # base repo:branch 格式
README.md
Outdated
|
|
||
| ## 许可证 | ||
|
|
||
| 本项目采用 [AGPL-3.0 许可证](LICENSE)。 |
|
@WhiteElephantIsNotARobot 解决review |
1. Fix TaskContext example code syntax - Split merged property declarations (pr_title/pr_body, etc.) into separate lines - Each field now has its own type declaration with proper comment 2. Fix license inconsistency - Update README to correctly reference GPL-3.0 (not AGPL-3.0) - Align with LICENSE file content Co-Authored-By: Claude (mimo-v2-flash) <[email protected]>
|
已根据 review 意见完成修复: 修复内容1. TaskContext 示例代码语法问题 ✅
2. 许可证不一致问题 ✅
修改详情
|
|
/gemini review |
| class TaskContext(BaseModel): | ||
| # 基础信息 | ||
| repo: str # 仓库名 (owner/repo) | ||
| event_type: str # 事件类型 (pr/issue/discussion) | ||
| event_id: str # 通知 ID | ||
|
|
||
| # 内容 | ||
| pr_title: str # PR 标题 | ||
| pr_body: str # PR 正文 | ||
| issue_body: str # Issue 正文 | ||
| discussion_title: str # Discussion 标题 | ||
| discussion_body: str # Discussion 正文 | ||
|
|
||
| # 历史记录 | ||
| comments_history: List[Dict] # 普通评论 | ||
| reviews_history: List[Dict] # 审核记录 | ||
| review_comments_batch: List[Dict] # 行内代码评论 | ||
|
|
||
| # 代码上下文 | ||
| diff_content: str # PR diff | ||
| clone_url: str # SSH 克隆地址 | ||
| head_ref: str # head 分支 | ||
| base_ref: str # base 分支 | ||
| head_repo: str # head repo:branch 格式 | ||
| base_repo: str # base repo:branch 格式 |
There was a problem hiding this comment.
文档中提供的 TaskContext 数据模型与 server.py 中的实际定义不一致。当前的定义缺少了许多重要字段(如 title, trigger_user, issue_number 等),并且没有正确反映字段的可选性(Optional)。这可能会误导开发者。建议将此处的模型定义更新为与 server.py 中完全一致,以确保文档的准确性。更新后的模型会使用 pydantic.BaseModel 以及 typing 中的 Optional, List, Dict。
class TaskContext(BaseModel):
# 基础信息
repo: str # 仓库名 (owner/repo)
event_type: str # 事件类型 (pr/issue/discussion)
event_id: str # 通知 ID
trigger_user: Optional[str] = None # 触发工作流的用户名
issue_number: Optional[int] = None # Issue/PR 编号
# 标题和正文
title: Optional[str] = None # Issue/Discussion 标题
issue_body: Optional[str] = None # Issue 正文
pr_title: Optional[str] = None # PR 标题
pr_body: Optional[str] = None # PR 正文
discussion_title: Optional[str] = None # Discussion 标题
discussion_body: Optional[str] = None # Discussion 正文
# 历史数据
comments_history: Optional[List[Dict]] = None # 普通评论历史
reviews_history: Optional[List[Dict]] = None # 审核记录历史
review_comments_batch: Optional[List[Dict]] = None # 行内代码评论
# 代码上下文
diff_content: Optional[str] = None # PR diff 内容
diff_url: Optional[str] = None # PR diff 的 URL
clone_url: Optional[str] = None # SSH 克隆地址
head_ref: Optional[str] = None # head 分支
base_ref: Optional[str] = None # base 分支
head_repo: Optional[str] = None # head repo:branch 格式
base_repo: Optional[str] = None # base repo:branch 格式
commit_sha: Optional[str] = None # Commit SHA
# 元数据
current_comment_id: Optional[str] = None # 触发评论的 ID
current_review_id: Optional[str] = None # 触发审核的 ID
is_mention_in_body: Optional[bool] = None # 是否在正文中被提及
is_mention_in_review: Optional[bool] = None # 是否在审核中被提及
is_truncated: Optional[bool] = None # 上下文是否被截断
latest_comment_url: Optional[str] = None # 最新评论的 URL|
|
||
| | 变量名 | 默认值 | 说明 | | ||
| |--------|--------|------| | ||
| | `ALLOWED_USERS` | - | 允许触发的用户列表 (逗号分隔) | |
There was a problem hiding this comment.
|
|
||
| 1. **创建 Issue**:记录任务和上下文 | ||
| 2. **安装 Claude CLI**:从官方脚本安装 | ||
| 3. **配置 MCP 服务器**: |
|
@WhiteElephantIsNotARobot 解决review |
Summary
创建了完整的 README.md 文档,详细描述了整个项目的架构和功能。
Changes
添加了
README.md文件,包含以下内容:项目概述
架构概览
项目结构
核心组件详解
FastAPI 服务器 (
server.py)智能截断算法
双 Token 架构
上下文数据模型 (
TaskContext)GitHub Actions 工作流
环境变量配置
API 端点
特性列表
使用方式
Test Plan
🤖 Generated with Claude Code