mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-05-23 12:58:18 -05:00
Tweak ollama timeout, prompt
[ci skip]
This commit is contained in:
parent
422efb2235
commit
6c83a77079
@ -62,14 +62,14 @@ def build_prompt_with_rag(document: Document) -> str:
|
|||||||
Only output valid JSON in the format below. No additional explanations.
|
Only output valid JSON in the format below. No additional explanations.
|
||||||
|
|
||||||
The JSON object must contain:
|
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
|
- tags: A list of relevant topics
|
||||||
- correspondents: People or organizations involved
|
- correspondents: People or organizations involved
|
||||||
- document_types: Type or category of the document
|
- document_types: Type or category of the document
|
||||||
- storage_paths: Suggested folder paths
|
- storage_paths: Suggested folder paths
|
||||||
- dates: Up to 3 relevant dates in YYYY-MM-DD
|
- dates: Up to 3 relevant dates in YYYY-MM-DD
|
||||||
|
|
||||||
Here is an example document:
|
Here is the document:
|
||||||
FILENAME:
|
FILENAME:
|
||||||
{filename}
|
{filename}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ class AIClient:
|
|||||||
|
|
||||||
def _run_ollama_query(self, prompt: str) -> str:
|
def _run_ollama_query(self, prompt: str) -> str:
|
||||||
url = self.settings.llm_url or "http://localhost:11434"
|
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(
|
response = client.post(
|
||||||
f"{url}/api/generate",
|
f"{url}/api/generate",
|
||||||
json={
|
json={
|
||||||
|
Loading…
x
Reference in New Issue
Block a user