simple-openai
simple-openai copied to clipboard
Add support for OpenAI responses API
Adding support to the OpenAI responses API See https://github.com/sashirestela/simple-openai/issues/307
- Building on the domain classes added by @sashirestela
- Add additional domain classes
- Add the services to OpenAI and SimpleOpenAI
- Add unit tests
- Add comprehensive demo
- Update the README (except the image of the Google sheet with the endpoints)
During the work I also added some resources and discovered they miss a newline in the end. I fixed it with a refactoring, which added a newline to many other resource files. I hope it's OK.
@sashirestela spotless check fail, but it passes on my machine 🤷
@the-gigi, thanks for your PR. There are previous things that you need to do before I could go on a deep revision. Below are my first observations:
- Focus on implementing the new functionality, don't add other changes not related to the main topic.
- In the failing build you can see the detail of the 9 files with format violations.
- You need to sync your branch with the latest changes that I uploaded to the 307-new-responses-api branch one week ago. That was necessary because the domain classes were incomplete.
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
Attention: Patch coverage is 95.80838% with 7 lines in your changes missing coverage. Please review.
Project coverage is 95.03%. Comparing base (
ea72591) to head (0919495).
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## main #322 +/- ##
============================================
+ Coverage 94.91% 95.03% +0.11%
- Complexity 161 181 +20
============================================
Files 73 85 +12
Lines 1102 1269 +167
Branches 48 54 +6
============================================
+ Hits 1046 1206 +160
- Misses 36 42 +6
- Partials 20 21 +1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
@the-gigi, thanks for your PR. There are previous things that you need to do before I could go on a deep revision. Below are my first observations:
- Focus on implementing the new functionality, don't add other changes not related to the main topic.
Sounds good. I reverted the newline at the end of file changes.
- In the failing build you can see the detail of the 9 files with format violations.
I figured it out. It looks like between forking from a branch, rebasing and squashing commits that spotless skipped checking/applying for the new files. To fix it, I had to temporarily comment out this in pom.xml (don't worry. not committed)
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>${spotless.version}</version>
<configuration>
<!--ratchetFrom>origin/main</ratchetFrom --> 👈
- You need to sync your branch with the latest changes that I uploaded to the 307-new-responses-api branch one week ago. That was necessary because the domain classes were incomplete.
That's too bad. When I took over and started from your original [307-new-responses-api] branch I thought I'll work on it until the PR. I didn't realize you keep working on it too. So, I continued your work on the domain. Your additional changes are mostly incompatible with the current state of the PR (except for the Reasoning class where we are compatible). I added the unrelated change to ChatRequest.java. I'll see how complicated it is to integrate your domain changes, but if it's not trivial I might not have the time in the next couple of months (work + vacation).
That's too bad. When I took over and started from your original [307-new-responses-api] branch I thought I'll work on it until the PR. I didn't realize you keep working on it too. So, I continued your work on the domain. Your additional changes are mostly incompatible with the current state of the PR (except for the Reasoning class where we are compatible). I added the unrelated change to ChatRequest.java. I'll see how complicated it is to integrate your domain changes, but if it's not trivial I might not have the time in the next couple of months (work + vacation).
Sadly, some domain classes were pending. Moreover, OpenAI is committing domain changes even these days. It seems that the Response API is quite unstable yet. I'm doing a final revision to domain classes today and I'm identifying some changes.
Another PR is in progress to include the latest domain changes from OpenAI. Thanks anyway @the-gigi
Another PR is in progress to include the latest domain changes from OpenAI. Thanks anyway @the-gigi
No problem. I'm always happy to help when I can.