From 17dd2d11c981f15096808cceeb27cca893b0f529 Mon Sep 17 00:00:00 2001 From: Ethan J Lewis Date: Tue, 14 Apr 2026 21:35:12 -0500 Subject: [PATCH] change response to text format --- tag-notes.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tag-notes.py b/tag-notes.py index 612629f..698be6d 100755 --- a/tag-notes.py +++ b/tag-notes.py @@ -98,11 +98,14 @@ def call_llm_json(system_prompt, user_prompt, max_tokens=900): ], "temperature": 0.2, "max_tokens": max_tokens, - "response_format": {"type": "json_object"}, + "response_format": {"type": "text"}, } try: response = requests.post(LM_STUDIO_URL, json=payload, timeout=120) - response.raise_for_status() + if not response.ok: + print(f" ! LLM error: {response.status_code} {response.reason}") + print(f" body: {response.text[:500]}") + return None result = response.json() content = result['choices'][0]['message']['content'] return parse_json_response(content)