feat: allow users to add remote models #4534
Merged
+200
−3
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.
Describe Your Changes
Allow users to manually add models when model list URL is unavailable/inaccessible (e.g. OpenRouter).
AC:
User can add new remote model
Error handling - model already exists
Out of scope:
Fixes Issues
Changes
This pull request includes several changes to improve the management and addition of remote engine models. The key changes involve adding new functionalities for handling remote engine models, updating the UI components, and importing necessary modules.
Improvements to remote engine model management:
core/src/types/model/modelEntity.ts
: Added a new optionalmode
field to theModel
type to represent a modern version of the model identifier.web/hooks/useEngineManagement.ts
: AddedaddRemoteEngineModel
anduseGetEngineModelSources
functions to handle adding remote engine models and fetching remote model sources.UI updates and new components:
web/screens/Settings/Engines/ModalAddModel.tsx
: Introduced a newModalAddModel
component to provide a user interface for adding new remote engine models.web/screens/Settings/Engines/RemoteEngineSettings.tsx
: Integrated theModalAddModel
component into theRemoteEngineSettings
screen to allow users to add models directly from the settings.Module imports:
web/hooks/useEngineManagement.ts
: Imported additional necessary modules (ModelSource
,ModelSibling
,Model
,ModelEvent
) to support the new functionalities.web/screens/Settings/Engines/RemoteEngineSettings.tsx
: Imported theModalAddModel
component to be used in the settings screen.