2 Commits
Author SHA1 Message Date
adamfandClaude Opus 5.5 d0ff2e125b Format claude.py
Test and deploy / deploy (push) Has been cancelled
Test and deploy / test (push) Has been cancelled
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 14:17:38 +00:00
adamfandClaude Opus 5.5 705804c503 Renovate: also update stppriv
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 14:17:38 +00:00
2 changed files with 17 additions and 5 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ jobs:
-e RENOVATE_PLATFORM=gitea \
-e RENOVATE_ENDPOINT=http://git.adam-french.co.uk:3000/api/v1 \
-e RENOVATE_GIT_URL=endpoint \
-e RENOVATE_REPOSITORIES=adamf/stpweb,adamf/stpgit \
-e RENOVATE_REPOSITORIES=adamf/stpweb,adamf/stpgit,adamf/stppriv \
-e RENOVATE_TOKEN \
-e GITHUB_COM_TOKEN \
-e LOG_LEVEL=info \
+16 -4
View File
@@ -82,7 +82,10 @@ def _model_options(model: str, max_tokens: int) -> dict:
"""
if model.startswith(_NO_EFFORT_PREFIXES):
return {"max_tokens": max_tokens}
return {"max_tokens": max_tokens + THINKING_HEADROOM, "output_config": {"effort": EFFORT}}
return {
"max_tokens": max_tokens + THINKING_HEADROOM,
"output_config": {"effort": EFFORT},
}
def ask_json(
@@ -122,7 +125,11 @@ def ask_json(
NotConfigured: no API key.
ReadError: with one of the three messages above.
"""
request = {"model": MODEL, "messages": messages, **_model_options(MODEL, max_tokens)}
request = {
"model": MODEL,
"messages": messages,
**_model_options(MODEL, max_tokens),
}
if system is not None:
request["system"] = system
@@ -139,14 +146,19 @@ def ask_json(
# A refusal is a 200; log it as such rather than as an unparseable reply.
if getattr(message, "stop_reason", None) == "refusal":
log.warning("Claude declined the request: %s", getattr(message, "stop_details", None))
log.warning(
"Claude declined the request: %s", getattr(message, "stop_details", None)
)
raise ReadError(failed)
# By type: on a thinking model the first block may be a thinking block.
text = next((block.text for block in message.content if block.type == "text"), None)
if text is None:
if getattr(message, "stop_reason", None) == "max_tokens":
log.warning("Claude ran out of tokens before answering (max_tokens=%s)", request["max_tokens"])
log.warning(
"Claude ran out of tokens before answering (max_tokens=%s)",
request["max_tokens"],
)
raise ReadError(empty)
try: