Skip to content

Commit

Permalink
Update spread order (onyx-dot-app#2386)
Browse files Browse the repository at this point in the history
* update spread

* update
  • Loading branch information
pablonyx authored and rajiv chodisetti committed Oct 2, 2024
1 parent 9853347 commit fa1eb2b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions web/src/app/admin/embeddings/pages/EmbeddingFormPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,13 @@ export default function EmbeddingForm() {
}
let newModel: SavedSearchSettings;

// We use a spread operation to merge properties from multiple objects into a single object.
// Advanced embedding details may update default values.
if (selectedProvider.provider_type != null) {
// This is a cloud model
newModel = {
...advancedEmbeddingDetails,
...selectedProvider,
...rerankingDetails,
...advancedEmbeddingDetails,
model_name: selectedProvider.model_name,
provider_type:
(selectedProvider.provider_type
Expand All @@ -206,9 +207,9 @@ export default function EmbeddingForm() {
} else {
// This is a locally hosted model
newModel = {
...advancedEmbeddingDetails,
...selectedProvider,
...rerankingDetails,
...advancedEmbeddingDetails,
model_name: selectedProvider.model_name!,
provider_type: null,
};
Expand All @@ -225,6 +226,7 @@ export default function EmbeddingForm() {
},
}
);

if (response.ok) {
setPopup({
message: "Changed provider suceessfully. Redirecing to embedding page",
Expand Down

0 comments on commit fa1eb2b

Please sign in to comment.