-
Notifications
You must be signed in to change notification settings - Fork 552
feat: Modify endpoints for OpenAPI compatibility #1340
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: develop
Are you sure you want to change the base?
feat: Modify endpoints for OpenAPI compatibility #1340
Conversation
e5ac825 to
f494cf2
Compare
|
Updated |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1340 +/- ##
===========================================
+ Coverage 71.66% 71.70% +0.04%
===========================================
Files 171 171
Lines 17015 17071 +56
===========================================
+ Hits 12193 12240 +47
- Misses 4822 4831 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
please don't merge- we want to refactor this a little more |
| default=None, | ||
| description="A state object that should be used to continue the interaction.", | ||
| ) | ||
| # Standard OpenAI completion parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's bring the OpenAI schema into a separate file- perhaps server/schemes/openai
| default=None, | ||
| description="Top-p sampling parameter.", | ||
| ) | ||
| stop: Optional[str] = Field( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stop needs to be Optional[Union[str, List[str]]]
| index: Optional[int] = Field( | ||
| default=None, description="The index of the choice in the list of choices." | ||
| ) | ||
| messages: Optional[dict] = Field( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: messages needs to be message (no s)
Description
This PR modifies the existing
/v1/chat/completionsand adds a/v1/modelsendpoint to be OpenAI compatible.Changes:
nemoguardrails/server/api.py- Introduces new classes that correspond to OpenAI's standard chat completion and models APItests/test_api.py,tests/test_server_calls_with_state.py&tests/test_threads- Updates the message content path according to newResponseBodyclass and adds new tests for the/v1/modelsAPIRelated Issue(s)
Checklist