-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
feat: add payload validation, update Simple API Test fixture, run tests #2664
Merged
Conversation
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
anovazzi1
approved these changes
Jul 12, 2024
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.
LGTM
7f70384
to
4f1415e
Compare
Pull Request Validation ReportThis comment is automatically generated by Conventional PR Whitelist Report
Result Pull request does not satisfy any enabled whitelist criteria. Pull request will be validated. Validation Report
Result Pull request satisfies all enabled pull request rules. Last Modified at 12 Jul 24 16:56 UTC |
8692cc5
to
60df022
Compare
This commit updates the Simple API Test fixture in the conftest.py file and modifies the test endpoints in the test_endpoints.py file. The changes ensure that the tests use the correct API test configuration and reflect the recent updates made to the codebase.
The test assertions in the test_endpoints.py file have been updated to reflect the changes in the code. The assertions now correctly check the number of outputs and the values of the input_value for different input types. This ensures that the tests accurately verify the behavior of the API endpoints.
The default value for the `input_value` field in the `SimplifiedAPIRequest` schema has been changed from an empty string to `None`. This ensures that the default value accurately represents the absence of an input value.
This commit adds validation for the input value and tweaks in the simplified_run_flow function. If both the input value and tweaks are provided, it checks for conflicts and raises an InvalidChatInputException if necessary. This ensures that the input value and tweaks are handled correctly and prevents conflicts between them. Refactor the code in simplified_run_flow to include the validation logic and handle the InvalidChatInputException appropriately.
…iterating over them to prevent potential errors
…Output This commit adds an advanced option for storing messages in the ChatInput and ChatOutput components. By setting the `advanced` flag to `True`, the messages will be stored in the history. This provides more flexibility and control over message storage in the application.
60df022
to
6f59af9
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
lgtm
This PR has been approved by a maintainer
python
Pull requests that update Python code
size:XL
This PR changes 500-999 lines, ignoring generated files.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request updates the Simple API Test fixture in the conftest.py file and modifies the test endpoints in the test_endpoints.py file. The changes ensure that the tests use the correct API test configuration and reflect the recent updates made to the codebase.
Update test assertions for successful runs with input types
The test assertions in the test_endpoints.py file have been updated to reflect the changes in the code. The assertions now correctly check the number of outputs and the values of the input_value for different input types. This ensures that the tests accurately verify the behavior of the API endpoints.
Remove api_key_required fixture from run endpoint tests
The api_key_required fixture has been removed from the run endpoint tests. This simplifies the test setup and ensures that the tests focus on the specific functionality being tested.
Update input_value default value in SimplifiedAPIRequest schema
The default value for the
input_value
field in theSimplifiedAPIRequest
schema has been changed from an empty string toNone
. This ensures that the default value accurately represents the absence of an input value.Add InvalidChatInputException to exceptions/api.py
This commit adds the
InvalidChatInputException
class to theexceptions/api.py
file. This exception is raised when there is an invalid chat input value or tweak combination in the simplified run flow.Validate input value and tweaks in simplified run flow