Remote Copilot models (italdesign BYOK + AI credits) for shots/report

This commit is contained in:
Stefano Zini
2026-11-03 16:55:59 +01:00
parent f855768f1f
commit ca4a61d17e
6 changed files with 62 additions and 25 deletions
+2 -3
View File
@@ -1,9 +1,8 @@
"""Find related Confluence/Jira docs for a meeting via twg; writes out/<name>/docs.json. Never fails the flow."""
import json, os, re, shutil, subprocess
import db, report
import db, llama, report
TWG = shutil.which("twg") or os.path.expandvars(r"%LOCALAPPDATA%\Programs\twg\bin\twg.exe")
PROXY = "http://zproxy.idg.audi.vwg:9400"
SYS_Q = 'Genera query di ricerca per trovare documentazione aziendale (Confluence/Jira) collegata a questa riunione. Rispondi SOLO JSON: {"queries":[str]} con 4 query brevi (3-6 parole) usando i termini come appaiono nel testo.'
SYS_R = 'Valuta la pertinenza di ogni documento rispetto alla riunione descritta. Rispondi SOLO JSON: {"scores":[{"i":int,"score":int}]} con score 0 (non pertinente) … 3 (stesso argomento/progetto).'
KEY = re.compile(r"^[A-Z][A-Z0-9]{1,9}-\d{1,6}$")
@@ -23,7 +22,7 @@ def _twg(*args, timeout=120):
except (OSError, ValueError): pass
else: out = r.stdout if r.returncode == 0 else None
if out is not None or attempt or not re.search(r"(?i)ECONN|ETIMEDOUT|network|certificate|proxy", r.stderr): return out
env = {**env, "HTTPS_PROXY": PROXY, "HTTP_PROXY": PROXY}
env = {**env, "HTTPS_PROXY": llama.PROXY, "HTTP_PROXY": llama.PROXY}
def _run(name):