Update API Endpoints Base and Embedder to Version v2 #804
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.
Description
This pull request introduces v2 of existing API endpoints: base and embedder. The update ensures that the previous version continues to operate (though it is now deprecated) while offering improved and additional functionalities in v2. The Goal is to maintain backward compatibility and encourage users to transition to the new version due to its enhanced capabilities.
Changes:
The endpoints now respond with models structured as JSON Schema to improve integration and consistency across services.
The endpoint /settings/{languageEmbedderName} has been updated to /{languageEmbedderName}/settings in v2, better semantic ordering
The upsert_embedder_setting_v2 endpoint has been modified to return the same response structure as get_embedder_settings_v2. This change simplifies the API and aligns the user experience across different operations. Also, the endpoint checks if the required fields are present in the current payload (otherwise raises an exception). Additionally, it enriches the payload by automatically inserting default values for any properties not supplied by the user but defined in the schema ( only for properties with a default value). This enhancement ensures greater consistency between the model representation and the stored data.
Related to issue #764
Type of change
Checklist: