-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Feature Request: Migrate from Azure OpenAI Java SDK to OpenAI Java Library
Summary
Request to add support for the official OpenAI Java library (openai-java) in Spring AI, as the Azure OpenAI Java SDK has been deprecated and is no longer receiving updates.
Background
The Azure OpenAI Java SDK (previously used by Spring AI) has been officially deprecated and Microsoft is directing users to migrate to the community-maintained OpenAI Java library. This change affects Spring AI users who rely on OpenAI integration through Azure endpoints.
Current Status:
- Azure OpenAI Java SDK:
⚠️ Deprecated - No longer receiving updates - Recommended Alternative: [OpenAI Java Library]- Actively maintained community project
Motivation
- Sustainability: The current Azure OpenAI SDK will not receive security updates or new features
- Future Compatibility: New OpenAI API features will only be available through the actively maintained library
- Community Support: The OpenAI Java library has active community support and regular updates
- API Parity: Ensures continued compatibility with latest OpenAI API capabilities
Proposed Solution
Implement support for the OpenAI Java library while maintaining backward compatibility where possible.
Suggested Implementation Approach:
- Add new dependency: Include
openai-javalibrary as an optional dependency - Create new configuration classes: Implement Spring Boot auto-configuration for the new library
- Maintain existing interfaces: Keep current Spring AI interfaces to minimize breaking changes
- Provide migration guide: Document the transition path for existing users
- Deprecation timeline: Establish a timeline for phasing out the old Azure SDK integration
Benefits
- Long-term maintainability: Ensures Spring AI remains up-to-date with OpenAI developments
- Enhanced features: Access to latest OpenAI API capabilities
- Better performance: Potential improvements from actively maintained library
- Community alignment: Aligns with OpenAI ecosystem recommendations
Compatibility Considerations
- Maintain existing Spring AI API surface to minimize migration effort
- Provide clear migration documentation
- Consider supporting both libraries during a transition period
- Ensure Azure OpenAI endpoints continue to work with the new library
Implementation Tasks
- Research OpenAI Java library integration requirements
- Design new auto-configuration classes
- Implement new client adapters
- Create comprehensive tests
- Write migration documentation
- Update Spring AI documentation
Alternative Solutions Considered
- Continue with deprecated Azure SDK: Not viable due to lack of updates
- Custom HTTP client implementation: More maintenance overhead
- Multiple library support: Increases complexity but may be necessary during transition
Impact Assessment
- Breaking Changes: Minimal if existing interfaces are preserved
- Migration Effort: Medium - requires configuration updates
- Timeline: Suggest implementation in next major/minor release
References
Community Input
This feature request addresses a critical dependency issue that affects all Spring AI users leveraging OpenAI integration. Community feedback and contributions would be valuable for ensuring a smooth transition.
Priority: High - Due to deprecated dependency security and maintenance concerns
Type: Enhancement/Migration
Area: Core Integration