diff --git a/src/main/java/org/cftoolsuite/client/SanfordClient.java b/src/main/java/org/cftoolsuite/client/SanfordClient.java index 008b6e0..eec1128 100644 --- a/src/main/java/org/cftoolsuite/client/SanfordClient.java +++ b/src/main/java/org/cftoolsuite/client/SanfordClient.java @@ -23,16 +23,16 @@ public interface SanfordClient { ResponseEntity uploadFile(@RequestPart("fileName") MultipartFile file); @PostMapping("/api/crawl") - public ResponseEntity startCrawl(@RequestBody CrawlRequest crawlRequest); + ResponseEntity startCrawl(@RequestBody CrawlRequest crawlRequest); @PostMapping("/api/fetch") - public ResponseEntity fetchUrls(@RequestBody FetchRequest request); + ResponseEntity fetchUrls(@RequestBody FetchRequest request); @PostMapping(value = "/api/converse", consumes = MediaType.APPLICATION_OCTET_STREAM_VALUE) - public ResponseEntity converse(@RequestBody byte[] audioBytes); + ResponseEntity converse(@RequestBody byte[] audioBytes); @PostMapping("/api/chat") - public ResponseEntity chat(@RequestBody Inquiry inquiry); + ResponseEntity chat(@RequestBody Inquiry inquiry); @GetMapping(value = "/api/files", produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity> getFileMetadata(@RequestParam(value = "fileName", required = false) String fileName); diff --git a/src/main/java/org/cftoolsuite/client/SanfordStreamingClient.java b/src/main/java/org/cftoolsuite/client/SanfordStreamingClient.java index 9450e0f..4a73f6a 100644 --- a/src/main/java/org/cftoolsuite/client/SanfordStreamingClient.java +++ b/src/main/java/org/cftoolsuite/client/SanfordStreamingClient.java @@ -10,6 +10,6 @@ public interface SanfordStreamingClient { @PostMapping("/api/stream/chat") - public Flux streamResponseToQuestion(@RequestBody Inquiry inquiry); + Flux streamResponseToQuestion(@RequestBody Inquiry inquiry); } diff --git a/src/main/java/org/cftoolsuite/ui/view/ConverseView.java b/src/main/java/org/cftoolsuite/ui/view/ConverseView.java index ee0fbba..2701424 100644 --- a/src/main/java/org/cftoolsuite/ui/view/ConverseView.java +++ b/src/main/java/org/cftoolsuite/ui/view/ConverseView.java @@ -38,8 +38,8 @@ public ConverseView(SanfordClient sanfordClient, AppProperties appProperties) { @Override protected void setupUI() { + addClassName("box-border"); - setAlignItems(Alignment.CENTER); setSpacing(true); setPadding(true); diff --git a/src/main/java/org/cftoolsuite/ui/view/SummarizeView.java b/src/main/java/org/cftoolsuite/ui/view/SummarizeView.java index dd35b55..adb574e 100644 --- a/src/main/java/org/cftoolsuite/ui/view/SummarizeView.java +++ b/src/main/java/org/cftoolsuite/ui/view/SummarizeView.java @@ -63,12 +63,13 @@ protected void setupUI() { protected void summarizeRequest() { try { - ResponseEntity response = sanfordClient.summarize(fileName.getValue()); + String title = fileName.getValue(); + ResponseEntity response = sanfordClient.summarize(title); if (response.getStatusCode().is2xxSuccessful() && response.getBody() != null) { Dialog summaryDialog = new Dialog(); summaryDialog.setWidth("800px"); - H3 title = new H3("Summary for " + fileName); + H3 heading = new H3(String.format("Summary for %s", title)); Div contentWrapper = new Div(); contentWrapper.setWidthFull(); @@ -86,7 +87,7 @@ protected void summarizeRequest() { buttonLayout.setJustifyContentMode(JustifyContentMode.END); buttonLayout.setWidthFull(); - VerticalLayout layout = new VerticalLayout(title, contentWrapper, buttonLayout); + VerticalLayout layout = new VerticalLayout(heading, contentWrapper, buttonLayout); summaryDialog.add(layout); summaryDialog.open(); } else {