-
Notifications
You must be signed in to change notification settings - Fork 45
refactor: replace langchain4j with Spring AI in bigtop-manager-ai module #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lhpqaq
wants to merge
6
commits into
apache:main
Choose a base branch
from
lhpqaq:spring-ai
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
commit f04f3aceeca9600d804502394d8082a4c060a8a7
Author: lhpqaq <657407891@qq.com>
Date: Fri Dec 19 20:38:42 2025 +0800
fix pathVar
commit fd4d75f
Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Date: Fri Dec 19 12:14:33 2025 +0000
Upgrade Spring Boot to 3.2.0 to fix RestClient NoClassDefFoundError
- Spring AI 1.0.0-RC1 requires Spring Framework 6.1+ which includes RestClient
- Spring Boot 3.1.1 uses Spring Framework 6.0.x which doesn't have RestClient
- Upgraded to Spring Boot 3.2.0 which includes Spring Framework 6.1.1
- All tests passing, build successful
Co-authored-by: lhpqaq <63844184+lhpqaq@users.noreply.github.com>
commit abbc78a
Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Date: Fri Dec 19 10:14:13 2025 +0000
Add langchain4j dependencies back for server module tool support
- Server module still uses langchain4j's ToolProvider for tool calling
- Added dev.langchain4j:langchain4j to BOM and server dependencies
- Added org.jetbrains:annotations for @NotNull annotations
- AI module successfully migrated to Spring AI
- Server module retains langchain4j for tool functionality
Co-authored-by: lhpqaq <63844184+lhpqaq@users.noreply.github.com>
commit 66b542d
Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Date: Fri Dec 19 10:07:03 2025 +0000
Fix Spring AI migration issues: use getText(), remove OpenAiStreamingChatModel, fix conversationId
- Replace getContent() with getText() for Spring AI message types
- Use OpenAiChatModel for both sync and streaming (Spring AI design)
- Remove conversationId() from MessageWindowChatMemory builder (not in Spring AI API)
- Update all platform implementations (OpenAI, DeepSeek, QianFan, DashScope)
- Fix test files to use correct Spring AI ChatMemoryRepository methods
- All tests now passing
Co-authored-by: lhpqaq <63844184+lhpqaq@users.noreply.github.com>
commit 2e7ccf1
Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Date: Fri Dec 19 09:27:20 2025 +0000
Continue migration to Spring AI - fix compilation errors with correct API usage
Co-authored-by: lhpqaq <63844184+lhpqaq@users.noreply.github.com>
commit 589289c
Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Date: Fri Dec 19 09:22:27 2025 +0000
WIP: Replace langchain4j with Spring AI - updating dependencies and core files
Co-authored-by: lhpqaq <63844184+lhpqaq@users.noreply.github.com>
commit c77065f
Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Date: Fri Dec 19 09:08:56 2025 +0000
Initial plan
commit 791d21a Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Date: Thu Dec 25 09:17:33 2025 +0000 Use native Spring AI clients for DeepSeek and QianFan - DeepSeekAssistant: Migrated to use Spring AI's DeepSeekChatModel and DeepSeekApi - QianFanAssistant: Implemented OAuth2 authentication with apiKey and secretKey - Added getAccessToken method to exchange credentials for access token - QianFan requires both apiKey and secretKey (not just apiKey) - Uses access token in API requests per Baidu QianFan authentication flow - Added spring-ai-deepseek dependency to BOM and AI module - All tests passing Co-authored-by: lhpqaq <63844184+lhpqaq@users.noreply.github.com> commit ce1cc25 Author: lhpqaq <657407891@qq.com> Date: Thu Dec 25 17:07:22 2025 +0800 覆盖 commit f4c17a0 Merge: fd4d75f 7eebc0e Author: lhpqaq <657407891@qq.com> Date: Thu Dec 25 17:06:54 2025 +0800 Merge branch 'spring-ai' into copilot/replace-langchain4j-with-springai commit fd4d75f Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Date: Fri Dec 19 12:14:33 2025 +0000 Upgrade Spring Boot to 3.2.0 to fix RestClient NoClassDefFoundError - Spring AI 1.0.0-RC1 requires Spring Framework 6.1+ which includes RestClient - Spring Boot 3.1.1 uses Spring Framework 6.0.x which doesn't have RestClient - Upgraded to Spring Boot 3.2.0 which includes Spring Framework 6.1.1 - All tests passing, build successful Co-authored-by: lhpqaq <63844184+lhpqaq@users.noreply.github.com> commit abbc78a Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Date: Fri Dec 19 10:14:13 2025 +0000 Add langchain4j dependencies back for server module tool support - Server module still uses langchain4j's ToolProvider for tool calling - Added dev.langchain4j:langchain4j to BOM and server dependencies - Added org.jetbrains:annotations for @NotNull annotations - AI module successfully migrated to Spring AI - Server module retains langchain4j for tool functionality Co-authored-by: lhpqaq <63844184+lhpqaq@users.noreply.github.com> commit 66b542d Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Date: Fri Dec 19 10:07:03 2025 +0000 Fix Spring AI migration issues: use getText(), remove OpenAiStreamingChatModel, fix conversationId - Replace getContent() with getText() for Spring AI message types - Use OpenAiChatModel for both sync and streaming (Spring AI design) - Remove conversationId() from MessageWindowChatMemory builder (not in Spring AI API) - Update all platform implementations (OpenAI, DeepSeek, QianFan, DashScope) - Fix test files to use correct Spring AI ChatMemoryRepository methods - All tests now passing Co-authored-by: lhpqaq <63844184+lhpqaq@users.noreply.github.com> commit 2e7ccf1 Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Date: Fri Dec 19 09:27:20 2025 +0000 Continue migration to Spring AI - fix compilation errors with correct API usage Co-authored-by: lhpqaq <63844184+lhpqaq@users.noreply.github.com> commit 589289c Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Date: Fri Dec 19 09:22:27 2025 +0000 WIP: Replace langchain4j with Spring AI - updating dependencies and core files Co-authored-by: lhpqaq <63844184+lhpqaq@users.noreply.github.com> commit c77065f Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Date: Fri Dec 19 09:08:56 2025 +0000 Initial plan
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.
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
langchain4jbigtop-manager-aimodule dependencies inpom.xmlAIAssistantinterface to use Spring AI typesAbstractAIAssistantto use Spring AI typesPersistentChatMemoryStoreto implementChatMemoryRepositoryOpenAIAssistant– migrated to Spring AI OpenAI clientDeepSeekAssistant– implemented using Spring AIQianFanAssistant– implemented using Spring AIDashScopeAssistant– implemented using Spring AIPersistentChatMemoryStoreTestGeneralAssistantFactoryTestRestClientdependency issue by upgrading Spring BootPending Tasks
DashScopeAssistantOpenAIAssistantDeepSeekAssistantQianFanAssistantImplementation Notes
AI Module Migration
1.0.0-RC1ChatMemoryStorewith Spring AI’sChatMemoryRepositoryOpenAiChatModelsupports both synchronous and streaming callsServer Module
ToolProviderToolSpecificationToolExecutordev.langchain4j:langchain4jorg.jetbrains:annotationsDependency Updates
3.1.1to3.2.0RestClientwas introduced in Spring Framework 6.1RestClient@PathVariableannotations must explicitly specify the parameter name(e.g.
@PathVariable(name = "id"))thank copilot~