Untitled
def run(self) -> PickingForItemGroupsResponse: """ Run the model to process the request and generate a response. :return: PickingForItemGroupsResponse containing the processed collate groups. """ ctx = PickingForItemGroupsContext( center_id=self.req.context.centerId, group_id="MOCK_GROUP", timestamp=int(datetime.now().timestamp() * 1000), ) centerConfig = self.s2r_config.get(str(ctx.center_id)) if centerConfig is None: raise ValueError(f"Can't find config file for center: {ctx.center_id}") processor = PickRequestProcessor(config={**self.app_config, **centerConfig}, ctx=ctx) processor.init_with_request(request=self.req) processor.prepare_model_input() self.logger.info(f"Passing algorithm parameter: {self.algorithm_parameters.__dict__} to the model.") result = processor.solve_stream_to_rebin(self.algorithm_parameters) return self.wire_response(result)
Leave a Comment