Skip to content

Commit cb36570

Browse files
committed
feat(summary): enhance document summarization capabilities and UI
- Added max_input_chars configuration to limit input size for summary generation. - Updated generate_summary.yaml to clarify summary generation steps and requirements. - Introduced a new summary section in the document content view to display generated summaries or loading states. - Refactored doc-content.vue to utilize computed properties for improved performance and readability. - Enhanced knowledge base hooks to include description and summary status fields for better data handling. - Updated internationalization files to include new summary-related labels in multiple languages.
1 parent 8daecd3 commit cb36570

File tree

10 files changed

+264
-141
lines changed

10 files changed

+264
-141
lines changed

config/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ conversation:
2323
generate_summary_prompt_id: "default_summary" # from prompt_templates/generate_summary.yaml
2424
generate_session_title_prompt_id: "default_session_title" # from prompt_templates/generate_session_title.yaml
2525
summary:
26+
max_input_chars: 16384
2627
repeat_penalty: 1.0
2728
temperature: 0.3
2829
max_completion_tokens: 2048

config/prompt_templates/generate_summary.yaml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,34 @@ templates:
55
description: "Generate a concise document summary"
66
default: true
77
content: |
8-
You are a precise document summarization expert. Your task is to extract and summarize the core content of the article or excerpt provided by the user.
8+
You are a precise document summarization expert. Your task is to extract and summarize the core content of the document provided by the user.
9+
10+
## Steps
11+
1. Identify the document type from the metadata (e.g., technical doc, meeting notes, research paper, code, etc.)
12+
2. Extract 3-5 key points or main topics covered in the document
13+
3. Write a coherent summary incorporating these key points
914
1015
## Core Requirements
11-
- Summary length should be 100-300 words, adjusted flexibly based on content complexity
12-
- Generate the summary entirely based on the provided content, without adding any information not present in the article
16+
- Summary length: 100-500 words, adjusted based on content complexity
17+
- Short/simple documents: 100-200 words
18+
- Long/complex documents: 300-500 words
19+
- Generate the summary entirely based on the provided content, without adding any information not present in the document
1320
- Ensure the summary captures key information points and main conclusions
21+
- If the content contains "[...content omitted...]" markers, it is a sampled excerpt from a longer document — cover ALL topics that appear across the provided sections, not just the beginning
1422
- Even for complex or specialized content, you must attempt to extract core points for summarization
1523
- Output the summary directly, without any preamble, prefix, or explanation
1624
1725
## Format and Style
1826
- Use an objective, neutral third-person narrative tone
1927
- Maintain logical coherence with smooth transitions between sentences
2028
- Avoid repetitive use of the same expressions or sentence structures
29+
- For technical documents: preserve key terms, metrics, and specific details
30+
- For meeting notes/reports: highlight decisions, action items, and conclusions
2131
2232
## Important Notes
2333
- NEVER output refusal phrases such as "unable to generate", "unable to summarize", or "insufficient content"
24-
- Do not copy or reference any content from examples; ensure the summary is entirely based on the user's new article
34+
- Do not copy or reference any content from examples; ensure the summary is entirely based on the user's document
2535
- Make every effort to extract key points and summarize for any text, regardless of length or complexity
2636
27-
## Requirements:
37+
## Language
2838
- Use {{language}} for all outputs
29-
30-
## The following is the article information provided by the user:

0 commit comments

Comments
 (0)