diff --git a/pebblo/app/api/req_models.py b/pebblo/app/api/req_models.py index 0e4cfab1..dc5c2bc1 100644 --- a/pebblo/app/api/req_models.py +++ b/pebblo/app/api/req_models.py @@ -52,7 +52,7 @@ class ReqDiscover(BaseModel): framework: Framework chains: Optional[List[ChainInfo]] = None plugin_version: str - client_version: Framework + client_version: Optional[Framework] = None class ReqLoaderDoc(BaseModel): diff --git a/pebblo/app/models/db_models.py b/pebblo/app/models/db_models.py index eb85df62..ed9dce0e 100644 --- a/pebblo/app/models/db_models.py +++ b/pebblo/app/models/db_models.py @@ -46,6 +46,7 @@ class AiBaseApp(BaseModel): ] = [] # list of policy id, title and other details pebbloServerVersion: Optional[str] = None pebbloClientVersion: Optional[str] = None + clientVersion: Optional[FrameworkInfo] = None model_config = ConfigDict(arbitrary_types_allowed=True, use_enum_values=True) diff --git a/pebblo/app/service/discovery/discovery_service.py b/pebblo/app/service/discovery/discovery_service.py index 9f575969..04b4df07 100644 --- a/pebblo/app/service/discovery/discovery_service.py +++ b/pebblo/app/service/discovery/discovery_service.py @@ -72,10 +72,12 @@ def create_app_obj( current_time = get_current_time() metadata = Metadata(createdAt=current_time, modifiedAt=current_time) - client_version = FrameworkInfo( - name=self.data.get("client_version", {}).get("name"), - version=self.data.get("client_version", {}).get("version"), - ) + client_version = None + if self.data.get("client_version"): + client_version = FrameworkInfo( + name=self.data.get("client_version", {}).get("name"), + version=self.data.get("client_version", {}).get("version"), + ) ai_app_obj = { "metadata": metadata, "description": self.data.get("description", "-"), diff --git a/pebblo/app/service/discovery_service.py b/pebblo/app/service/discovery_service.py index 7f66cda7..0727cf5b 100644 --- a/pebblo/app/service/discovery_service.py +++ b/pebblo/app/service/discovery_service.py @@ -64,10 +64,12 @@ def _create_ai_apps_model( createdAt=self._get_current_datetime(), modifiedAt=self._get_current_datetime(), ) - client_version = FrameworkInfo( - name=self.data.get("client_version", {}).get("name"), - version=self.data.get("client_version", {}).get("version"), - ) + client_version = None + if self.data.get("client_version"): + client_version = FrameworkInfo( + name=self.data.get("client_version", {}).get("name"), + version=self.data.get("client_version", {}).get("version"), + ) ai_apps_model = AiApp( metadata=metadata, name=self.data.get("name"),