fix: embedding batch sizing and 413 error classification (1.7.4)

- Add batching to generate_embeddings() (50 texts per batch with per-batch retry)
  to prevent 413 Payload Too Large errors on large documents
- Add 413 error classification rule for user-friendly error messages
- Fix misleading "Created 0 embedded chunks" log in process_source_command
  by removing premature get_embedded_chunks() call (embedding is fire-and-forget)

Closes #594
This commit is contained in:
Luis Novo 2026-02-18 11:39:47 -03:00
parent 924cd88494
commit 5d84ab0768
12 changed files with 190 additions and 37 deletions

View file

@ -78,7 +78,7 @@ Note: Changes require restart of the application.
### embedding.py
- **mean_pool_embeddings(embeddings)**: Combine multiple embeddings via normalized mean pooling
- **generate_embeddings(texts)**: Batch embedding via single Esperanto API call
- **generate_embeddings(texts)**: Batch embedding with automatic batching (default 50 texts per batch) and per-batch retry
- **generate_embedding(text, content_type, file_path)**: Unified embedding with automatic chunking + mean pooling
**Key behavior**: