about summary refs log tree commit diff
path: root/nltk
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-10-19 08:24:44 +0000
committerPjotr <wrk@bosa.lan>2026-10-19 08:30:00 +0000
commitc8321ee72c088d6769b335c10229c5fb1d7d8209 (patch)
tree6e587ada93ed66e8d97c7663e5d6f828cfe09f7a /nltk
parentc01411e98a0d3a5671ee6914c844215ce578efe5 (diff)
downloadgenecup-master.tar.gz
server: say why Gemini classification is not available HEAD master
The stress view collapsed three very different failures into one heading,
"All related sentences (Gemini classification not available or no
specific stress types found)", so a key that lists a model but may not
call it, a missing key file and a model that returned no usable labels
all looked alike -- and looked like "nothing to classify" rather than an
error.

Track the outcome as gemini_kind (no-key / error / no-labels) and say
which one it was, on the page and in the log:

- no-key: "no API key at ~/.config/gemini/credentials (missing,
  unreadable or not mode 0400)"; heading "... (not classified: no
  Gemini API key)".
- error: the exception type and text, the model and the attempt count,
  plus where the full request/response/traceback is
  (/var/log/genecup.log) and where the container's boot-time key and
  model check is (/var/log/gemini-check.log); heading "... (classification
  failed, listed unclassified)".
- no-labels: the model answered but no Cellular Stress / Organismal
  Stress label came back, quoting the raw response; heading "... (no
  Cellular/Organismal labels returned, listed unclassified)".

Also: the model is a single GEMINI_MODEL constant (kept in sync with
the container's boot check), non-JSON replies raise a RuntimeError that
quotes what came back instead of a bare JSONDecodeError, every retry
logs the exception type, the final failure logs the traceback, and the
number of labelled sentences is logged per request.

Checked in a container against the live API: a good key classifies, a
missing key file reports no-key, and a bogus key reports
"gemini-3-flash-preview call failed after 3 attempts (ClientError): 400
INVALID_ARGUMENT ... API key not valid".
Diffstat (limited to 'nltk')
0 files changed, 0 insertions, 0 deletions