Skip to content

Conversation

@KariHall619
Copy link
Contributor

What this PR does / why we need it:
This PR defines a standard communication interface for AI plugins within the existing unified plugin architecture. Instead of treating AI
plugins as special cases, they now use the same extension system as other plugins with category-based identification.

  Key changes:
  - Added `pkg/server/ai_interface.go` with standardized AIRequest/AIResponse structures
  - Enhanced ExtManager with category-based plugin filtering capabilities
  - Added categories field support to plugin configuration
  - Follows simple design patterns similar to langchaingo (model + prompt)

  The interface uses JSON message protocol over the existing plugin communication channels, maintaining consistency with the current
  architecture while providing AI-specific data structures.

  **Which issue(s) this PR fixes**:
  Fixes #

Define standard interfaces for AI plugin communication:
- AIRequest: model + prompt + config (following langchaingo pattern)
- AIResponse: content + metadata
- AICapabilities: plugin capability discovery
- Standard plugin message format using existing ExtManager system
- AI plugins identified via StoreKind.Categories: ["ai"]
- Add AI plugin detection in startPlugins() function - logs when AI plugins are started
- Implement GetAIPlugins() method to filter stores by 'ai' category
- Add SendAIRequest() and GetAICapabilities() methods with TODO for plugin communication
- Add AI plugin example in extension.yaml with OpenAI configuration
- Use existing ExtManager and StoreKind architecture - AI plugins follow same patterns as other plugins
- Compatible with existing protobuf Categories field for plugin classification

This provides the complete AI plugin integration foundation while maintaining unified plugin architecture.
AI plugins should be treated exactly like other plugins in the startup process.
The ExtManager.Start() method handles all plugins uniformly - AI plugins are
only distinguished by their Categories field, not by special startup logic.

This maintains the unified plugin architecture principle.
- Change plugin name from 'atest-ai-openai' to 'atest-ext-ai' following naming convention
- Remove specific OpenAI parameters and implementation details
- Keep only the essential configuration matching other plugins format
- AI plugin now follows exact same structure as atest-store-database
- Only difference is the categories: ['ai'] field for classification
@KariHall619 KariHall619 marked this pull request as draft September 12, 2025 09:57
@KariHall619 KariHall619 marked this pull request as ready for review September 12, 2025 10:23
Signed-off-by: Zhiyuan Zhao(赵志远) <[email protected]>
@sonarqubecloud
Copy link

@LinuxSuRen LinuxSuRen added enhancement New feature or request skip-changelog ospp 开源之夏 https://summer-ospp.ac.cn/ labels Sep 14, 2025
@LinuxSuRen LinuxSuRen merged commit f10635b into LinuxSuRen:master Sep 14, 2025
14 checks passed
@KariHall619 KariHall619 deleted the ai-interface-standard branch September 15, 2025 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ospp 开源之夏 https://summer-ospp.ac.cn/ skip-changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants