feat: implement AI plugin calling interface with dedicated endpoints#826
Merged
LinuxSuRen merged 7 commits intoLinuxSuRen:masterfrom Sep 15, 2025
Merged
Conversation
This commit implements the AI plugin calling logic that enables the main
project to communicate with AI plugins using the existing unified plugin
architecture. AI plugins are treated like other plugins but identified
by categories: ["ai"].
Key implementations:
- Added CallAI and GetAICapabilities RPC methods in server.proto
- Implemented AI plugin calling logic in remote_server.go using existing Query interface
- AI plugins use standard map[string]string parameters: method, model, prompt, config
- Response follows DataResult.Pairs format: content, meta, success, error
- HTTP endpoints: POST /api/v1/ai/generate, GET /api/v1/ai/capabilities/{plugin_name}
AI plugin developers need to:
1. Configure categories: ["ai"] in extension.yaml
2. Implement Query method to handle "ai.generate" and "ai.capabilities"
3. Return standard DataResult format
The implementation maintains full compatibility with existing plugin
architecture while providing AI-specific communication standards.
fb4dde7 to
0cb08b0
Compare
LinuxSuRen
requested changes
Sep 14, 2025
- Rollback protoc-gen-go from v1.36.9 to v1.28.1 to reduce compatibility issues - Keep all AI plugin functionality intact - Protoc version remains at v5.29.3 - AI interface and endpoints maintained as implemented
Complete protobuf toolchain rollback: - protoc-gen-go: v1.36.9 → v1.28.1 - protoc: v5.29.3 → v4.22.2 This ensures maximum compatibility while preserving all AI plugin functionality: - CallAI and GetAICapabilities RPC methods maintained - All existing endpoints and interfaces preserved - Reduces potential version conflicts and integration issues Matches original commit ce1f79f protobuf generation versions.
Resolved merge conflicts between ai-plugin-call-logic and master branches: - ai_interface.go: Preserved comprehensive AI plugin communication standards and interface documentation from HEAD, providing complete protocol specs for AI plugin developers - remote_server.go: Kept complete implementation of CallAI and GetAICapabilities methods that properly integrate with existing plugin architecture using loader.Query interface Both resolutions maintain full AI plugin functionality while ensuring compatibility with the existing codebase architecture.
Contributor
Author
|
The reason for the code conflict between #826 and #825 is that the two branches originated from the same commit. The code for the AI plugin calling logic in #825 was a placeholder implementation. The code in #826 is a complete implementation (including complete CallAI and GetAICapabilities implementations, using the existing plugin manager for communication). |
Complete protoc toolchain rollback by downgrading protoc-gen-go-grpc from v1.5.1 to v1.2.0. This resolves compilation errors and restores concrete struct implementations needed for tests.
LinuxSuRen
requested changes
Sep 15, 2025
LinuxSuRen
requested changes
Sep 15, 2025
Remove unnecessary empty string check for config parameter in CallAI method. Always include config in query parameters for consistency and simplicity. Empty string is a valid configuration value that plugins can handle appropriately.
|
LinuxSuRen
approved these changes
Sep 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Depends on: #825 (file: pkg/server/ai_interface.go), please review the corresponding PR first。
What this PR does / why we need it:
This PR implements the AI plugin calling logic that enables the main project to communicate with AI plugins using the existing unified
plugin architecture. AI plugins are treated like other plugins but identified by categories: ["ai"].