Create dedicated ChatGPT model using langchain4j native OpenAI integration #13768
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.
This PR replaces the previous
jvm-openaiimplementation with a dedicated ChatGPT model using langchain4j's native OpenAI support, providing better consistency and enhanced features.🚀 Key Changes
New ChatGPT Implementation
ChatGptModel.javausing langchain4j'sOpenAiChatModelfor better integrationModel Updates
o1-previewando1-mini(newest reasoning models)JabRefChatLanguageModelto use the new implementationCode Cleanup
JvmOpenAiChatLanguageModel.java(95 lines)jvm-openaifrom build.gradle.kts and module-info.java🎯 Benefits
For Users:
For Developers:
🧪 Testing
Added comprehensive test coverage:
ChatGptModelTest.java- Unit tests for model creation and configurationChatGptModelIntegrationTest.java- Interface compatibility verification📚 Context
The previous implementation used
jvm-openaidue to historical langchain4j limitations. With langchain4j's maturity, we can now use native OpenAI integration for better consistency with other AI providers (Mistral, Gemini, Hugging Face) while gaining enhanced features and maintainability.This change aligns with the project's goal of providing robust AI integration while reducing external dependencies and maintaining a clean, consistent architecture.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
files.jabref.org/usr/lib/jvm/temurin-17-jdk-amd64/bin/java -Xmx64m -Xms64m -Dorg.gradle.appname=gradlew -classpath \"\" -jar /home/REDACTED/work/jabref/jabref/gradle/wrapper/gradle-wrapper.jar tasks --group build(dns block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.