Add live context tool to LLM (#21754)

* Add live context tool

* Improve handling of images in request

* Improve prompt caching
This commit is contained in:
Nicolas Mowen
2026-02-26 21:27:56 -07:00
parent fa0feebd03
commit a4362caa0a
4 changed files with 188 additions and 5 deletions
+8 -1
View File
@@ -216,7 +216,14 @@ class LlamaCppClient(GenAIClient):
"finish_reason": "error",
}
except requests.exceptions.RequestException as e:
logger.warning("llama.cpp returned an error: %s", str(e))
error_detail = str(e)
if hasattr(e, "response") and e.response is not None:
try:
error_body = e.response.text
error_detail = f"{str(e)} - Response: {error_body[:500]}"
except Exception:
pass
logger.warning("llama.cpp returned an error: %s", error_detail)
return {
"content": None,
"tool_calls": None,