lhpqaq opened a new pull request, #291:
URL: https://github.com/apache/bigtop-manager/pull/291

   ## Migration Plan: Replace LangChain4j with Spring AI
   
   This PR migrates the AI module from **LangChain4j** to **Spring AI**, 
aligning the implementation with the Spring ecosystem and simplifying future 
maintenance.
   
   ### Completed Tasks
   
   - [x] Update BOM dependencies  
     - Remove `langchain4j`
     - Add required Spring AI modules
   - [x] Update `bigtop-manager-ai` module dependencies in `pom.xml`
   - [x] Refactor core interfaces and abstractions
     - [x] Update `AIAssistant` interface to use Spring AI types
     - [x] Update `AbstractAIAssistant` to use Spring AI types
     - [x] Update `PersistentChatMemoryStore` to implement 
`ChatMemoryRepository`
   - [x] Migrate platform implementations
     - [x] `OpenAIAssistant` – migrated to Spring AI OpenAI client
     - [x] `DeepSeekAssistant` – implemented using Spring AI
     - [x] `QianFanAssistant` – implemented using Spring AI
     - [x] `DashScopeAssistant` – implemented using Spring AI
   - [x] Update tests
     - [x] `PersistentChatMemoryStoreTest`
     - [x] `GeneralAssistantFactoryTest`
     - [x] All tests passing
   - [x] Build and verify
     - [x] AI module builds and tests successfully
     - [x] Fixed `RestClient` dependency issue by upgrading Spring Boot
   
   ### Pending Tasks
   
   - [ ] Manual runtime verification
     - [x] `DashScopeAssistant`
     - [ ] `OpenAIAssistant`
     - [ ] `DeepSeekAssistant`
     - [ ] `QianFanAssistant`
   - [ ] Refactor function-calling support
     - Reimplement using Spring AI APIs, or
     - Introduce a lightweight MCP-based client
   
   ---
   
   ## Implementation Notes
   
   ### AI Module Migration
   
   - Migrated from **LangChain4j** to **Spring AI `1.0.0-RC1`**
   - Replaced `ChatMemoryStore` with Spring AI’s `ChatMemoryRepository`
   - A single `OpenAiChatModel` supports both synchronous and streaming calls
   
   ---
   
   ### Server Module
   
   - Retained **LangChain4j** dependencies for tool/function calling:
     - `ToolProvider`
     - `ToolSpecification`
     - `ToolExecutor`
   - Tool migration to Spring AI is **out of scope** for this PR
   - Added required dependencies:
     - `dev.langchain4j:langchain4j`
     - `org.jetbrains:annotations`
   
   ---
   
   
   ### Dependency Updates
   
   - **Spring Boot** upgraded from `3.1.1` to `3.2.0`
     - Required for **Spring Framework 6.1+**
     - `RestClient` was introduced in Spring Framework 6.1
     - Spring AI OpenAI integration depends on `RestClient`
     - All tests pass after the upgrade
   - **Note**:
     - After upgrading, `@PathVariable` annotations must explicitly specify the 
parameter name  
       (e.g. `@PathVariable(name = "id")`)


-- 
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]

Reply via email to