Skip to content

Feat: Add Support for OpenAI's new Responses API spec#462

Closed
deependujha wants to merge 1 commit intoLightning-AI:mainfrom
deependujha:feat/add-response-api-spec
Closed

Feat: Add Support for OpenAI's new Responses API spec#462
deependujha wants to merge 1 commit intoLightning-AI:mainfrom
deependujha:feat/add-response-api-spec

Conversation

@deependujha
Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #455

Before submitting
  • Was this discussed/agreed via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 18 lines in your changes missing coverage. Please review.

Project coverage is 88%. Comparing base (92d8115) to head (d06c82d).
Report is 46 commits behind head on main.

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #462   +/-   ##
===================================
- Coverage    89%    88%   -1%     
===================================
  Files        37     37           
  Lines      2155   2191   +36     
===================================
+ Hits       1911   1929   +18     
- Misses      244    262   +18     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

return ChatCompletionResponse(model=model, choices=choices, usage=sum(usage_infos))


# ===== OpenAI Response API =====
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think it would be good to have a separate spec file, maybe openai_response.py.

By the way, for the request parameters and their types, you can also refer to the OpenAI Python SDK:
https://github.com/openai/openai-python/blob/main/src/openai/types/responses/response_create_params.py

In LitServe, Pydantic is mostly preferred, whereas OpenAI uses TypedDict for type definitions.

@aniketmaurya
Copy link
Copy Markdown
Collaborator

hi @deependujha, how is it going here? Do you need any help?

@bhimrazy
Copy link
Copy Markdown
Collaborator

Hi @deependujha,
Just a gentle reminder — please feel free to close this PR if you don't have any immediate plans to resume on it.
Thanks! 😊

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.

Support for OpenAI's new Responses API spec

3 participants