Skip to content

Commit

Permalink
Remove automatic document extraction on model from equations (#5828)
Browse files Browse the repository at this point in the history
  • Loading branch information
YohannParis authored Dec 13, 2024
1 parent 1c94a3c commit 5995426
Showing 1 changed file with 0 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
import software.uncharted.terarium.hmiserver.security.Roles;
import software.uncharted.terarium.hmiserver.service.ClientEventService;
import software.uncharted.terarium.hmiserver.service.CurrentUserService;
import software.uncharted.terarium.hmiserver.service.EnrichmentService;
import software.uncharted.terarium.hmiserver.service.ExtractionService;
import software.uncharted.terarium.hmiserver.service.data.CodeService;
import software.uncharted.terarium.hmiserver.service.data.DatasetService;
Expand Down Expand Up @@ -108,7 +107,6 @@ public class KnowledgeController {
private final CodeService codeService;

private final ExtractionService extractionService;
private final EnrichmentService enrichmentService;
private final TaskService taskService;

private final ProjectService projectService;
Expand Down Expand Up @@ -341,41 +339,6 @@ public ResponseEntity<UUID> equationsToModel(
notificationInterface.sendMessage("Model updated.");
}

// Enrich the model asynchronously if a document ID was provided
if (documentId != null) {
// Get the Document
final DocumentAsset document = documentService
.getAsset(documentId, permission)
.orElseThrow(() ->
new ResponseStatusException(
HttpStatus.NOT_FOUND,
messages.get("An error occurred while trying to get the document.")
)
);

// Make sure there is text in the document
if (document.getText() != null && !document.getText().isBlank()) {
notificationInterface.sendMessage("Document text found.");

// Do the enrichment
enrichmentService.modelWithDocument(
projectId,
document,
model,
currentUserService.get().getId(),
permission,
notificationInterface
);
} else {
final String documentTextNotFoundMessage = String.format(
"Document text not found. Please try enriching the model when the document %s extraction is done",
document.getName()
);
notificationInterface.sendMessage(documentTextNotFoundMessage);
log.info(documentTextNotFoundMessage);
}
}

notificationInterface.sendFinalMessage("Model from equations done.");

// Return the model id
Expand Down

0 comments on commit 5995426

Please sign in to comment.