zhaohai666 opened a new issue, #665:
URL: https://github.com/apache/rocketmq-dashboard/issues/665
# Issue Summary
## Overview
Refactor the monolithic single implementation of `LlmGateway` into an
interface-based provider pattern architecture.
### Core Changes
1. Split LLM gateway logic into an abstract interface and two concrete
implementations:
- `LlmGatewayImpl`: Real HTTP client implementation for production API
calls
- `LlmGatewayStub`: Mock stub implementation for local frontend
development and unit testing
2. Introduce `LlmSettingsResolver` to unify LLM configuration parsing,
replacing the original separate `LlmConfigService` and configuration logic in
`LlmController`
3. Simplify `AiController` and `AiService` layers, remove redundant legacy
components: `OpenAiCompatibleLlmClient` and `OpenAiCompatibleLlmGateway`
4. Clean up the entire `tool/` subpackage containing 10 independent tool
handler files; inline all Tool definitions directly within `McpServerImpl`
## Architecture Design Details
1. Core `LlmGateway` interface exposes three standardized methods:
- `chat()`: Execute LLM chat completion requests
- `testConnection()`: Validate connectivity to target LLM provider
endpoint
- `listModels()`: Fetch available model list from provider
2. Production implementation `LlmGatewayImpl` built with Spring WebClient,
fully compatible with multi-provider specs:
OpenAI, Azure OpenAI, DeepSeek, Tongyi Qwen, Ollama, AWS Bedrock
3. Mock `LlmGatewayStub` returns static predefined mock responses for
offline development and test scenarios
4. New `LlmSettingsResolver` loads and parses LLM config via
`SettingsService`, eliminating the dedicated `LlmConfigService`
5. Consolidate all MCP Tool registration logic: remove separate standalone
`ToolHandler` classes and embed all tool definitions inside `McpServerImpl`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]