diff --git a/navi/llm/ollama.py b/navi/llm/ollama.py index d164fe1..e63446e 100644 --- a/navi/llm/ollama.py +++ b/navi/llm/ollama.py @@ -160,6 +160,15 @@ except (LLMConnectionError, LLMModelNotFoundError, LLMBackendError): raise except Exception as e: + import structlog + log = structlog.get_logger() + log.warning( + "llm.ollama.chat_error", + model=resolved, + message_count=len(messages), + tools_count=len(tools) if tools else 0, + error=str(e), + ) raise _classify_error(e) from e async def stream_complete( @@ -215,6 +224,15 @@ except (LLMConnectionError, LLMModelNotFoundError, LLMBackendError): raise except Exception as e: + import structlog + log = structlog.get_logger() + log.warning( + "llm.ollama.chat_error", + model=resolved, + message_count=len(messages), + tools_count=len(tools) if tools else 0, + error=str(e), + ) raise _classify_error(e) from e async def embed(