Skip to content

Commit

Permalink
refactor: simplify Kubernetes issue interpretation prompt
Browse files Browse the repository at this point in the history
- Streamline the Kubernetes issue interpretation prompt to focus on critical issues and solutions
- Remove redundant sections and consolidate analysis requirements
- Add clear formatting instructions
  • Loading branch information
elliotxx committed Jan 8, 2025
1 parent 09abf6f commit ee534dd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 37 deletions.
48 changes: 12 additions & 36 deletions pkg/core/manager/ai/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,43 +184,19 @@ Note:
- Do NOT wrap your entire response in a markdown code block
- Use code blocks only for YAML examples or specific configuration snippets`,

IssueInterpretType: `Please analyze the following Kubernetes resource issues in %s language:
IssueInterpretType: `You are a Kubernetes expert specialized in analyzing security issues and providing solutions.
Please analyze the following issues and provide your insights in %s.
Issues Summary:
%s
Please provide a comprehensive analysis including:
1. Overall Status Summary
- Total number of issues and affected resources
- Distribution of issues by severity level
- Key patterns or trends in the issues
2. Critical Issues Analysis
- Detailed analysis of high-severity issues
- Potential impact on system stability and security
- Urgency of remediation
3. Resource Impact Analysis
- Most affected resources or resource types
- Common patterns in affected resources
- Potential system-wide implications
4. Root Cause Analysis
- Common underlying causes
- Environmental or configuration factors
- Potential systemic issues
5. Remediation Recommendations
- Prioritized action items
- Best practices to prevent similar issues
- Long-term improvement suggestions
6. Risk Assessment
- Current security implications
- Potential operational impacts
- Compliance considerations
Please format your response with clear sections using markdown headings (##) and bullet points.
Focus on providing actionable insights and clear explanations.
Include specific examples where relevant but maintain a strategic overview.`,
Please provide a concise analysis focusing on:
1. Brief summary of the most critical issues (1-2 sentences)
2. Detailed solutions with specific examples, including:
- Exact code or configuration changes needed
- Before and after examples
- Common pitfalls to avoid
3. Best practices and preventive measures
Note: Format your response with clear sections using markdown headings (##) and bullet points. Do NOT wrap your entire response in a markdown code block.`,
}
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ const ExceptionList = ({
/>
) : (
<>
<Markdown>{interpret}</Markdown>
<div className={styles.interpret_result}>
<Markdown>{interpret}</Markdown>
</div>
{interpretStatus === 'streaming' && (
<div className={styles.streaming_indicator}>
<span className={styles.dot}></span>
Expand Down

0 comments on commit ee534dd

Please sign in to comment.