Commit graph

5 commits

Author SHA1 Message Date
Icereed
abeab949a1
refactor(api): simplify response structures for GetDocuments and GetD… (#199)
* refactor(api): simplify response structures for GetDocuments and GetDocument endpoints

Closes #198

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-02-07 15:47:40 +00:00
Icereed
e661989829
LLM powered Correspondents handling (#89)
---------

Co-authored-by: Jonas Hess <Jonas@Hess.pm>
2025-01-13 15:59:29 +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
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