0ddae4f91e
remove query from codebase part 1 * remove query * fix localstack run
31 lines
732 B
Go
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
|
|
}
|