Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ai): add AI-based issue interpretation feature #707

Merged
merged 10 commits into from
Jan 9, 2025

Conversation

elliotxx
Copy link
Collaborator

@elliotxx elliotxx commented Jan 8, 2025

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR introduces a new AI-based issue interpretation feature to enhance the diagnostic capabilities of the system.

Key changes include:

  • Implementation of a new endpoint for AI-based issue interpretation.
  • Addition of a new AI prompt type specifically for issue interpretation.
  • Updates to UI components to support the new AI interpretation feature.
  • Addition of translations for the AI interpretation feature to ensure localization support.
  • Removal of a deprecated types file and refactoring of related code to maintain code cleanliness.
  • Updates to styling for the new AI interpretation panel to ensure a consistent and user-friendly interface.

This feature allows users to gain AI-driven insights and interpretations of scanner issues, improving the overall diagnostic experience.

image

image

Demo:

demo

Which issue(s) this PR fixes:

Fixes #632

- Implement new endpoint for AI-based issue interpretation
- Add new AI prompt type for issue interpretation
- Update UI components to support AI interpretation
- Add translations for AI interpretation feature
- Remove deprecated types file and refactor related code
- Update styling for new AI interpretation panel

This feature allows users to get AI-based insights and interpretations of scanner issues, improving the diagnostic capabilities of the system.
@elliotxx elliotxx added this to the v0.6.0 milestone Jan 8, 2025
@elliotxx elliotxx self-assigned this Jan 8, 2025
@elliotxx elliotxx changed the title feat: add AI-based issue interpretation feature feat(ai): add AI-based issue interpretation feature Jan 8, 2025
elliotxx and others added 9 commits January 8, 2025 16:57
- Add `github.com/KusionStack/karpor/pkg/core/handler` import
- Replace direct `http.Error` calls with `handler.FailureRender`
- Add new HTTP status codes (401, 429, 404) to API documentation
- Log the start of the YAML interpretation process

These changes centralize error handling and provide more detailed API documentation, improving maintainability and user feedback.
- Add new endpoint `/insight/issue/interpret/stream` for AI-based issue interpretation
- Define new schemas `ai.AuditData` and `ai.IssueGroup` for AI-related data
- Update OpenAPI specification and documentation to reflect new endpoint and schemas
- Modify handler to reference `ai.AuditData` instead of `scanner.AuditData`

This feature enables the system to provide detailed AI-driven interpretations of scanner issues, enhancing the insight capabilities of the platform.
- Streamline the Kubernetes issue interpretation prompt to focus on critical issues and solutions
- Remove redundant sections and consolidate analysis requirements
- Add clear formatting instructions
- Remove 'overflow: scroll' property from the interpret_panel component

This change simplifies the styling of the interpret_panel by removing unnecessary scrolling behavior, which may improve the user experience by reducing visual clutter.
@elliotxx elliotxx merged commit f78b99f into main Jan 9, 2025
10 checks passed
@elliotxx elliotxx deleted the support-ai-based-issue-interpret branch January 9, 2025 10:16
@github-actions github-actions bot locked and limited conversation to collaborators Jan 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat: AI-driven abnormal Issue interpretation
2 participants