Files
tm_back/pkg/ai_summarizer/errors.go
T
Mazyar dcf19b91cd Implement AI pipeline operations in the admin API
- Added new routes and handlers for AI pipeline operations, including scraping documents, batch summarization, translation, and syncing with the Opplens AI service.
- Introduced request forms for handling tender references and batch operations.
- Enhanced the AI service with methods for triggering batch operations and managing pipeline runs.
- Updated Swagger documentation to reflect the new AI pipeline endpoints and their functionalities.

This update integrates comprehensive AI pipeline capabilities into the tender management system, improving operational efficiency and user experience.
2026-06-14 12:54:13 +03:30

40 lines
1.8 KiB
Go

package ai_summarizer
import "errors"
// Common sentinel errors for the AI summarizer package.
var (
// ErrSummaryNotReady is returned when the tender.json exists but
// summarize_status.done is still false.
ErrSummaryNotReady = errors.New("ai_summarizer: summary not ready yet")
// ErrNoOverallSummary is returned when the pipeline is done but
// summary / overall_summary text is empty.
ErrNoOverallSummary = errors.New("ai_summarizer: tender summary is empty")
// ErrTranslationNotReady is returned when tender.json exists but the
// requested language is not listed in translation_status.done yet.
ErrTranslationNotReady = errors.New("ai_summarizer: translation not ready yet")
// ErrNoTranslation is returned when translation_status marks a language done
// but translations[language] is missing or empty.
ErrNoTranslation = errors.New("ai_summarizer: translation is empty")
// ErrObjectNotFound is returned when the tender.json object does not
// exist in the MinIO bucket (HTTP 404 / NoSuchKey).
ErrObjectNotFound = errors.New("ai_summarizer: tender.json not found in storage")
// ErrBucketNotFound is returned when the MinIO bucket does not exist.
ErrBucketNotFound = errors.New("ai_summarizer: bucket not found")
// ErrMinIOUnavailable is returned when MinIO cannot be reached (network,
// timeout, connection refused, etc.) as opposed to a missing object key.
ErrMinIOUnavailable = errors.New("ai_summarizer: MinIO connection unavailable")
// ErrAPINonSuccess is returned when the AI API returns a non-2xx status code.
ErrAPINonSuccess = errors.New("ai_summarizer: API returned non-success status")
// ErrPipelineJobRunning is returned when a single-flight pipeline job is already running (HTTP 409).
ErrPipelineJobRunning = errors.New("ai_summarizer: pipeline job already running")
)