feat: 增加交互式问答能力 - #4
Merged
Merged
Conversation
- 新增 ChatPanel 聊天面板,支持在报告页面内追问 PR 问题
- 三种 QA 模式:追问(qa)、修代码(fix_request)、写测试(test_gen)
- FindingCard 增加追问/修代码/写测试快捷按钮,自动带上 file:line 上下文
- FileRiskRow 增加追问此文件按钮
- 基于报告数据自动生成建议问题(不调 LLM,零延迟)
- AI 回答支持 Markdown 渲染(代码块、列表、粗体等)
- 对话持久化到 SQLite chat_messages 表,刷新后历史恢复
- LLM provider 新增 qa() 方法,支持多模态图片问答
- 新增 POST /api/reports/{id}/qa、GET /qa/history、GET /qa/suggestions 端点
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更内容
为 AI PR Review 增加交互式问答能力,用户可以在报告页面内追问 PR 问题、请求修复代码或生成测试用例。
新增功能
file:line上下文改动文件
backend/app/config.pyllm_model_multimodal,llm_qa_temperature,llm_max_context_messagesbackend/app/db/models.pyChatMessageRecord表backend/app/models/schemas.pyQaType,QaRequest,QaResponse,ChatHistoryItembackend/app/llm/openai_provider.pyqa()方法,支持追问/修代码/写测试三种模式 + 多模态backend/app/api/routes_qa.pybackend/app/main.pyfrontend/src/types/report.tsfrontend/src/api/client.tsaskQuestion,getQaHistory,getQaSuggestionsfrontend/src/main.tsxfrontend/src/styles.css验证