-
Notifications
You must be signed in to change notification settings - Fork 2k
Add support for OpenAI Java SDK (official Java library from OpenAI) #4688
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
base: main
Are you sure you want to change the base?
Conversation
|
With today's commit, we now have:
And some basic shared configuration, that will be improved next, so we're ready for the more complex stuff (ChatModel). |
|
The setup logic for the OpenAI SDK should be very similar to this class from LangChain4, because it's basically doing the same thingj: I'm very careful before taking code from another project, but I believe this is fine: I'm the author of that other class, so I have the copyright on this code. Also, it's simple logic to connect to Azure/GitHub Models/OpenAI, nothing that is very specific or critical. However, if this causes problems:
Happy to discuss this if needed. |
|
Argh, I updated my fork and now my commit history is all wrong!!!! I'll do my best to fix this. |
Fix spring-projects#3368 Signed-off-by: Julien Dubois <[email protected]>
- Add support for ImageModel - Refactor the existing code now that we have support for 2 models Signed-off-by: Julien Dubois <[email protected]>
- Added support for authentication with OpenAI, Azure OpenAI and GitHub models. - Added support for complex OpenAI client configuration - Refactored the existing code to use those new methods Signed-off-by: Julien Dubois <[email protected]>
Create the OpenAiOfficialChatOptions class to prepare for the implementation of the Chat Model Signed-off-by: Julien Dubois <[email protected]>
Create the OpenAiOfficialChatModel class: - This is a first implementation that is not of good quality yet - Tests do not pass yet Signed-off-by: Julien Dubois <[email protected]>
- Improve authentication, mostly with Azure OpenAI Signed-off-by: Julien Dubois <[email protected]>
- First tests passing for ChatModel Signed-off-by: Julien Dubois <[email protected]>
- More tests passing for ChatModel Signed-off-by: Julien Dubois <[email protected]>
fddc244 to
149aa9c
Compare
|
I had to force push my fork, sorry if anyone had this pulled on their side! I'll check if everything is good, otherwise I have a backup on my laptop. |
This follows the discussion on ticket #3368
This is a draft PR as the work is pretty big, I'll start with the simpler implementations (Embeddings) and finish with the more complex one (Chat).