Refactor AI summarization functionality by removing document summarization worker
continuous-integration/drone/push Build is passing

- Removed the DocumentSummarizationWorker and its related scheduling logic from the worker bootstrap.
- Updated the AI summarizer client initialization comment for clarity.
- Added a new error type for cases when tender documents have not been scraped yet, enhancing error handling in the tender service.
- Modified API documentation to reflect changes in AI summary retrieval logic, ensuring accurate descriptions of on-demand summarization behavior.

This update streamlines the AI summarization process by eliminating the document summarization worker, improving overall system efficiency and clarity in error handling.
This commit is contained in:
Mazyar
2026-06-21 11:20:28 +03:30
parent e31bccced6
commit e04cdd1d10
6 changed files with 163 additions and 302 deletions
+4 -2
View File
@@ -537,7 +537,7 @@ func (h *TenderHandler) streamDocumentDownload(c echo.Context, tenderID, filenam
// GetAISummary retrieves the AI-generated overall summary for a tender
// @Summary Get AI-generated tender summary
// @Description Retrieve the AI-generated overall summary for a tender from the AI pipeline storage
// @Description Retrieve the AI-generated overall summary for a tender. When documents are scraped but no summary exists yet, on-demand summarization is triggered automatically.
// @Tags Admin-Tenders
// @Produce json
// @Param id path string true "Tender ID"
@@ -637,6 +637,8 @@ func mapAITriggerHTTPError(c echo.Context, err error, action string) error {
return response.NotFound(c, "Tender not found")
case errors.Is(err, ErrTenderMissingNoticeID), errors.Is(err, ErrTenderMissingContractFolderID):
return response.BadRequest(c, "Tender not eligible", "Tender is missing required identifiers for AI processing")
case errors.Is(err, ErrTenderDocumentsNotScraped):
return response.BadRequest(c, "Tender not eligible", "Tender documents have not been scraped yet")
case errors.Is(err, ErrAINotConfigured):
return response.InternalServerError(c, "AI service is not available")
default:
@@ -683,7 +685,7 @@ func (h *TenderHandler) TriggerAITranslate(c echo.Context) error {
// GetPublicAISummary retrieves the AI-generated overall summary for a tender (public endpoint)
// @Summary Get AI-generated tender summary (public)
// @Description Retrieve the AI-generated overall summary for a tender from the AI pipeline storage
// @Description Retrieve the AI-generated overall summary for a tender. When documents are scraped but no summary exists yet, on-demand summarization is triggered automatically.
// @Tags Tenders
// @Produce json
// @Param id path string true "Tender ID"