Skip to content

feat: implement Responses API#437

Open
AdrianMiska wants to merge 12 commits intoaallam:mainfrom
AdrianMiska:feature/Responses-API
Open

feat: implement Responses API#437
AdrianMiska wants to merge 12 commits intoaallam:mainfrom
AdrianMiska:feature/Responses-API

Conversation

@AdrianMiska
Copy link
Copy Markdown

Q A
Bug fix? no
New feature? yes
BC breaks? no
Related Issue TBD

Describe your change

This PR implements the new Responses API.

Note: I've only tested my use cases happy paths so far. Streaming support is still missing, so this isn’t the final state. Depending on feedback, this might go through another iteration or two, or it may be merged with the remaining bits addressed later. Just wanted to get this out there to share progress :)

What problem is this fixing?

The library currently lacks support for the Responses API, which means features like built-in tools weren't usable. This change adds initial support and sets the groundwork for full integration.

@Komdosh
Copy link
Copy Markdown

Komdosh commented Apr 22, 2025

Hope it will be merged soon!

@aallam
Copy link
Copy Markdown
Owner

aallam commented Apr 23, 2025

Thank you for contribution 🙌 ! let's merge your progress for now, and add streaming in a separate PR.

Copy link
Copy Markdown
Owner

@aallam aallam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please fix lint issues ? thanks!

…Responses-API

# Conflicts:
#	openai-client/src/commonMain/kotlin/com.aallam.openai.client/OpenAI.kt
@AdrianMiska AdrianMiska requested a review from aallam April 23, 2025 09:43
@AdrianMiska
Copy link
Copy Markdown
Author

Is there something I need to do to fix the workflow?

@armutyus
Copy link
Copy Markdown

hope this will be merged soon

@AdrianMiska
Copy link
Copy Markdown
Author

Hi @aallam,
I've updated this PR to align with the latest OpenAI Responses API changes.
All recent API updates are implemented except:

  • Image generation tool - depends on changes to the image API that should be done first
  • Streaming – not yet included here

Everything else should be ready for review and merge. Let me know if you’d like me to split parts of this out, or if you’d prefer me to continue with the remaining features here.
And thanks for your work on this library, btw! I'd really like to keep it up-to-date for everyone.

aallam added a commit that referenced this pull request Feb 7, 2026
- add Responses API support (create/retrieve/cancel/delete/list input items)

- add response models and structured input serialization

- add chat compatibility fields: web_search_options, annotations, reasoning_content

- fix ChatCompletionRequestBuilder mutability for reasoningEffort/store/maxCompletionTokens

- improve ChatResponseFormat compatibility for primitive/object payloads

- add compatibility tests and update docs/changelog/api baselines

Related PRs: #437 #438 #439 #441 #450

Fixes #440

Refs #446 #454 #377
aallam added a commit that referenced this pull request Feb 7, 2026
* feat: refresh OpenAI API compatibility

- add Responses API support (create/retrieve/cancel/delete/list input items)

- add response models and structured input serialization

- add chat compatibility fields: web_search_options, annotations, reasoning_content

- fix ChatCompletionRequestBuilder mutability for reasoningEffort/store/maxCompletionTokens

- improve ChatResponseFormat compatibility for primitive/object payloads

- add compatibility tests and update docs/changelog/api baselines

Related PRs: #437 #438 #439 #441 #450

Fixes #440

Refs #446 #454 #377

* ci(test): make live API tests opt-in

- gate openai-client test execution behind OPENAI_LIVE_TESTS=1

- update shared test harness and misc tests to avoid billable calls by default

- disable test retries in live test config to reduce accidental cost

- split CI into offline checks + JVM live smoke

- add separate scheduled/manual full live workflow

- document test-cost behavior in README

* ci: run live test jobs only on main

Restrict live-smoke-jvm and live-full jobs to refs/heads/main.

* ci: run offline checks on PRs and full live tests on main

