From f38c4aef1986ef0e4069233af2ea1d9a925eb4e9 Mon Sep 17 00:00:00 2001 From: Kalki <97698934+jedan2506@users.noreply.github.com> Date: Fri, 8 Sep 2023 17:08:21 +0530 Subject: [PATCH] Models marketplace updates (#1214) Model marketplace loader --- gui/pages/Content/Models/MarketModels.js | 11 ++++++++--- gui/pages/Content/Models/ModelTemplate.js | 17 +++++++++++++++-- superagi/controllers/models_controller.py | 4 +++- superagi/controllers/types/models_types.py | 14 ++++++++++++++ superagi/models/models.py | 9 ++++++--- 5 files changed, 46 insertions(+), 9 deletions(-) create mode 100644 superagi/controllers/types/models_types.py diff --git a/gui/pages/Content/Models/MarketModels.js b/gui/pages/Content/Models/MarketModels.js index 578eed96b..383b48be7 100644 --- a/gui/pages/Content/Models/MarketModels.js +++ b/gui/pages/Content/Models/MarketModels.js @@ -18,18 +18,23 @@ export default function MarketModels(){ if (window.location.href.toLowerCase().includes('marketplace')) { axios.get('https://app.superagi.com/api/models_controller/get/models_details') .then((response) => { - console.log(response.data) setModelTemplates(response.data) }) } else { fetchMarketPlaceModel().then((response) => { - console.log(response.data) setModelTemplates(response.data) }) } },[]) + useEffect(() => { + if(modelTemplates.length > 0) + setIsLoading(true) + else + setIsLoading(false) + }, [modelTemplates]) + function handleTemplateClick(item) { const contentType = 'model_template'; EventBus.emit('openTemplateDetails', {item, contentType}); @@ -38,7 +43,7 @@ export default function MarketModels(){ return(