-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Add support for response_format field in OpenAI Spec (#197)
* feat: add response_format field to ChatCompletionRequest model * feat: add openai_request_data_with_response_format fixture * chore: Add TestAPIWithStructuredOutput class to openai_spec_example.py * feat: Update litserve to use TestAPIWithToolCalls in default_openaispec_tools.py * feat: Add default_openaispec_response_format.py to tests/e2e * feat: Add test for openai_parity_with_response_format * feat: Add test for openai_parity_with_response_format * reverted change * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * chore: Update field name in JSONSchema model to adhere to naming convention --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Aniket Maurya <[email protected]>
- Loading branch information
1 parent
f73d30d
commit 8ff924a
Showing
6 changed files
with
152 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import litserve as ls | ||
from litserve import OpenAISpec | ||
from litserve.examples.openai_spec_example import TestAPIWithStructuredOutput | ||
|
||
if __name__ == "__main__": | ||
server = ls.LitServer(TestAPIWithStructuredOutput(), spec=OpenAISpec()) | ||
server.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters