Skip to content

Commit 0beecae

Browse files
committed
fix: stricten generation
1 parent 1858925 commit 0beecae

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ol1/app.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ def make_api_call(messages, max_tokens, is_final_answer=False):
4141
"options": parse_options(OLLAMA_OPTIONS),
4242
})
4343
response.raise_for_status()
44-
return json.loads(response.json()["message"]["content"])
44+
data = json.loads(response.json()["message"]["content"])
45+
if "title" not in data or "content" not in data:
46+
raise ValueError("Response JSON is missing 'title' or 'content' fields.")
47+
return data
4548

4649
except Exception as e:
4750
if attempt == 2:

profiles/default.env

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ HARBOR_JUPYTER_EXTRA_DEPS=""
305305
# ol1
306306
HARBOR_OL1_HOST_PORT=34111
307307
HARBOR_OL1_MODEL="llama3.1:8b"
308-
HARBOR_OL1_ARGS="temperature=0.1"
308+
HARBOR_OL1_ARGS="temperature=0.2"
309309

310310
# ============================================
311311
# Service Configuration.

0 commit comments

Comments
 (0)