Commit graph

15 commits

Author SHA1 Message Date
Dominik Schröter
f65241fc8b Early working UI protyping + jobs engine 2024-10-28 15:25:20 +01:00
Dominik Schröter
b607815803 Play around with ollama and minicpm-v 2024-10-28 15:25:20 +01:00
Jonas Hess
e62c5442f5 feat: Add exponential backoff for auto processing 2024-10-22 06:38:25 +02:00
Dominik Schröter
4abd5cc13c Refactor paperless client and app structure 2024-10-21 21:52:23 +02:00
Jonas Hess
95c9d1bdb5 feat: Add background routine to process documents with autoTag every 10 seconds
- Spawn a new goroutine in the `main` function to process documents with the `autoTag` every 10 seconds.
- Implement `processAutoTagDocuments` function to:
  - Fetch documents with the `autoTag`.
  - Generate suggestions using the LLM.
  - Apply the suggestions to the documents.
  - Remove the `autoTag` from the documents.
- Add logging for each document being processed.
2024-10-21 21:34:48 +02:00
Jonas Hess
83088e1e15
Specific error messages for missing environment variables (#21) 2024-10-21 09:56:49 +02: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
Dominik Schröter
0dd1d0b5ad Fix tags API pagination 2024-10-16 14:47:50 +02:00
Dominik Schröter
aa67b2443a Able to apply empty tags 2024-10-07 20:51:28 +02:00
Dominik Schröter
51bf716854 Redesign for optional titles or tags 2024-10-07 13:50:01 +02:00
Icereed
c7b5c6a060
Enhance UX for tag selection (#5)
Fixes #1
2024-10-04 13:05:02 +02:00
Dominik Schröter
4ba0b36be7 Refactor getSuggestedTags function to filter out tags not in the available tags list 2024-09-24 09:18:50 +02:00
Dominik Schröter
12e6acd5a9 Refactor LLM provider configuration to support custom server URL 2024-09-24 09:18:33 +02:00
Dominik Schröter
26a160209f Initial support for auto-tagging 2024-09-23 17:08:36 +02:00
Dominik Schröter
833bd9b1b7 Publish paperless-gpt 2024-09-23 14:59:50 +02:00