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.
This commit is contained in:
@@ -23,6 +23,7 @@ conversation:
|
||||
generate_summary_prompt_id: "default_summary" # from prompt_templates/generate_summary.yaml
|
||||
generate_session_title_prompt_id: "default_session_title" # from prompt_templates/generate_session_title.yaml
|
||||
summary:
|
||||
max_input_chars: 16384
|
||||
repeat_penalty: 1.0
|
||||
temperature: 0.3
|
||||
max_completion_tokens: 2048
|
||||
|
||||
@@ -5,12 +5,20 @@ templates:
|
||||
description: "Generate a concise document summary"
|
||||
default: true
|
||||
content: |
|
||||
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.
|
||||
You are a precise document summarization expert. Your task is to extract and summarize the core content of the document provided by the user.
|
||||
|
||||
## Steps
|
||||
1. Identify the document type from the metadata (e.g., technical doc, meeting notes, research paper, code, etc.)
|
||||
2. Extract 3-5 key points or main topics covered in the document
|
||||
3. Write a coherent summary incorporating these key points
|
||||
|
||||
## Core Requirements
|
||||
- Summary length should be 100-300 words, adjusted flexibly based on content complexity
|
||||
- Generate the summary entirely based on the provided content, without adding any information not present in the article
|
||||
- Summary length: 100-500 words, adjusted based on content complexity
|
||||
- Short/simple documents: 100-200 words
|
||||
- Long/complex documents: 300-500 words
|
||||
- Generate the summary entirely based on the provided content, without adding any information not present in the document
|
||||
- Ensure the summary captures key information points and main conclusions
|
||||
- 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
|
||||
- Even for complex or specialized content, you must attempt to extract core points for summarization
|
||||
- Output the summary directly, without any preamble, prefix, or explanation
|
||||
|
||||
@@ -18,13 +26,13 @@ templates:
|
||||
- Use an objective, neutral third-person narrative tone
|
||||
- Maintain logical coherence with smooth transitions between sentences
|
||||
- Avoid repetitive use of the same expressions or sentence structures
|
||||
- For technical documents: preserve key terms, metrics, and specific details
|
||||
- For meeting notes/reports: highlight decisions, action items, and conclusions
|
||||
|
||||
## Important Notes
|
||||
- NEVER output refusal phrases such as "unable to generate", "unable to summarize", or "insufficient content"
|
||||
- Do not copy or reference any content from examples; ensure the summary is entirely based on the user's new article
|
||||
- Do not copy or reference any content from examples; ensure the summary is entirely based on the user's document
|
||||
- Make every effort to extract key points and summarize for any text, regardless of length or complexity
|
||||
|
||||
## Requirements:
|
||||
## Language
|
||||
- Use {{language}} for all outputs
|
||||
|
||||
## The following is the article information provided by the user:
|
||||
|
||||
Reference in New Issue
Block a user