Skip to content
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

Update API Endpoints Base and Embedder to Version v2 #804

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

dave90
Copy link
Contributor

@dave90 dave90 commented May 5, 2024

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:

  • Deprecation Warning for Old API: The existing version of the API will remain operational but log a warning about its deprecation to encourage migration to v2.
  • New v2 Endpoints:
    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
  • Endpoint Response Consistency:
    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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@pieroit
Copy link
Member

pieroit commented May 7, 2024

Thanks @dave90 , great contribution.
Need time to review carefully, back to you soon :D

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.

None yet

2 participants