- keep lint/offline checks for pull requests

- run full openai-client live suite only on push to main

- remove scheduled full-live workflow trigger

* ci: remove standalone live-full workflow

Live tests now run from build.yml only on pushes to main.

* ci: fix workflow expression for live tests

Remove secrets context from job-level if and guard live test step with a shell check for OPENAI_API_KEY.
rasharab added a commit to unblocked/openai-kotlin that referenced this pull request Apr 2, 2026
… additive changes (#17)

* feat: refresh OpenAI API compatibility (aallam#458)

* feat: refresh OpenAI API compatibility

- add Responses API support (create/retrieve/cancel/delete/list input items)

- add response models and structured input serialization

- add chat compatibility fields: web_search_options, annotations, reasoning_content

- fix ChatCompletionRequestBuilder mutability for reasoningEffort/store/maxCompletionTokens

- improve ChatResponseFormat compatibility for primitive/object payloads

- add compatibility tests and update docs/changelog/api baselines

Related PRs: aallam#437 aallam#438 aallam#439 aallam#441 aallam#450

Fixes aallam#440

Refs aallam#446 aallam#454 aallam#377

* ci(test): make live API tests opt-in

- gate openai-client test execution behind OPENAI_LIVE_TESTS=1

- update shared test harness and misc tests to avoid billable calls by default

- disable test retries in live test config to reduce accidental cost

- split CI into offline checks + JVM live smoke

- add separate scheduled/manual full live workflow

- document test-cost behavior in README

* ci: run live test jobs only on main

Restrict live-smoke-jvm and live-full jobs to refs/heads/main.

* ci: run offline checks on PRs and full live tests on main

- keep lint/offline checks for pull requests

- run full openai-client live suite only on push to main

- remove scheduled full-live workflow trigger

* ci: remove standalone live-full workflow

Live tests now run from build.yml only on pushes to main.

* ci: fix workflow expression for live tests

Remove secrets context from job-level if and guard live test step with a shell check for OPENAI_API_KEY.

* fix(images,tests): stabilize live suites for image edits and vector stores (aallam#459)

* test(vector-stores): avoid flaky immediate list containment assertion

Vector store list responses are paginated/eventually consistent; keep create/retrieve/update/delete assertions and make list check non-brittle.

* fix(images): align edit uploads with current API requirements

- include default model for image edit requests when omitted

- send PNG mime type for image edit/variation file parts

- make live image edit tests explicit with model=dall-e-2

* test(chat-vision): remove flaky external image URL dependency

Use a deterministic data URL generated from bundled test resources for common live vision tests.

* chore(release): prepare 4.1.0

* chore: update maven-publish version

* docs: align README and guides with current API surface [skip ci]

* Remove upstream-only files: TestResponses.kt, ResponseInput.kt, ResponseId.kt

* feat: rename response API methods and reasoning config

Agent-Id: agent-d3cedbcf-047f-4488-b327-4bc989eab49d
Linked-Note-Id: 95dee90b-6003-487e-82ff-40897eeceace

* feat: add response retrieval, deletion, and cancellation endpoints

Agent-Id: agent-e1e893ed-1378-4eb9-9911-3c6c4b2c5a7c
Linked-Note-Id: fc3a8998-aa78-4d48-a5f2-8b9c3e21ce31

* feat: restore ResponseId value class for response identification

Agent-Id: agent-91b7b111-1dd4-45c1-bc0c-5b0615a04d39

* chore: update API surface files

* style: fix spotless formatting

* ci: update to JDK 17

* fix: regenerate API files for JDK 17 compatibility

* build: exclude dokkaHtml from build-maven-local

* build: fix signing disable flag in Makefile

* build: minimize build-maven-local to JVM-only publications

* build: add BOM back to build-maven-local

* build: include KMP metadata modules in build-maven-local

* build: clean up checksums, javadoc, and tooling metadata from .maven

---------

Co-authored-by: Mouaad Aallam <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants