]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Tweak ollama timeout, prompt
authorshamoon <4887959+shamoon@users.noreply.github.com>
Fri, 25 Apr 2025 05:09:02 +0000 (22:09 -0700)
committershamoon <4887959+shamoon@users.noreply.github.com>
Wed, 2 Jul 2025 18:01:54 +0000 (11:01 -0700)
[ci skip]

src/paperless/ai/ai_classifier.py
src/paperless/ai/client.py

index f52548b6258e89eebd53a1472204d2572107408e..704b894a4bc937ba385a83bd68295b135f14a324 100644 (file)
@@ -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}
 
index d37468b4e3e3421d7a297f9fefbd2264e13cd6ad..514605e91ddfd77daf9e1c3cea286c1820fd0ad8 100644 (file)
@@ -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={