Files
query-orchestration/internal/document/text/extract.go
T
Jay Brown 0ddae4f91e Merged in feature/remove-query (pull request #201)
remove query from codebase part 1

* remove query

* fix localstack run
2026-01-14 17:59:04 +00:00

31 lines
732 B
Go

package documenttext
import (
"context"
"log/slog"
"github.com/google/uuid"
)
// Extract extracts text from a document using AWS Textract.
// This is the terminal step in the document processing pipeline.
// Query processing has been removed - pipeline ends after text extraction.
func (s *Service) Extract(ctx context.Context, documentId uuid.UUID) error {
slog.Debug("extracting document text", "id", documentId.String())
isextracted, err := s.cfg.GetDBQueries().IsDocumentTextExtracted(ctx, documentId)
if err != nil {
return err
}
if !isextracted {
err = s.executeExtraction(ctx, documentId)
if err != nil {
return err
}
}
// Pipeline terminates here - query processing has been removed
return nil
}