diff --git a/app/src/git_commit_generator/ollama_client.py b/app/src/git_commit_generator/ollama_client.py index 5a3f821..c3b1a4d 100644 --- a/app/src/git_commit_generator/ollama_client.py +++ b/app/src/git_commit_generator/ollama_client.py @@ -38,9 +38,10 @@ class OllamaClient: True if model is available, False otherwise. """ try: - response = ollama_lib.list() + list_result = ollama_lib.list() + models = list_result.get("models", []) return any(m["name"] == model or m["name"].startswith(model) - for m in response.get("models", [])) + for m in models) except Exception: return False @@ -109,8 +110,8 @@ class OllamaClient: List of available models with their details. """ try: - response = ollama_lib.list() - return response.get("models", []) + list_result = ollama_lib.list() + return list_result.get("models", []) except Exception: return []