@Test void explainServiceFail() { String unknownwResourceId = "unknown:model"; PredictInput input = createInput(10); input.getModelIdentifier().setResourceId(unknownwResourceId); ResponseEntity<Object> responseEntity = resource.predict(singletonList(input)); assertEquals(HttpStatus.BAD_REQUEST, responseEntity.getStatusCode()); assertEquals("Model " + unknownwResourceId + " not found.", responseEntity.getBody()); }
@PostMapping(produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Object> predict(List<PredictInput> inputs) { try { return ResponseEntity.ok(explainabilityService.processRequest(application, inputs)); } catch (Exception e) { LOGGER.warn("An Exception occurred processing the predict request", e); return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(e.getMessage()); } }
SpringBootExplainableResource { @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Object> predict(List<PredictInput> inputs) { try { return ResponseEntity.ok(explainabilityService.processRequest(application, inputs)); } catch (Exception e) { LOGGER.warn("An Exception occurred processing the predict request", e); return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(e.getMessage()); } } }
SpringBootExplainableResource { @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Object> predict(List<PredictInput> inputs) { try { return ResponseEntity.ok(explainabilityService.processRequest(application, inputs)); } catch (Exception e) { LOGGER.warn("An Exception occurred processing the predict request", e); return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(e.getMessage()); } } @Autowired  SpringBootExplainableResource(Application application); }
SpringBootExplainableResource { @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Object> predict(List<PredictInput> inputs) { try { return ResponseEntity.ok(explainabilityService.processRequest(application, inputs)); } catch (Exception e) { LOGGER.warn("An Exception occurred processing the predict request", e); return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(e.getMessage()); } } @Autowired  SpringBootExplainableResource(Application application); @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> predict(List<PredictInput> inputs); }
SpringBootExplainableResource { @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Object> predict(List<PredictInput> inputs) { try { return ResponseEntity.ok(explainabilityService.processRequest(application, inputs)); } catch (Exception e) { LOGGER.warn("An Exception occurred processing the predict request", e); return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(e.getMessage()); } } @Autowired  SpringBootExplainableResource(Application application); @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Object> predict(List<PredictInput> inputs);  }