Skip to content

Conversation

@KariHall619
Copy link
Contributor

What type of PR is this?

/kind feature

This PR introduces a new AI assistant plugin integration with MVP implementation.

What this PR does / why we need it :

This PR integrates an AI assistant plugin into the API Testing project, enabling natural language to SQL/test case conversion through a chat interface. The implementation follows the existing plugin architecture pattern and provides:

  • AI Plugin Configuration : Added proper AI plugin definition in extension.yaml with correct naming ( atest-ext-ai )
  • gRPC Client Integration : Implemented pkg/server/ai_client.go with complete gRPC communication logic
  • Graceful Degradation : Smart fallback mechanism that uses template responses when AI plugin is unavailable
  • Frontend Integration : Added AI Assistant UI component with chat interface in Vue.js
  • Seamless User Experience : Integrated AI assistant entry point in StoreManager for easy access
  • Error Handling : Comprehensive error handling and user-friendly feedback mechanisms
  • MVP Implementation : Contract-first development approach allowing interface validation before full AI service deployment

Key Features:

  • Natural language processing interface for SQL and test case generation
  • Real-time chat interface with message history
  • Automatic fallback to template responses ensuring system stability
  • Consistent with existing plugin architecture (RunnerExtension interface)
  • Zero-configuration deployment ready

Technical Implementation:

  • Backend: Go with gRPC client wrapper and service integration
  • Frontend: Vue.js with Element Plus components
  • Architecture: Plugin-based with automatic lifecycle management
  • Communication: gRPC protocol following existing patterns

Testing:

  • ✅ Frontend UI loads correctly at http://localhost:8080
  • ✅ AI Assistant interface responds with formatted templates
  • ✅ Error handling works when AI plugin is unavailable
  • ✅ Integration with existing StoreManager navigation
  • ✅ Vue compilation issues resolved

Which issue(s) this PR fixes : /

Additional Notes:

  • This is an MVP implementation that establishes the complete interface architecture
  • When the actual AI plugin service is developed, only the response logic needs to be updated
  • All interfaces and data structures are production-ready
  • Follows the project's contribution guidelines and coding standards
Screenshot 2025-08-25 at 20 47 43 Screenshot 2025-08-25 at 20 48 02

@LinuxSuRen LinuxSuRen added the ospp 开源之夏 https://summer-ospp.ac.cn/ label Aug 25, 2025
Copy link
Owner

Choose a reason for hiding this comment

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

为什么会生成github.com/linuxsuren/api-testing这个目录呢?

Copy link
Owner

Choose a reason for hiding this comment

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

grpc client 不需要手写的,是可以生成的

Copy link
Owner

@LinuxSuRen LinuxSuRen Aug 25, 2025

Choose a reason for hiding this comment

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

我看你实现的是一个独立的页面,请参考https://github.com/LinuxSuRen/atest-ext-store-database 这个项目把前端部分迁移到插件里

@KariHall619 KariHall619 changed the title feat(ai-plugin): integrate AI assistant with gRPC architecture and MVP implementation [WIP] feat(ai-plugin): integrate AI assistant with gRPC architecture and MVP implementation Aug 30, 2025
…ecture

- Added AI plugin configuration in extension.yaml with correct naming (atest-ext-ai)
- Implemented gRPC client wrapper (pkg/server/ai_client.go) for AI service communication
- Created AI service interface with graceful degradation to template responses
- Integrated AI assistant UI component in frontend with chat interface
- Added AI assistant entry point in StoreManager for seamless user access
- Fixed Vue compilation errors in AIAssistant.vue component
- Implemented natural language to SQL/test case conversion interface
- Added comprehensive error handling and fallback mechanisms

Task: AI Plugin Integration MVP
Phase: MVP
@KariHall619 KariHall619 force-pushed the feature/ai-plugin-integration branch from 1b2a037 to ec8961d Compare August 30, 2025 14:17
…rchitecture - Remove AIAssistant.vue from main project frontend - Clean up AI assistant UI integration from StoreManager.vue - Maintain backend AI client infrastructure (ai_client.go, ai_manager.go) - Preserve gRPC client implementation for AI plugin communication - Update project architecture to separate frontend/backend concerns Breaking Changes: - Frontend AI assistant interface removed from main project - AI plugin frontend code should be developed independently in plugin repository Technical Details: - Deleted: console/atest-ui/src/views/AIAssistant.vue - Modified: Removed AI assistant entry points from StoreManager.vue - Preserved: pkg/server/ai_client.go (gRPC client implementation) - Preserved: pkg/server/ai_manager.go (AI service management) - Maintained: Backend API architecture for AI plugin integration Architecture Impact: - Frontend code separation: AI plugin UI should be in plugin repo's ui/ directory - Backend integration maintained: gRPC communication layer preserved - Resource embedding: AI plugin will serve frontend assets via gRPC endpoints - Build process: Frontend assets will be embedded in plugin binary - Refactor the AI client and manager code, replacing the custom AIRequest and AIResponse types with those generated by protobuf. Modified request processing logic to accommodate the new type structure and updated metadata field types. Also fixed formatting issues in the code Next Steps: - AI plugin repository should implement independent frontend in ui/ directory - Frontend assets will be served via GetPageOfJS() and GetPageOfCSS() gRPC methods - Main project will consume AI frontend through plugin's resource endpoints fix(protobuf): Resolve Git conflicts in .pb.go files by regenerating from .proto sources

feat(tools): Add protoc-gen-go and protoc-gen-go-grpc tool dependencies

- Added go.mod, go.sum and pin.go files for protoc-gen-go tool
- Added go.mod, go.sum and pin.go files for protoc-gen-go-grpc tool
- These tools are required for generating protobuf Go code
- Following the same pattern as other tools like golangci-lint

Task: Tool dependency management
Phase: Infrastructure
@KariHall619 KariHall619 force-pushed the feature/ai-plugin-integration branch from ec8961d to f004b33 Compare August 31, 2025 11:55
@KariHall619 KariHall619 requested a review from yuluo-yx as a code owner August 31, 2025 11:55
@sonarqubecloud
Copy link

@KariHall619 KariHall619 changed the title [WIP] feat(ai-plugin): integrate AI assistant with gRPC architecture and MVP implementation feat(ai-plugin): integrate AI assistant with gRPC architecture and MVP implementation Sep 3, 2025
Copy link
Owner

@LinuxSuRen LinuxSuRen left a comment

Choose a reason for hiding this comment

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

前端的代码需要迁移出去

Copy link
Owner

Choose a reason for hiding this comment

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

tools 下的这些文件是做什么用的呢?

@LinuxSuRen
Copy link
Owner

CI构建错误,你也需要关注的

@KariHall619 KariHall619 closed this Sep 4, 2025
@KariHall619
Copy link
Contributor Author

This PR submission record is too cluttered and not conducive to subsequent maintenance and tracking. Refreshed and available, traceable production-grade code is submitted within 1-2 days.

@KariHall619 KariHall619 deleted the feature/ai-plugin-integration branch September 8, 2025 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ospp 开源之夏 https://summer-ospp.ac.cn/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants