Skip to content

Conversation

@coltea
Copy link
Collaborator

@coltea coltea commented Dec 29, 2025

PR 标题

feat 支持生成文档摘要提示词可配置

相关 Issue

关闭或关联的 Issue (如有):

变更类型

请勾选适用的变更类型:

  • Bug 修复 (不兼容变更的修复)
  • 新功能 (不兼容变更的新功能)
  • 功能改进 (不兼容现有功能的改进)
  • 文档更新
  • 依赖更新
  • 重构 (不影响功能的代码修改)
  • 测试用例
  • CI/CD 配置变更
  • 其他 (请描述):

变更内容

详细描述本次 PR 的具体变更内容:

  1. feat 支持生成文档摘要提示词可配置

测试情况

描述本次变更的测试情况:

  • 已本地测试
  • 已添加测试用例
  • 不需要测试 (理由: )

其他说明

任何其他需要说明的事项:

Copilot AI review requested due to automatic review settings December 29, 2025 09:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces configurable prompts for document summary generation. Previously, the summary prompt was hardcoded in the LLMUsecase.requestSummary method. Now, the prompt can be retrieved from the database based on the knowledge base ID (kbID), allowing for per-KB customization of summary generation behavior.

Key Changes:

  • Added kbID parameter to the summary generation pipeline to enable prompt retrieval
  • Implemented GetSummaryPrompt repository method to fetch KB-specific summary prompts from settings
  • Added default summary prompt constant for reference and potential fallback scenarios

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
backend/usecase/node.go Passes kbID to SummaryNode method
backend/usecase/llm.go Updates SummaryNode and requestSummary signatures to accept kbID; retrieves custom summary prompt
backend/repo/pg/prompt.go Adds GetSummaryPrompt method and summary_content field to promptJson struct
backend/pro Subproject commit update
backend/handler/mq/rag.go Passes kbID to SummaryNode method call
backend/domain/llm.go Defines default summary prompt constant

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coltea coltea force-pushed the feat-summary-prompt branch from 48396b7 to b9e7353 Compare December 29, 2025 09:25
@coltea coltea force-pushed the feat-summary-prompt branch from b9e7353 to 17aea65 Compare December 29, 2025 09:28
Copilot AI review requested due to automatic review settings December 29, 2025 09:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coltea coltea merged commit b60eb33 into chaitin:main Dec 29, 2025
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant