diff --git a/chat.cfm b/chat.cfm index 22dc1ce..f332eec 100644 --- a/chat.cfm +++ b/chat.cfm @@ -15,14 +15,12 @@ - + - SELECT d.filename, sr.row_num, sr.name, sr.price, sr.qty, sr.sum, sr.date_start - FROM spec_rows sr - JOIN supplements s ON sr.supplement_id = s.id - JOIN documents d ON s.document_id = d.id - WHERE s.contract_id = - ORDER BY s.created_at, sr.row_num + SELECT name, price, qty, sum, date_start + FROM spec_current + WHERE contract_id = + ORDER BY name @@ -32,7 +30,7 @@ - + dict | None: - """Получить активный промпт из БД. Возвращает {id, body} или None.""" + """Получить активный промпт из БД напрямую (а не через Lucee HTTP).""" try: - with httpx.Client(http2=True, timeout=10) as client: - resp = client.get( - f"{LUCEE_URL}/prompt.cfm", - params={"action": "get_active", "role": role}, - ) - resp.raise_for_status() - data = resp.json() - # Lucee serializeJSON → UPPERCASE keys, normalize to lowercase - data = {k.lower(): v for k, v in data.items()} - if data.get("ok") and data.get("body"): - return {"id": data.get("id", ""), "body": data["body"]} + row = db_prompts.get_active(role) + if row and row.get("body"): + return {"id": row.get("id", ""), "body": row["body"]} except Exception: pass return None diff --git a/deploy/services/llm.py b/deploy/services/llm.py index b88351d..abf73c1 100644 --- a/deploy/services/llm.py +++ b/deploy/services/llm.py @@ -16,7 +16,7 @@ def call_llm(current_spec, doc_text, build_prompt_fn): "max_tokens": 8000, "temperature": 0.1, } - with httpx.Client(http2=True, timeout=120, verify=False) as client: + with httpx.Client(http2=True, timeout=120, verify=True) as client: resp = client.post( LLM_URL, json=payload,