Commit graph

6 commits

Author SHA1 Message Date
Dominik Schröter
91da6eff80 feat: add correspondent management and update related components 2025-01-13 15:33:42 +01:00
Dominik Schröter
515b78b6a1 Merge branch 'main' into correspondents 2025-01-13 14:23:39 +01:00
Icereed
e144661dfb
Add RemoveTags field to DocumentSuggestion for explicit tag removal (#118)
* feat: add functionality to manage suggested and removable tags in document suggestions

* feat: process multiple documents for auto-tagging and OCR
2025-01-13 09:52:56 +00:00
Jonas Hess
16281be6d3 feat: auto create missing correspondents 2024-11-01 01:15:34 +01:00
Icereed
03364f2741
OCR via LLM (#29) 2024-10-28 17:34:41 +01:00
Dominik Schröter
6410136f89 feat: add support for customizable server-side prompts
- **Custom Prompt Templates**: Introduced support for user-modifiable prompt templates using Go's `text/template`.
  - Added default prompt templates for title and tag generation.
  - Templates are stored in the `prompts` directory and are loaded at startup.
  - If the template files do not exist, they are created with default content.
  - Users can modify the templates by editing the files in the `prompts` directory.
- **API Endpoints for Prompts**:
  - Added `GET /api/prompts` endpoint to retrieve the current prompt templates.
  - Added `POST /api/prompts` endpoint to update the prompt templates.
  - These endpoints prepare for future UI support for modifying prompts.
- **Thread Safety**:
  - Implemented a `sync.RWMutex` to ensure thread-safe access to the templates.
- **Updated Backend Logic**:
  - Modified `getSuggestedTitle` and `getSuggestedTags` functions to use the loaded templates.
  - Templates utilize variables like `{{.Language}}`, `{{.Content}}`, `{{.AvailableTags}}`, and `{{.Title}}`.
- **Docker and Documentation**:
  - Updated the `loadTemplates` function to ensure the `prompts` directory exists and to save default templates if missing.
  - Updated the README with instructions on how to mount the `prompts` directory in Docker and Docker Compose.
  - Provided guidance on modifying the prompt templates via file edits.
2024-10-16 14:57:14 +02:00