From 6c83a770792bda6749271b043476c4399d98c4fd Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 24 Apr 2025 22:09:02 -0700 Subject: [PATCH] Tweak ollama timeout, prompt [ci skip] --- src/paperless/ai/ai_classifier.py | 4 ++-- src/paperless/ai/client.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/paperless/ai/ai_classifier.py b/src/paperless/ai/ai_classifier.py index f52548b62..704b894a4 100644 --- a/src/paperless/ai/ai_classifier.py +++ b/src/paperless/ai/ai_classifier.py @@ -62,14 +62,14 @@ def build_prompt_with_rag(document: Document) -> str: Only output valid JSON in the format below. No additional explanations. The JSON object must contain: - - title: A short, descriptive title based on the content + - title: A short, human-readable, descriptive title based on the content - tags: A list of relevant topics - correspondents: People or organizations involved - document_types: Type or category of the document - storage_paths: Suggested folder paths - dates: Up to 3 relevant dates in YYYY-MM-DD - Here is an example document: + Here is the document: FILENAME: {filename} diff --git a/src/paperless/ai/client.py b/src/paperless/ai/client.py index d37468b4e..514605e91 100644 --- a/src/paperless/ai/client.py +++ b/src/paperless/ai/client.py @@ -35,7 +35,7 @@ class AIClient: def _run_ollama_query(self, prompt: str) -> str: url = self.settings.llm_url or "http://localhost:11434" - with httpx.Client(timeout=30.0) as client: + with httpx.Client(timeout=60.0) as client: response = client.post( f"{url}/api/generate", json={